:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #1e1e1e;
  color: #f3f1ea;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
}

a {
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-shell {
  position: relative;
  min-height: var(--app-height, 100vh);
  padding: 0;
  isolation: isolate;
  background: #1e1e1e;
}

.terminal-surface {
  height: var(--app-height, 100vh);
  display: flex;
  align-items: stretch;
  cursor: text;
}

:root {
  --terminal-mono:
    ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", "Fira Code",
    Menlo, Consolas, "Liberation Mono", monospace;
}

.terminal-window {
  width: 100%;
  height: var(--app-height, 100vh);
  margin: 0;
  padding: 20px;
  border: 0;
  background: #1e1e1e;
  box-shadow: none;
  color: #ffffff;
  font-family: var(--terminal-mono);
  font-size: 1rem;
  line-height: 1.45;
  overflow: auto;
}

.terminal-entry {
  margin: 0 0 1rem;
}

.terminal-prompt,
.terminal-input-label {
  color: #f0a31a;
}

/* Preserve indentation when echoing multiline REPL input (`...` lines). */
.terminal-prompt {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.terminal-output {
  display: grid;
  gap: 0.65rem;
}

.terminal-text,
.terminal-file pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.terminal-error {
  color: #ffb0a3;
}

.terminal-panel,
.terminal-file,
.terminal-game-placeholder,
.terminal-game,
.nano-panel {
  max-height: min(34rem, 78vh);
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 0.85rem;
  border: 1px solid rgba(180, 210, 185, 0.18);
  background: rgba(255, 255, 255, 0.035);
}

.terminal-panel h2,
.terminal-game-placeholder h2 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  color: #e9d18e;
}

.terminal-game {
  width: min(100%, 48rem);
  max-height: none;
  margin-inline: auto;
  overflow: hidden;
  padding: 0.65rem;
  background:
    linear-gradient(180deg, rgba(84, 168, 242, 0.08), transparent 26%),
    rgba(255, 255, 255, 0.035);
}

.bubbles-game {
  position: relative;
}

.terminal-game-canvas {
  width: 100%;
  height: clamp(29rem, 72vh, 42rem);
  display: block;
  border: 1px solid rgba(180, 210, 185, 0.14);
  background: #08100d;
  outline: none;
  touch-action: none;
  cursor: crosshair;
}

.bubbles-resume-button {
  --resume-bubble-size: clamp(1.75rem, 4.2vw, 2.4rem);
  position: absolute;
  right: 0.65rem;
  bottom: 4.15rem;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 0.22rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #e9d18e;
  font: 700 0.72rem/1 SFMono-Regular, Consolas, monospace;
  letter-spacing: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.bubbles-resume-button svg {
  box-sizing: border-box;
  width: var(--resume-bubble-size);
  height: var(--resume-bubble-size);
  flex: 0 0 auto;
  padding: 0.38rem;
  border: 1px solid rgba(233, 209, 142, 0.68);
  border-radius: 999px;
  background: rgba(8, 16, 13, 0.9);
}

.bubbles-resume-button span {
  order: -1;
  max-width: 4.9rem;
  padding: 0.12rem 0.24rem;
  background: rgba(8, 16, 13, 0.82);
  text-align: center;
  text-wrap: balance;
}

.bubbles-resume-button:hover,
.bubbles-resume-button:focus-visible {
  color: #f3f1ea;
  outline: 2px solid rgba(233, 209, 142, 0.22);
  outline-offset: 2px;
}

.bubbles-resume-button:hover svg,
.bubbles-resume-button:focus-visible svg {
  border-color: #e9d18e;
}

.bubbles-resume-button-hidden {
  visibility: hidden;
  pointer-events: none;
}

.bubbles-ability-strip {
  position: absolute;
  left: 1rem;
  bottom: 5.45rem;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.38rem;
  pointer-events: none;
}

.bubbles-ability-cluster {
  display: grid;
  grid-template-columns: repeat(2, 2rem);
  gap: 0.38rem;
  pointer-events: none;
}

.bubbles-ability-bubble {
  position: relative;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(172, 215, 178, 0.52);
  border-radius: 999px;
  background: rgba(8, 16, 13, 0.88);
  color: #f3f1ea;
  font: 700 0.82rem/1 SFMono-Regular, Consolas, monospace;
  letter-spacing: 0;
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.bubbles-ability-bubble svg {
  width: 1.12rem;
  height: 1.12rem;
  display: block;
}

.bubbles-ability-count {
  position: absolute;
  right: -0.42rem;
  top: -0.42rem;
  min-width: 1rem;
  height: 1rem;
  padding-inline: 0.18rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(8, 16, 13, 0.88);
  border-radius: 999px;
  background: #e9d18e;
  color: #08100d;
  font: 700 0.58rem/1 SFMono-Regular, Consolas, monospace;
  letter-spacing: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.bubbles-ability-tooltip {
  position: absolute;
  left: 1rem;
  bottom: 8.15rem;
  z-index: 2;
  max-width: min(24rem, calc(100% - 2rem));
  padding: 0.42rem 0.55rem;
  border: 1px solid rgba(233, 209, 142, 0.42);
  background: rgba(8, 16, 13, 0.94);
  color: #f3f1ea;
  font: 700 0.68rem/1.35 SFMono-Regular, Consolas, monospace;
  letter-spacing: 0;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.35s ease;
}

button.bubbles-ability-bubble {
  padding: 0;
  cursor: pointer;
}

.bubbles-ability-bubble:hover,
.bubbles-ability-bubble:focus-visible {
  border-color: #e9d18e;
  color: #e9d18e;
  outline: 2px solid rgba(233, 209, 142, 0.22);
  outline-offset: 2px;
}

.bubbles-ability-bubble-hidden {
  display: none;
}

.bubbles-ability-tooltip-hidden {
  opacity: 0;
}

.bubbles-debug-controls {
  position: absolute;
  right: 0.95rem;
  top: 5.5rem;
  z-index: 2;
  display: flex;
  gap: 0.35rem;
}

.bubbles-debug-controls-shop {
  top: 0.9rem;
}

.bubbles-debug-controls button {
  padding: 0.25rem 0.45rem;
  border: 1px solid rgba(255, 179, 92, 0.5);
  background: rgba(8, 16, 13, 0.88);
  color: #ffb35c;
  font: 700 0.72rem/1 SFMono-Regular, Consolas, monospace;
  letter-spacing: 0;
  cursor: pointer;
}

.bubbles-debug-controls button:hover,
.bubbles-debug-controls button:focus-visible {
  border-color: #ffb35c;
  color: #f3f1ea;
  outline: 2px solid rgba(255, 179, 92, 0.22);
  outline-offset: 2px;
}

.bubbles-debug-control-hidden {
  display: none;
}

@media (max-width: 559px) {
  .bubbles-resume-button {
    right: 0.9rem;
    bottom: 4.35rem;
  }

  .bubbles-resume-button span {
    max-width: 4.2rem;
    font-size: 0.66rem;
  }

  .bubbles-ability-strip {
    left: 0.65rem;
    right: 0.65rem;
    bottom: 5.15rem;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }

  .bubbles-ability-cluster {
    display: flex;
    gap: 0.38rem;
  }

  .bubbles-ability-cluster-right {
    margin-left: auto;
    justify-content: flex-end;
  }

  .bubbles-ability-tooltip {
    left: 0.65rem;
    right: 0.65rem;
    bottom: 7.65rem;
    max-width: none;
    text-align: center;
  }

  .bubbles-ability-bubble {
    width: 1.8rem;
    height: 1.8rem;
  }

  .bubbles-debug-controls {
    top: 5rem;
  }

  .bubbles-debug-controls-shop {
    right: 1.25rem;
    top: 0.75rem;
  }
}

.terminal-game-canvas:focus-visible {
  border-color: rgba(156, 199, 255, 0.82);
  outline: 2px solid rgba(156, 199, 255, 0.28);
  outline-offset: 2px;
}

.terminal-game-header {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem 0.65rem;
  color: #e9d18e;
}

.terminal-game-fallback {
  min-height: 16rem;
  display: grid;
  place-items: center;
  color: rgba(199, 223, 201, 0.72);
}

.save-manager {
  display: grid;
  gap: 0.65rem;
  padding: 0.8rem;
  border: 1px solid rgba(180, 210, 185, 0.18);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(243, 241, 234, 0.84);
}

.save-manager-title {
  color: #e9d18e;
  font-weight: 700;
  text-transform: uppercase;
}

.save-manager p {
  margin: 0;
}

.save-manager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.save-manager button,
.save-manager-upload span {
  min-height: 2.2rem;
  display: inline-grid;
  place-items: center;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(199, 223, 201, 0.28);
  border-radius: 0;
  background: rgba(199, 223, 201, 0.08);
  color: #f3f1ea;
  font: inherit;
  cursor: pointer;
}

.save-manager button:disabled,
.save-manager-upload input:disabled + span {
  opacity: 0.52;
  cursor: default;
}

.save-manager button:focus-visible,
.save-manager-upload input:focus-visible + span {
  border-color: rgba(156, 199, 255, 0.82);
  outline: 2px solid rgba(156, 199, 255, 0.28);
  outline-offset: 2px;
}

.save-manager-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.save-manager-drop {
  min-height: 4.25rem;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(233, 209, 142, 0.48);
  color: rgba(233, 209, 142, 0.82);
}

.save-manager-message {
  min-height: 1.25rem;
  color: rgba(199, 223, 201, 0.78);
}

.textropolis-game {
  width: min(100%, 58rem);
  height: min(42rem, calc(100svh - 1.5rem));
  min-height: min(28rem, calc(100svh - 1.5rem));
  gap: clamp(0.45rem, 1.2svh, 0.75rem);
  overflow-x: hidden;
  overflow-y: auto;
  font-weight: 650;
}

.textropolis-game:focus-visible {
  outline: 2px solid rgba(156, 199, 255, 0.28);
  outline-offset: 2px;
}

.textropolis-loading,
.textropolis-error {
  min-height: 24rem;
  display: grid;
  place-items: center;
  color: rgba(243, 241, 234, 0.82);
}

.textropolis-error {
  color: #ffb8a8;
}

.textropolis-city-list {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 0.45rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.2rem;
}

.textropolis-city-card {
  --progress: 0%;
  position: relative;
  min-height: 2.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 0.15rem 0.75rem;
  align-items: center;
  padding: 0.4rem 0.65rem;
  border: 1px solid rgba(180, 210, 185, 0.18);
  border-radius: 0;
  background:
    linear-gradient(
      90deg,
      rgba(233, 209, 142, 0.2) 0 var(--progress),
      rgba(0, 0, 0, 0.22) var(--progress) 100%
    );
  color: #f3f1ea;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.textropolis-city-card:hover,
.textropolis-city-card:focus-visible {
  border-color: rgba(156, 199, 255, 0.82);
  outline: none;
}

.textropolis-city-card.locked {
  color: rgba(199, 223, 201, 0.44);
  cursor: default;
}

.textropolis-city-card small {
  grid-column: 1 / -1;
  color: rgba(199, 223, 201, 0.58);
  font-weight: 600;
}

.textropolis-city-population-summary {
  color: rgba(243, 241, 234, 0.82);
  text-align: right;
}

.textropolis-select-header {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.textropolis-select-progress {
  flex: 0 1 auto;
  min-width: max-content;
  text-align: right;
  white-space: nowrap;
}

.textropolis-city-header {
  align-items: center;
  align-content: flex-start;
  flex-wrap: wrap;
}

.textropolis-city-title {
  min-width: 0;
  flex: 1 1 8rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.textropolis-city-name {
  min-width: 0;
  line-height: 1.12;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.textropolis-city-stats {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0 0.55rem;
  margin-left: auto;
  text-align: right;
}

.textropolis-city-stats span {
  white-space: nowrap;
}

.textropolis-city-population {
  display: inline-flex;
  align-items: baseline;
  color: rgba(243, 241, 234, 0.82);
}

.textropolis-city-population::before {
  content: "|";
  margin-right: 0.55rem;
  color: #e9d18e;
}

.textropolis-exit-button {
  width: 2.2rem;
  min-width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(199, 223, 201, 0.28);
  border-radius: 0;
  background: rgba(199, 223, 201, 0.08);
  color: #c7dfc9;
  cursor: pointer;
  touch-action: manipulation;
}

.textropolis-exit-button:focus-visible {
  border-color: rgba(156, 199, 255, 0.82);
  outline: none;
}

.textropolis-exit-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.textropolis-word-strip {
  min-height: 2.1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.65rem;
  border-bottom: 1px solid rgba(180, 210, 185, 0.2);
  background: rgba(0, 0, 0, 0.18);
}

.textropolis-word-list-toggle {
  min-width: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-left: 1px solid rgba(180, 210, 185, 0.18);
  border-radius: 0;
  background: rgba(233, 209, 142, 0.08);
  color: #e9d18e;
  cursor: pointer;
  touch-action: manipulation;
}

.textropolis-word-list-toggle[aria-expanded="true"] {
  background: rgba(156, 199, 255, 0.14);
  color: #ffffff;
}

.textropolis-word-list-toggle:focus-visible {
  outline: 2px solid rgba(156, 199, 255, 0.5);
  outline-offset: -2px;
}

.textropolis-word-list-toggle span {
  width: 0.58rem;
  height: 0.58rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-0.1rem);
}

.textropolis-word-list-toggle[aria-expanded="true"] span {
  transform: rotate(225deg) translate(-0.05rem, -0.05rem);
}

.textropolis-word-ticker {
  min-width: 0;
  min-height: 2rem;
  position: relative;
  overflow: hidden;
}

.textropolis-ticker-track {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  box-sizing: content-box;
  padding: 0.32rem 0;
  color: rgba(243, 241, 234, 0.84);
  white-space: nowrap;
  animation: textropolis-ticker var(--ticker-duration, 58s) linear infinite;
  will-change: transform;
}

.textropolis-ticker-loop {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.textropolis-ticker-item {
  display: inline-flex;
  align-items: center;
}

.textropolis-ticker-word {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
}

.textropolis-ticker-separator {
  margin: 0 0.62rem;
  color: rgba(199, 223, 201, 0.42);
}

.textropolis-ticker-word.hint {
  color: #dbeaff;
}

.textropolis-ticker-word:hover,
.textropolis-ticker-word:focus-visible {
  color: #ffffff;
  outline: none;
}

.textropolis-ticker-loop.duplicate .textropolis-ticker-word {
  cursor: default;
}

.textropolis-ticker-dot {
  display: inline-block;
  margin: 0 1rem;
  color: rgba(199, 223, 201, 0.58);
  font-size: 1.1rem;
  line-height: 1;
  transform: translateY(-0.02rem);
}

.textropolis-definition-sky {
  --lane-gap: clamp(2.6rem, 6svh, 3.65rem);
  flex: 1 1 10rem;
  min-height: clamp(8rem, 22svh, 14rem);
  position: relative;
  overflow: hidden;
}

.textropolis-word-list-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  border: 1px solid rgba(156, 199, 255, 0.34);
  background: rgba(5, 12, 10, 0.94);
  box-shadow: inset 0 0 0 1px rgba(243, 241, 234, 0.04);
}

.textropolis-word-list-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.45rem;
}

.textropolis-word-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.35rem;
}

.textropolis-word-list-word {
  min-height: 2.35rem;
  display: grid;
  align-content: center;
  gap: 0.18rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid rgba(180, 210, 185, 0.18);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.24);
  color: #f3f1ea;
  font: inherit;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.textropolis-word-list-word.hint {
  grid-column: span 2;
  border-color: rgba(156, 199, 255, 0.28);
  background: rgba(156, 199, 255, 0.09);
  color: #dbeaff;
  text-transform: none;
}

.textropolis-word-list-word small {
  color: rgba(243, 241, 234, 0.62);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.textropolis-word-list-word:hover,
.textropolis-word-list-word:focus-visible {
  border-color: rgba(156, 199, 255, 0.82);
  outline: none;
}

.textropolis-word-list-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  color: rgba(243, 241, 234, 0.58);
}

.textropolis-definition-sky .textropolis-banner {
  position: absolute;
  inset: calc(var(--lane) * var(--lane-gap)) 0 auto 0;
}

.textropolis-banner-flight {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-sizing: content-box;
  padding-left: 100%;
  animation: textropolis-fly var(--duration, 12000ms) linear var(--delay, 0ms) both;
  will-change: transform;
}

.textropolis-plane {
  width: 2.25rem;
  height: 1.05rem;
  position: relative;
  display: inline-block;
  border-radius: 999px 50% 50% 999px;
  background: #e9d18e;
  box-shadow: inset -0.58rem 0 0 rgba(0, 0, 0, 0.22);
}

.textropolis-plane::before,
.textropolis-plane::after {
  content: "";
  position: absolute;
  left: 0.62rem;
  border-left: 0.72rem solid transparent;
  border-right: 0.24rem solid transparent;
}

.textropolis-plane::before {
  top: -0.56rem;
  border-bottom: 0.64rem solid #c7dfc9;
}

.textropolis-plane::after {
  bottom: -0.5rem;
  border-top: 0.58rem solid #c7dfc9;
}

.textropolis-banner.hint .textropolis-plane {
  background: #9cc7ff;
  box-shadow: inset -0.58rem 0 0 rgba(0, 0, 0, 0.2);
}

.textropolis-banner.hint .textropolis-plane::before {
  border-bottom-color: #e9d18e;
}

.textropolis-banner.hint .textropolis-plane::after {
  border-top-color: #e9d18e;
}

.textropolis-rope {
  width: 1.4rem;
  height: 1px;
  display: inline-block;
  transform: translateY(-0.23rem) rotate(5deg);
  background: rgba(199, 223, 201, 0.55);
}

.textropolis-rope.lower {
  margin-left: -1.75rem;
  transform: translateY(0.28rem) rotate(-5deg);
}

.textropolis-ad {
  display: inline-block;
  width: max-content;
  max-width: min(68vw, 52rem);
  min-width: min(20rem, 68vw);
  max-height: calc(var(--lane-gap) - 0.2rem);
  padding: 0.22rem 0.65rem;
  border: 1px solid rgba(233, 209, 142, 0.56);
  background: rgba(233, 209, 142, 0.12);
  color: rgba(243, 241, 234, 0.92);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.18;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.textropolis-banner.hint .textropolis-rope {
  background: rgba(156, 199, 255, 0.58);
}

.textropolis-banner.hint .textropolis-ad {
  border-color: rgba(156, 199, 255, 0.66);
  background: rgba(156, 199, 255, 0.13);
  color: #f7fbff;
}

.textropolis-current-word {
  min-height: clamp(2.65rem, 7svh, 4rem);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: clamp(2.25rem, 6svh, 4.5rem);
  line-height: 1;
  text-transform: uppercase;
}

.textropolis-current-word.invalid-a {
  animation: textropolis-invalid-word-a 360ms ease-out;
}

.textropolis-current-word.invalid-b {
  animation: textropolis-invalid-word-b 360ms ease-out;
}

.textropolis-feedback {
  min-height: 1.4rem;
  color: rgba(243, 241, 234, 0.72);
  text-align: center;
}

.textropolis-feedback.good {
  color: #c7dfc9;
}

.textropolis-feedback.good.pulse-a {
  animation: textropolis-population-pop-a 980ms ease-out forwards;
}

.textropolis-feedback.good.pulse-b {
  animation: textropolis-population-pop-b 980ms ease-out forwards;
}

.textropolis-feedback.warn {
  color: #e9d18e;
}

.textropolis-feedback.error {
  color: #ffb8a8;
}

.textropolis-keyboard {
  margin-top: auto;
  margin-right: -0.65rem;
  margin-bottom: -0.65rem;
  margin-left: -0.65rem;
  flex: 0 0 auto;
  border: 1px solid rgba(180, 210, 185, 0.2);
  background: rgba(0, 0, 0, 0.28);
}

.textropolis-letters {
  display: grid;
  grid-template-columns: repeat(var(--letter-cols, 4), minmax(0, 1fr));
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.textropolis-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid rgba(180, 210, 185, 0.2);
}

.textropolis-letters button,
.textropolis-controls button {
  min-height: clamp(2.35rem, 5.5svh, 3rem);
  border: 0;
  border-right: 1px solid rgba(180, 210, 185, 0.14);
  border-bottom: 1px solid rgba(180, 210, 185, 0.14);
  border-radius: 0;
  background: transparent;
  color: #f3f1ea;
  font: inherit;
  cursor: pointer;
  user-select: none;
}

.textropolis-letters button {
  touch-action: none;
  -webkit-touch-callout: none;
}

.textropolis-controls button {
  touch-action: manipulation;
}

.textropolis-controls button:disabled {
  color: rgba(199, 223, 201, 0.32);
  cursor: default;
}

.textropolis-letters button:focus-visible,
.textropolis-controls button:focus-visible {
  background: rgba(156, 199, 255, 0.12);
  outline: none;
}

.textropolis-letters button.selected {
  color: rgba(199, 223, 201, 0.38);
  cursor: default;
}

@media (hover: hover) {
  .textropolis-letters button:hover,
  .textropolis-controls button:not(:disabled):hover,
  .textropolis-word-list-toggle:hover,
  .textropolis-exit-button:hover {
    background: rgba(156, 199, 255, 0.12);
  }
}

@media (hover: none) {
  .textropolis-letters button:focus,
  .textropolis-controls button:focus {
    background: transparent;
    outline: none;
  }
}

.wordhunt-game {
  width: min(100%, calc(100vw - 1rem));
  height: auto;
  min-height: 0;
  max-height: none;
  align-items: center;
  gap: 0;
  position: relative;
  overflow: hidden;
  padding: 0.28rem;
  border: 0;
  background: transparent;
  font-weight: 650;
  -webkit-tap-highlight-color: transparent;
}

.wordhunt-game:focus-visible {
  outline: none;
}

.wordhunt-loading,
.wordhunt-error {
  min-height: 24rem;
  display: grid;
  place-items: center;
  color: rgba(243, 241, 234, 0.82);
}

.wordhunt-error {
  color: #ffb8a8;
}

.wordhunt-stage {
  --wordhunt-rows: 12;
  --wordhunt-cols: 12;
  --wordhunt-fixed-width: 27rem;
  --wordhunt-fixed-width-mobile: 24.84rem;
  flex: 0 1 auto;
  min-height: 0;
  max-height: none;
  width: min(100%, calc(100vw - 1rem), 48rem);
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 0.35rem;
}

.wordhunt-game.wordhunt-fixed-size .wordhunt-stage {
  width: min(100%, var(--wordhunt-fixed-width), calc(100vw - 1rem), 48rem);
}

.wordhunt-header {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
}

.wordhunt-count {
  color: rgba(243, 241, 234, 0.82);
  font-size: 0.86rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 0.38rem;
}

.wordhunt-subword-count {
  color: #9cc7ff;
}

.wordhunt-actions {
  justify-self: end;
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
}

.wordhunt-actions button,
.wordhunt-dialog-header button,
.wordhunt-win-actions button {
  min-height: 2rem;
  display: inline-grid;
  place-items: center;
  padding: 0.3rem 0.55rem;
  border: 1px solid rgba(199, 223, 201, 0.28);
  border-radius: 0;
  background: rgba(199, 223, 201, 0.08);
  color: #f3f1ea;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.wordhunt-actions button:focus-visible,
.wordhunt-dialog-header button:focus-visible,
.wordhunt-win-actions button:focus-visible {
  border-color: rgba(156, 199, 255, 0.82);
  outline: 2px solid rgba(156, 199, 255, 0.28);
  outline-offset: 2px;
}

.wordhunt-feedback {
  min-width: 0;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(243, 241, 234, 0.72);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wordhunt-feedback.good {
  color: #c7dfc9;
}

.wordhunt-feedback.warn {
  color: #e9d18e;
}

.wordhunt-feedback.error {
  color: #ffb8a8;
}

.wordhunt-board-wrap {
  min-height: 0;
  width: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.wordhunt-grid {
  position: relative;
  width: 100%;
  max-height: none;
  aspect-ratio: var(--wordhunt-cols) / var(--wordhunt-rows);
  display: grid;
  grid-template-columns: repeat(var(--wordhunt-cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--wordhunt-rows), minmax(0, 1fr));
  border: 1px solid rgba(180, 210, 185, 0.24);
  background: rgba(0, 0, 0, 0.28);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.wordhunt-path-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.wordhunt-path-mark {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 0.7;
}

.wordhunt-path-mark-found {
  stroke: rgba(199, 223, 201, 0.38);
  stroke-width: 0.74;
}

.wordhunt-path-mark-revealed {
  stroke: rgba(233, 209, 142, 0.28);
  stroke-width: 0.62;
}

.wordhunt-path-mark-subword {
  stroke: rgba(156, 199, 255, 0.72);
  stroke-width: 0.5;
  stroke-dasharray: 0.34 0.2;
}

.wordhunt-path-mark-selected {
  stroke: rgba(233, 209, 142, 0.62);
  stroke-width: 0.82;
}

.wordhunt-cell {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-right: 1px solid rgba(180, 210, 185, 0.12);
  border-bottom: 1px solid rgba(180, 210, 185, 0.12);
  border-radius: 0;
  background: transparent;
  color: #f3f1ea;
  font: 800 clamp(1.08rem, 2.025vw, 1.83rem) / 1 var(--terminal-mono);
  letter-spacing: 0;
  cursor: pointer;
  touch-action: none;
}

.wordhunt-cell > span:first-child {
  position: relative;
  z-index: 1;
  width: min(1.62em, calc(100% - 0.28rem));
  height: min(1.08em, calc(100% - 0.28rem));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  line-height: 1;
}

.wordhunt-cell.found > span:first-child {
  border-color: transparent;
  background: transparent;
  color: #f7fff8;
}

.wordhunt-cell.revealed > span:first-child {
  border-color: transparent;
  background: transparent;
  color: #fff6d8;
}

.wordhunt-cell.selected {
  background: transparent;
  box-shadow: none;
  color: #ffffff;
}

.wordhunt-cell.selected > span:first-child {
  border-color: transparent;
  background: transparent;
}

.wordhunt-cell.focused {
  box-shadow: inset 0 0 0 2px rgba(156, 199, 255, 0.54);
}

.wordhunt-cell.selected.focused {
  box-shadow: inset 0 0 0 2px rgba(156, 199, 255, 0.54);
}

.wordhunt-cell:focus-visible {
  outline: 2px solid rgba(156, 199, 255, 0.82);
  outline-offset: -2px;
}

.wordhunt-cell small {
  position: absolute;
  top: 0.08rem;
  right: 0.12rem;
  min-width: 0.82rem;
  height: 0.82rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(233, 209, 142, 0.58);
  border-radius: 999px;
  background: rgba(5, 12, 10, 0.86);
  color: #fff6d8;
  font-size: 0.52rem;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}

.wordhunt-info-line {
  height: 3.15rem;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.35rem;
  padding: 0.18rem 0.1rem;
  color: rgba(243, 241, 234, 0.76);
  text-align: center;
  overflow: hidden;
}

.wordhunt-info-line strong {
  flex: 0 0 auto;
  color: #e9d18e;
  padding-top: 0.05rem;
}

.wordhunt-info-line span,
.wordhunt-info-definition {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.24;
  white-space: normal;
}

.wordhunt-info-line button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: 0;
  cursor: pointer;
}

.wordhunt-info-definition {
  padding: 0;
  text-align: left;
}

.wordhunt-info-more {
  max-width: min(18rem, 34vw);
  padding: 0.05rem 0 0;
  color: #e9d18e;
  text-align: right;
  white-space: nowrap;
}

.wordhunt-info-line button:focus-visible {
  outline: 1px solid rgba(156, 199, 255, 0.6);
  outline-offset: 2px;
}

.wordhunt-info-empty {
  grid-column: 1 / -1;
  color: rgba(243, 241, 234, 0.38);
}

.wordhunt-dialog-backdrop {
  position: absolute;
  inset: 0.65rem;
  z-index: 6;
  display: grid;
  place-items: stretch;
  background: rgba(5, 12, 10, 0.72);
}

.wordhunt-dialog {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(156, 199, 255, 0.38);
  background: rgba(5, 12, 10, 0.96);
  box-shadow: inset 0 0 0 1px rgba(243, 241, 234, 0.04);
}

.wordhunt-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem;
  border-bottom: 1px solid rgba(180, 210, 185, 0.18);
}

.wordhunt-dialog-header h2 {
  margin: 0;
  color: #e9d18e;
  font-size: 0.98rem;
}

.wordhunt-word-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 0.22rem;
  padding: 0.45rem;
}

.wordhunt-word-entry {
  width: 100%;
  min-width: 0;
  min-height: 2rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.35rem;
  align-content: center;
  align-items: center;
  padding: 0.28rem 0.42rem;
  border: 1px solid rgba(180, 210, 185, 0.18);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.24);
  color: rgba(243, 241, 234, 0.84);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.wordhunt-word-entry.found {
  border-color: rgba(199, 223, 201, 0.46);
  background: rgba(199, 223, 201, 0.1);
}

.wordhunt-word-entry.revealed {
  border-color: rgba(233, 209, 142, 0.42);
  background: rgba(233, 209, 142, 0.08);
}

.wordhunt-word-entry.subword {
  border-color: rgba(156, 199, 255, 0.36);
  background: rgba(156, 199, 255, 0.08);
}

.wordhunt-word-entry.bonus {
  border-color: rgba(105, 209, 125, 0.42);
  background: rgba(105, 209, 125, 0.08);
}

.wordhunt-word-entry.selected {
  border-color: rgba(156, 199, 255, 0.78);
  background: rgba(156, 199, 255, 0.1);
}

.wordhunt-word-entry:focus-visible,
.wordhunt-word-entry:hover {
  border-color: rgba(156, 199, 255, 0.82);
  outline: none;
}

.wordhunt-word-status {
  width: 1rem;
  color: #e9d18e;
  text-align: center;
}

.wordhunt-word-text {
  min-width: 0;
  color: #f3f1ea;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wordhunt-dictionary-page {
  min-height: 0;
  display: grid;
  grid-template-columns: 1.45rem minmax(10rem, 0.75fr) minmax(0, 1.25fr);
  gap: 0.45rem;
  padding: 0.45rem;
}

.wordhunt-alphabet-scrollbar {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-auto-rows: minmax(1rem, 1fr);
  align-content: stretch;
  border-right: 1px solid rgba(180, 210, 185, 0.14);
  padding-right: 0.22rem;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.wordhunt-alphabet-scrollbar button,
.wordhunt-alphabet-scrollbar span {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(243, 241, 234, 0.72);
  font: inherit;
  font-size: 0.72rem;
  line-height: 1;
  text-decoration: none;
  touch-action: none;
}

.wordhunt-alphabet-scrollbar button {
  cursor: pointer;
}

.wordhunt-alphabet-scrollbar span.disabled {
  color: rgba(243, 241, 234, 0.22);
}

.wordhunt-alphabet-scrollbar button:focus-visible {
  outline: 1px solid rgba(156, 199, 255, 0.72);
  outline-offset: -1px;
}

.wordhunt-definition-page-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(180, 210, 185, 0.18);
  background: rgba(0, 0, 0, 0.2);
}

.wordhunt-definition-title {
  min-width: 0;
  padding: 0.42rem 0.5rem 0.2rem;
  color: #e9d18e;
}

.wordhunt-definition-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 0.5rem 0.5rem;
  color: rgba(243, 241, 234, 0.78);
}

.wordhunt-definition-scroll p {
  margin: 0 0 0.55rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.wordhunt-win-backdrop {
  place-items: center;
  padding: 1rem;
}

.wordhunt-win-dialog {
  width: min(22rem, 100%);
  min-height: 0;
  grid-template-rows: auto;
}

.wordhunt-win-body {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem;
  text-align: center;
}

.wordhunt-win-body h2,
.wordhunt-win-body p {
  margin: 0;
}

.wordhunt-win-body h2 {
  color: #e9d18e;
  font-size: 1rem;
}

.wordhunt-win-body p {
  color: rgba(243, 241, 234, 0.72);
}

.wordhunt-win-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

@keyframes textropolis-fly {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

@keyframes textropolis-ticker {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@keyframes textropolis-invalid-word-a {
  0%,
  100% {
    color: #ffffff;
    text-shadow: none;
  }

  38% {
    color: #ffb8a8;
    text-shadow: 0 0 0.75rem rgba(255, 92, 92, 0.38);
  }
}

@keyframes textropolis-invalid-word-b {
  0%,
  100% {
    color: #ffffff;
    text-shadow: none;
  }

  38% {
    color: #ffb8a8;
    text-shadow: 0 0 0.75rem rgba(255, 92, 92, 0.38);
  }
}

@keyframes textropolis-population-pop-a {
  0% {
    opacity: 0;
    transform: translateY(0.35rem) scale(0.96);
  }

  24% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  72% {
    opacity: 1;
    transform: translateY(-0.08rem) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-0.45rem) scale(0.98);
  }
}

@keyframes textropolis-population-pop-b {
  0% {
    opacity: 0;
    transform: translateY(0.35rem) scale(0.96);
  }

  24% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  72% {
    opacity: 1;
    transform: translateY(-0.08rem) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-0.45rem) scale(0.98);
  }
}

.terminal-file-title,
.nano-panel-header {
  margin-bottom: 0.55rem;
  color: #e9d18e;
}

.terminal-input-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  margin-top: 0;
}

.terminal-input {
  min-width: 0;
  min-height: 0;
  line-height: 1.45rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  font-family: var(--terminal-mono);
  font-size: inherit;
  font-weight: inherit;
  -webkit-appearance: none;
  appearance: none;
  cursor: text;
  /* Multiline command editor: grows by rows, no manual resize or scrollbar. */
  resize: none;
  overflow: hidden;
  white-space: pre;
}

.terminal-input:focus {
  border-color: rgba(156, 199, 255, 0.82);
  outline: none;
}

.terminal-submit,
.nano-actions button {
  min-height: 2.35rem;
  padding: 0 0.85rem;
  border: 1px solid rgba(180, 210, 185, 0.24);
  border-radius: 0;
  background: rgba(172, 215, 178, 0.13);
  color: #f3f1ea;
  font: inherit;
  cursor: pointer;
}

.terminal-submit {
  display: none;
}

.terminal-submit:hover,
.terminal-submit:focus-visible,
.nano-actions button:hover,
.nano-actions button:focus-visible {
  border-color: rgba(156, 199, 255, 0.82);
  outline: none;
}

.nano-panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}

.nano-panel-state {
  color: rgba(199, 223, 201, 0.68);
}

.nano-editor {
  width: 100%;
  min-height: 16rem;
  max-height: 52vh;
  resize: vertical;
  padding: 0.75rem;
  border: 1px solid rgba(180, 210, 185, 0.2);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.28);
  color: #f3f1ea;
  font: inherit;
}

.nano-editor:focus-visible {
  border-color: rgba(156, 199, 255, 0.82);
  outline: 2px solid rgba(156, 199, 255, 0.28);
  outline-offset: 2px;
}

.nano-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.nano-editor-hidden,
.nano-actions-hidden {
  display: none;
}

.profile-overlay {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 340px;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 2.6rem 1.7rem 2.45rem;
  border: 0;
  border-top: 0.55rem double #7f3dff;
  border-bottom: 0.55rem double #7f3dff;
  background: transparent;
  box-shadow: none;
  color: #a9a9a9;
  font-family: Georgia, "Times New Roman", Times, serif;
  text-align: center;
  transform: translate(-50%, -50%);
  transition:
    opacity 160ms ease,
    visibility 160ms ease;
}

.profile-overlay-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.profile-overlay h1 {
  margin: 0;
  color: inherit;
  font-size: 2.15rem;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
}

.profile-role {
  margin: 1.25rem 0 0;
  color: inherit;
  font-size: 2rem;
  line-height: 1.2;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 1.45rem;
  margin-top: 2rem;
}

.contact-links a {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  color: inherit;
  line-height: 1;
  text-decoration: none;
}

.contact-icon {
  width: 100%;
  height: 100%;
  display: block;
}

.contact-icon-expanded {
  width: 118%;
  height: 118%;
}

.contact-links a:hover,
.contact-links a:focus-visible {
  color: #ffffff;
  outline: 0;
}

.contact-links a:focus-visible .contact-icon {
  filter: drop-shadow(0 0 0.35rem rgba(255, 255, 255, 0.8));
}

@media (max-width: 640px) {
  .site-shell {
    padding: 0;
  }

  .profile-overlay {
    max-height: calc(100vh - 1.5rem);
    width: min(340px, calc(100vw - 1.5rem));
    padding: 2rem 1rem;
  }

  .profile-overlay h1 {
    font-size: 2rem;
  }

  .profile-role {
    font-size: 1.65rem;
  }

  .contact-links {
    gap: 1.1rem;
    margin-top: 1.6rem;
  }

  .contact-links a {
    width: 2.45rem;
    height: 2.45rem;
  }

  .terminal-input-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .nano-panel {
    max-height: 70vh;
  }

  .terminal-game {
    padding: 0.35rem;
  }

  .terminal-game-canvas {
    height: clamp(28rem, 72vh, 36rem);
  }

  .textropolis-game {
    height: min(38rem, calc(100svh - 0.8rem));
    min-height: min(26rem, calc(100svh - 0.8rem));
    gap: clamp(0.32rem, 1.2svh, 0.6rem);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .textropolis-keyboard {
    margin-right: -0.35rem;
    margin-bottom: -0.35rem;
    margin-left: -0.35rem;
  }

  .textropolis-word-ticker {
    min-height: 1.55rem;
  }

  .textropolis-word-strip {
    min-height: 1.75rem;
    grid-template-columns: minmax(0, 1fr) 2.35rem;
  }

  .textropolis-ticker-track {
    padding-block: 0.2rem;
  }

  .textropolis-word-list-scroll {
    padding: 0.35rem;
  }

  .textropolis-word-list-grid {
    grid-template-columns: repeat(auto-fill, minmax(6.2rem, 1fr));
    gap: 0.28rem;
  }

  .textropolis-word-list-word.hint {
    grid-column: 1 / -1;
  }

  .terminal-game-header {
    font-size: 0.86rem;
    line-height: 1.15;
  }

  .textropolis-exit-button {
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
  }

  .textropolis-banner-flight {
    gap: 0.25rem;
  }

  .textropolis-ad {
    min-width: min(14rem, 74vw);
    max-width: 74vw;
    max-height: calc(var(--lane-gap) - 0.18rem);
    padding: 0.16rem 0.45rem;
    font-size: 0.62rem;
    line-height: 1.15;
  }

  .textropolis-definition-sky {
    --lane-gap: clamp(2.35rem, 6svh, 3rem);
    flex: 1 1 auto;
    min-height: clamp(8rem, 24svh, 12.5rem);
  }

  .textropolis-current-word {
    min-height: clamp(2.2rem, 8svh, 3.2rem);
    font-size: clamp(1.8rem, 10vw, 3.2rem);
  }

  .textropolis-feedback {
    min-height: 1rem;
    font-size: 0.82rem;
    line-height: 1.15;
  }

  .textropolis-city-list {
    min-height: 0;
    gap: 0.5rem;
  }

  .textropolis-city-card {
    min-height: 3.05rem;
  }

  .textropolis-letters button,
  .textropolis-controls button {
    min-height: clamp(2.4rem, 7.5svh, 3rem);
  }

  .textropolis-controls button {
    font-size: 0.72rem;
  }

  .textropolis-city-stats {
    align-self: flex-end;
  }

  .wordhunt-game {
    width: min(100%, calc(100vw - 16px));
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 0.12rem;
  }

  .wordhunt-game.wordhunt-fixed-size {
    max-height: none;
  }

  .wordhunt-stage {
    width: min(100%, calc(100vw - 28px), 430px);
    grid-template-rows: auto auto auto;
    align-content: stretch;
    gap: 0.22rem;
  }

  .wordhunt-game.wordhunt-fixed-size .wordhunt-stage {
    width: min(
      100%,
      var(--wordhunt-fixed-width-mobile),
      calc(100vw - 28px),
      430px
    );
  }

  .wordhunt-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.32rem;
  }

  .wordhunt-count,
  .wordhunt-feedback,
  .wordhunt-actions {
    grid-row: 1;
  }

  .wordhunt-count {
    grid-column: 1;
  }

  .wordhunt-feedback {
    grid-column: 2;
    height: 1.05rem;
    justify-content: center;
    font-size: 0.7rem;
    line-height: 1.15;
  }

  .wordhunt-actions {
    grid-column: 3;
    width: auto;
    justify-content: flex-end;
    display: flex;
  }

  .wordhunt-actions button {
    min-height: 1.7rem;
    min-width: 0;
    padding: 0.18rem 0.28rem;
    font-size: 0.68rem;
  }

  .wordhunt-grid {
    width: 100%;
    max-width: 100%;
    max-height: none;
    justify-self: center;
  }

  .wordhunt-cell {
    font-size: 1.23rem;
  }

  .wordhunt-cell > span:first-child {
    width: auto;
    min-width: 1.05em;
    height: 1em;
  }

  .wordhunt-path-mark {
    stroke-width: 0.64;
  }

  .wordhunt-path-mark-selected {
    stroke-width: 0.76;
  }

  .wordhunt-cell small {
    top: 0.04rem;
    right: 0.05rem;
    min-width: 0.62rem;
    height: 0.62rem;
    display: grid;
    font-size: 0.4rem;
  }

  .wordhunt-info-line {
    height: 2.72rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 0.12rem 0.2rem;
    font-size: 0.68rem;
    line-height: 1.16;
  }

  .wordhunt-info-more {
    grid-column: auto;
    max-width: 34vw;
    justify-self: end;
    font-size: 0.64rem;
  }

  .wordhunt-dialog-backdrop {
    inset: 0.35rem;
  }

  .wordhunt-dialog-header {
    padding: 0.38rem;
  }

  .wordhunt-dictionary-page {
    grid-template-columns: 1.25rem minmax(0, 1fr);
    grid-template-rows: minmax(0, 0.55fr) minmax(0, 0.45fr);
    gap: 0.32rem;
    padding: 0.35rem;
  }

  .wordhunt-alphabet-scrollbar {
    grid-row: 1 / 3;
    grid-column: 1;
  }

  .wordhunt-word-list {
    grid-row: 1;
    grid-column: 2;
    grid-template-columns: 1fr;
    padding: 0;
  }

  .wordhunt-word-entry {
    min-height: 1.85rem;
    padding: 0.24rem 0.34rem;
  }

  .wordhunt-definition-page-panel {
    grid-row: 2;
    grid-column: 2;
  }

  .wordhunt-definition-title {
    padding: 0.34rem 0.42rem 0.14rem;
  }

  .wordhunt-definition-scroll {
    padding: 0 0.42rem 0.42rem;
  }

  .wordhunt-definition-scroll p {
    margin-bottom: 0.42rem;
    font-size: 0.72rem;
    line-height: 1.28;
  }

  .wordhunt-win-backdrop {
    padding: 0.6rem;
  }

  .wordhunt-win-body {
    padding: 0.7rem;
  }

  .wordhunt-win-actions {
    grid-template-columns: 1fr;
    gap: 0.32rem;
  }

  .nano-editor {
    min-height: 12rem;
    max-height: 44vh;
  }
}

@media (max-width: 420px) {
  .textropolis-city-stats {
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
  }

  .textropolis-city-population::before {
    content: "";
    margin-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
