/* The web version of the game: the colours and fonts of the app (UI/Theme.cs). */
@font-face {
  font-family: "Ubuntu Mono";
  src: url("fonts/UbuntuMono-Regular.ttf") format("truetype");
  font-display: block;
}
/* Titles and big buttons in the cats theme. */
@font-face {
  font-family: "Baloo 2";
  src: url("fonts/Baloo2-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
/* Only for the symbols of symbol boards, which the game draws with this font too. */
@font-face {
  font-family: "Noto Sans Symbols 2";
  src: url("fonts/NotoSansSymbols2-Regular.ttf") format("truetype");
  unicode-range: U+2190-2BFF;
}

:root {
  --bg: #182030;
  --title: #ffd666;
  --text: #ecf0f5;
  --dim: #96a2b4;
  --button: #3468a8;
  --disabled: #2c3648;
  --off: #2c3a52;
  --done: #2e7d5a;
  --panel: #222c40;
  --warning: #ff7864;
  --worditto: #b8860b;
  --board: #f6f1e4;
  --resume: #3468a8;
  --overlay: rgba(24, 32, 48, 0.94);
  --radius: 0;
  --small-radius: 0;
  --font: "Ubuntu Mono", ui-monospace, Menlo, Consolas, monospace;
  --display: var(--font);
  color-scheme: dark;
}

/* The cats theme (UI/Theme.cs): a deeper navy, brighter blue buttons, lavender subtexts, rounded corners and kittens. */
:root[data-theme="cats"] {
  --bg: #10243f;
  --title: #ffd966;
  --dim: #8fa6e0;
  --button: #2e8bd8;
  --disabled: #233a57;
  --off: #2f4f73;
  --done: #2f9563;
  --panel: #1a3252;
  --board: #f7f3e9;
  --resume: #fc5185;
  --overlay: rgba(16, 36, 63, 0.94);
  --radius: 10px;
  --small-radius: 8px;
  --outline: #0a1630;
  --display: "Baloo 2", var(--font);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 20px/1.3 var(--font);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; }

#app { position: relative; z-index: 1; height: 100%; }

/* Paw prints on the background, behind the screens. */
#paws { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; fill: #3f5fc8; opacity: 0.55; pointer-events: none; }

/* A kitten from the sheet: 6 a row, 5 rows. Only the cats theme shows them. */
.sticker {
  display: none;
  background: url("content/stickers.png") no-repeat;
  background-size: 600% 500%;
  pointer-events: none;
}
[data-theme="cats"] .sticker { display: inline-block; }
.under-menu { width: 120px; height: 120px; margin: 12px auto 0; }
[data-theme="cats"] .under-menu, [data-theme="cats"] .over-back { display: block; }
.over-back { width: 120px; height: 120px; margin: 4px auto -14px; }
.back-gap { height: 24px; }
[data-theme="cats"] .back-gap { display: none; }
.section-title .face { width: 26px; height: 26px; vertical-align: -6px; margin-right: 6px; }

/* A title's rays, on both sides of it: only in the cats theme, and if they fit (fitRays in app.js). */
.rayed .t { position: relative; display: inline-block; }
.rays-left, .rays-right { display: none; position: absolute; top: 50%; color: inherit; }
.rays-left svg, .rays-right svg { display: block; width: 0.8em; height: 1em; fill: none; stroke: currentColor; stroke-width: 9; stroke-linecap: round; overflow: visible; }
.rays-left { right: 100%; transform: translateY(-50%) scaleX(-1); }
.rays-right { left: 100%; transform: translateY(-50%); }
[data-theme="cats"] .rays-left, [data-theme="cats"] .rays-right { display: block; }
[data-theme="cats"] .no-rays .rays-left, [data-theme="cats"] .no-rays .rays-right { display: none; }

.loading { text-align: center; color: var(--dim); padding-top: 40vh; margin: 0; }

.sym { font-family: "Noto Sans Symbols 2", var(--font); }

/* An emoji of the board, from the atlas (background set by app.js). */
.emoji {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.2em;
  background-repeat: no-repeat;
}

/* ---- Menus ---- */

.screen {
  height: 100%;
  overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}
.column { max-width: 520px; margin: 0 auto; }
.column.wide { max-width: 1040px; }

.screen h1 {
  color: var(--title);
  font-weight: normal;
  font-size: 44px;
  text-align: center;
  margin: 8vh 0 8px;
  line-height: 1.1;
}
.screen .subtitle { color: var(--dim); text-align: center; margin: 0 0 32px; font-size: 20px; }
.screen .subtitle.tight { margin-bottom: 16px; }

[data-theme="cats"] .screen h1, [data-theme="cats"] .topbar h2, [data-theme="cats"] .overlay h2, [data-theme="cats"] .overlay h3 {
  font-family: var(--display);
  font-weight: 700;
  -webkit-text-stroke: 0.14em var(--outline);
  paint-order: stroke fill;
}

/* The home screen's name: in the cats theme, two lines of bubble letters. */
[data-theme="cats"] .screen .home-title { margin-top: 3vh; -webkit-text-stroke: 0; }
[data-theme="cats"] .home-title .mega, [data-theme="cats"] .home-title .name { display: block; -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
[data-theme="cats"] .home-title .mega { font-size: min(80px, 20vw); line-height: 1; }
[data-theme="cats"] .home-title .mega svg { font-size: 0.6em; }
[data-theme="cats"] .home-title .name { font-size: min(64px, 14.5vw); line-height: 1.05; color: #fff; }

.menu { display: flex; flex-direction: column; gap: 14px; max-width: 360px; margin: 0 auto; }

.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: var(--button);
  color: var(--text);
  padding: 14px 12px;
  font-size: 24px;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover:not(:disabled) { filter: brightness(1.1); }
.btn:active:not(:disabled) { filter: brightness(0.8); }
.btn:disabled { background: var(--disabled); color: var(--dim); cursor: default; }
.btn.done { background: var(--done); }
.btn.secondary { background: var(--off); }
.btn.resume { background: var(--resume); }
.screen .menu .btn { font-family: var(--display); font-weight: 700; }
.screen .menu .btn small { font-family: var(--font); font-weight: normal; }
/* The first home button hops now and then (UI/Bounce.cs), in a theme with kittens. */
[data-theme="cats"] .menu.home .btn:first-child { animation: hop 2.6s 0.8s infinite; }
@keyframes hop {
  0%, 17.3% { transform: translateY(0); animation-timing-function: cubic-bezier(0.3, 0.6, 0.6, 1); }
  8.65% { transform: translateY(-7px); animation-timing-function: cubic-bezier(0.4, 0, 0.7, 0.4); }
  23% { transform: translateY(-2.1px); animation-timing-function: cubic-bezier(0.4, 0, 0.7, 0.4); }
  28.8%, 100% { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  [data-theme="cats"] .menu.home .btn:first-child { animation: none; }
}
.btn small { display: block; font-size: 15px; color: #c8d2e4; margin-top: 2px; }
.btn:disabled small { color: var(--dim); }

.topbar {
  position: sticky;
  top: calc(-1 * max(16px, env(safe-area-inset-top)));
  z-index: 2;
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 8px;
  margin: calc(-1 * max(16px, env(safe-area-inset-top))) -16px 8px;
  padding: max(8px, env(safe-area-inset-top)) 8px 8px;
  background: var(--bg);
}
/* Taller in a theme with kittens, for the one holding on to the back button. */
[data-theme="cats"] .topbar { padding-top: max(40px, env(safe-area-inset-top)); align-items: end; }
[data-theme="cats"] .topbar .icon-btn { height: 38px; }
.topbar h2 { margin: 0; text-align: center; color: var(--title); font-weight: normal; font-size: 30px; }
.topbar .count { color: var(--dim); text-align: right; font-size: 18px; padding-right: 4px; }
.icon-btn {
  position: relative;
  width: 56px;
  height: 48px;
  border: 0;
  border-radius: var(--radius);
  background: var(--button);
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.icon-btn:disabled { background: var(--disabled); color: var(--dim); cursor: default; }
.icon-btn svg { width: 30px; height: 30px; fill: currentColor; }
.back .sticker { position: absolute; width: 59px; height: 59px; left: -1.5px; top: -40px; }

/* The options' tabs, joined as one bar; the one shown in the continue button's colour. */
.tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 8px 0 14px; }
.tab { border: 0; background: var(--off); color: var(--text); height: 40px; cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 18px; }
.tab.on { background: var(--resume); }
.tab:first-child { border-radius: 5px 0 0 5px; }
.tab:last-child { border-radius: 0 5px 5px 0; }
:root:not([data-theme="cats"]) .tab { border-radius: 0; font-weight: normal; }

/* The board as it will look, at this letter size and with these colours. */
.sample { display: flex; justify-content: center; margin-top: 18px; }
.sample .cell { display: grid; place-items: center; line-height: 1; }
.sample .cell > span { display: grid; place-items: center; width: 86%; height: 86%; border-radius: 22%; }

.links { display: flex; justify-content: center; gap: 12px; margin-top: 24px; }
.links .opt { width: 150px; text-align: center; text-decoration: none; color: var(--text); display: grid; place-items: center; }

/* More palettes: a line each. */
.palettes { display: flex; flex-direction: column; gap: 8px; }
.palette {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 76px;
  padding: 4px 12px;
  border: 0;
  border-radius: var(--small-radius);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.palette.on { background: var(--button); }
.palette .sticker { flex: none; width: 60px; height: 60px; }
.palette .name { flex: 1; min-width: 0; }
.palette .colors { flex: none; display: grid; grid-template-columns: repeat(4, 30px); gap: 4px; }
.palette .colors span { display: grid; place-items: center; height: 30px; font-size: 19px; line-height: 1; }

.section-title { color: var(--title); margin: 18px 0 8px; font-size: 20px; }

.stage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stage-grid .btn { padding: 12px 4px; font-size: 22px; }
.stage-grid .btn small { font-size: 13px; }

/* Option rows: toggles in a grid. */
.options { display: grid; gap: 6px; }
.option-row { display: grid; gap: 6px; }
.opt {
  border: 0;
  background: var(--off);
  color: var(--text);
  padding: 8px 4px;
  font-size: 17px;
  cursor: pointer;
  min-height: 40px;
  overflow-wrap: anywhere;
  border-radius: var(--small-radius);
}
.opt.on { background: var(--button); }
.opt:hover { filter: brightness(1.12); }
.swatch { display: inline-block; width: 14px; height: 14px; vertical-align: -1px; margin-right: 4px; }
.swatches { display: grid; grid-template-columns: repeat(4, 12px); gap: 2px; justify-content: center; margin-bottom: 4px; }
.swatches .swatch { display: block; width: 12px; height: 12px; margin: 0; }

.seed-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.seed-row .label { flex: 1; font-size: 22px; min-width: 150px; }
.seed-row .opt { padding: 8px 14px; }

.footer-actions { position: sticky; bottom: 0; padding: 12px 0 4px; background: linear-gradient(transparent, var(--bg) 30%); }
.footer-actions .btn { max-width: 320px; margin: 6px auto 0; }
.warning { color: var(--warning); text-align: center; font-size: 17px; min-height: 22px; }

.wordittos-list { display: flex; flex-direction: column; gap: 8px; }
.wordittos-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.wd-row {
  display: grid;
  grid-template-columns: 48px 72px 1fr auto;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 0;
  border-radius: var(--small-radius);
  padding: 4px 12px;
  min-height: 80px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}
.wd-row.found { background: var(--worditto); color: #fff; }
.wd-row.locked { background: var(--disabled); color: var(--dim); cursor: default; }
.wd-row .label { color: var(--title); }
.wd-row.found .label { color: #fff; }
.wd-row.locked .label { color: var(--dim); }
.wd-row .mark { color: var(--dim); }
.wd-row.locked .mark { font-size: 14px; }
.wd-row.found .mark { color: #fff; }
.wd-row .text { font-size: 18px; overflow-wrap: anywhere; }
.wd-row.found .text { font-size: 22px; }
.wd-pic { position: relative; width: 72px; height: 72px; }
.wd-pic .pic { width: 72px; height: 72px; }
.wd-pic .q { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 30px; }
.silhouette { filter: brightness(0) opacity(0.6); }
.locked .silhouette { filter: brightness(0) opacity(0.35); }
.pic { background-repeat: no-repeat; }

.seed-pad .display { text-align: center; font-size: 44px; margin: 24px 0; min-height: 56px; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 384px; margin: 0 auto; }
.pad .btn { font-size: 28px; padding: 18px 0; }

/* ---- Puzzle ---- */

.puzzle { position: fixed; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.puzzle canvas.board { position: absolute; left: 0; top: 0; display: block; touch-action: none; cursor: grab; }
.puzzle canvas.board.panning { cursor: grabbing; }

.pbar {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: calc(64px + env(safe-area-inset-top));
  padding: calc(8px + env(safe-area-inset-top)) 8px 8px;
  background: var(--bg);
  display: grid;
  grid-template-columns: 56px 64px 1fr auto;
  gap: 8px;
  align-items: center;
  z-index: 3;
}
.pbar .title { text-align: center; font-size: clamp(15px, 4.4vw, 20px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar .time { color: var(--dim); font-size: 22px; padding-right: 4px; min-width: 56px; text-align: right; }
.pbar .time.warn { color: var(--warning); }
.pbar .hint { font-size: 18px; width: 64px; }

.minimap {
  position: absolute;
  right: 8px;
  width: 112px;
  height: 112px;
  z-index: 2;
  cursor: pointer;
  transition: opacity 0.2s;
  touch-action: none;
}
.minimap.hidden { opacity: 0; pointer-events: none; }

.clear {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: var(--button);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  z-index: 4;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.15s, opacity 0.15s;
}
.clear svg { width: 60%; height: 60%; fill: #fff; }
.clear .sticker { position: absolute; width: 105%; height: 105%; left: -80%; top: 7.5%; }
.clear.hidden { transform: scale(0.3); opacity: 0; pointer-events: none; }

.wpanel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  background: var(--panel);
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
  max-height: 50%;
}
.puzzle.docked .wpanel { left: auto; max-height: none; padding-right: env(safe-area-inset-right); }
.puzzle.docked .wpanel .head { cursor: default; }
.wpanel .head {
  height: 52px;
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 100%;
  font-size: 20px;
  gap: 16px;
}
.wpanel .head .count { flex: none; }
.wpanel .head .count.complete { color: var(--title); }
.wpanel .head .next { flex: 1; min-width: 0; color: #fe4365; text-align: center; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wpanel .head .act { flex: none; color: var(--dim); }
.wpanel .words { overflow-y: auto; min-height: 0; padding: 0 16px 16px; display: none; touch-action: pan-y; }
.wpanel.open .words { display: block; }
.wpanel h4 { color: var(--title); font-weight: normal; margin: 6px 0 4px; font-size: 20px; }
.wpanel ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
.wpanel ul.one { grid-template-columns: 1fr; }
.wpanel li { line-height: 30px; font-size: 20px; overflow-wrap: anywhere; }
.wpanel ul.big li { font-size: 40px; line-height: 56px; }
.wpanel li.found { color: var(--dim); text-decoration: line-through; }
.wpanel .hints li { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.wpanel .eye { border-radius: var(--small-radius); border: 0; background: var(--off); width: 44px; height: 36px; cursor: pointer; }

/* Pause, result and help: over the puzzle. */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: var(--overlay);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  text-align: center;
  overflow-y: auto;
}
.overlay h2 { color: var(--title); font-weight: normal; font-size: 40px; margin: 0 0 6px; }
.overlay .sub { color: var(--dim); margin: 0 0 20px; }
.overlay p { margin: 4px 0; max-width: 460px; }
.overlay .menu { width: 100%; margin-top: 24px; }
.overlay.share { position: fixed; z-index: 9; }

/* The first stage's help: an animated example, its rule and a button. */
.help-box { width: 100%; max-width: 440px; background: var(--panel); border-top: 4px solid var(--title); padding: 16px 20px; border-radius: var(--small-radius); }
.help-box h3 { color: var(--title); font-weight: normal; font-size: 30px; margin: 0 0 14px; }
.help-board { display: block; width: min(260px, 60vh, 100%); aspect-ratio: 1; margin: 0 auto 14px; }
.help-box p { margin: 0 auto; font-size: 18px; min-height: 5.2em; }
.help-foot { display: grid; grid-template-columns: 1fr 180px 1fr; align-items: center; margin-top: 12px; color: var(--dim); text-align: left; font-size: 16px; }
.help-foot .btn { grid-column: 2; font-size: 18px; padding: 10px; }
.help-foot span { grid-row: 1; grid-column: 1; }
.tutorial { position: absolute; left: 12px; right: 12px; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 2; background: var(--panel); border-top: 3px solid var(--title); padding: 12px 16px; border-radius: var(--small-radius); display: flex; flex-direction: column; gap: 10px; }
.tutorial p { margin: 0; font-size: 18px; }
.tutorial .btn { align-self: flex-end; width: 128px; font-size: 17px; padding: 7px; }
.share-link { width: 100%; max-width: 460px; margin-top: 12px; padding: 10px; font: 16px var(--font); background: var(--panel); color: var(--text); border: 1px solid var(--button); }
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  z-index: 10;
  font-size: 17px;
  max-width: calc(100% - 32px);
  pointer-events: none;
  transition: opacity 0.3s;
}

/* A Worditto found: its picture with rays, then its word. */
.reveal {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: fade-in 0.3s;
}
.reveal .rays {
  position: absolute;
  width: 560px;
  height: 560px;
  max-width: 130vw;
  max-height: 130vw;
  background: repeating-conic-gradient(rgba(255, 214, 102, 0.35) 0 9deg, transparent 9deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 70%);
  mask: radial-gradient(circle, #000 25%, transparent 70%);
  animation: spin 14s linear infinite;
}
.reveal .pic { position: relative; width: 240px; height: 240px; animation: pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1); }
.reveal h3 { position: relative; color: var(--title); font-weight: normal; font-size: 32px; margin: 24px 0 4px; }
.reveal .word { position: relative; font-size: 26px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(0.2); } }
@keyframes fade-in { from { opacity: 0; } }

canvas.confetti { position: absolute; inset: 0; z-index: 7; pointer-events: none; }

/* ---- Beat the kitten (UI/Screens/Kitten*.cs) ---- */

:root { --progress: #e5f04c; --kitten: #f08a24; --boss: #e5484d; --gold: #f5c542; }

/* Its drawings show in every theme (the cats theme's stickers do not). */
.kpic { display: inline-block; background-repeat: no-repeat; pointer-events: none; }

.btn.kitten { background: var(--progress); color: #1e2430; }
.btn.kitten small { color: #4a5160; }

.coins { display: inline-flex; align-items: center; gap: 0.3em; white-space: nowrap; }
.coin { flex: none; width: 0.84em; height: 0.84em; border-radius: 50%; background: radial-gradient(circle at 36% 36%, rgba(255, 255, 255, 0.7) 0 12%, transparent 13%), var(--gold); box-shadow: inset 0 0 0 0.09em #c88a1e; }
.coins.gold { color: var(--gold); }
.topbar .count .coins { font-size: 20px; color: var(--text); }
.icon svg { display: block; width: 100%; height: 100%; }
.item { display: inline-flex; align-items: center; gap: 4px; }
.item .icon { width: 26px; height: 26px; }
.boss-tag { display: inline-block; background: var(--boss); color: #fff; font-size: 15px; padding: 1px 8px; border-radius: 999px; }
.boss-warning { color: var(--boss); font-size: 16px; text-align: center; }

/* The lobby: the ring and the badges, then the rival, the shop and Play; in landscape side by side. */
.kitten-lobby { position: relative; }
.lobby-body { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lobby-side { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.ring { position: relative; width: 162px; height: 162px; display: grid; place-items: center; align-content: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 18; }
.ring .track { stroke: var(--panel); }
.ring.empty .fill { display: none; }
.ring .fill { stroke: var(--progress); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 0.8s ease-out; }
.ring .label { color: var(--dim); font-size: 18px; position: relative; }
.ring .level { color: var(--title); font-family: var(--display); font-weight: 700; font-size: 50px; line-height: 1; position: relative; }
.ring .points { color: var(--dim); font-size: 15px; position: relative; }
.badges { display: grid; grid-template-columns: repeat(4, 52px); gap: 8px; }
.badge { width: 52px; height: 52px; }
.badge.missing { display: grid; place-items: center; border-radius: 50%; background: var(--panel); box-shadow: 0 0 0 3px rgba(52, 104, 168, 0.35); color: var(--dim); font-size: 15px; transform: scale(0.88); }
.rival { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rival-label { color: var(--dim); }
.rival-pic { width: 108px; height: 108px; animation: bob 2.5s ease-in-out infinite; }
.rival-pic.boss { width: 128px; height: 128px; }
.rival-name { color: var(--title); font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.1; }
.record { color: var(--dim); font-size: 16px; }
@keyframes bob { 50% { transform: translateY(4px); } }
.shop-row { display: grid; grid-template-columns: 1fr 1fr; align-items: center; width: 100%; max-width: 320px; }
.screen .btn.shop { background: #ff6b6b; padding: 10px; font-family: var(--display); font-weight: 700; }
.bought { display: flex; justify-content: center; gap: 16px; font-size: 20px; }
.bought .item .icon { width: 30px; height: 30px; }
.bought .none { color: var(--dim); font-size: 16px; }
.screen .btn.play { max-width: 320px; background: #4ecdc4; font-family: var(--display); font-weight: 700; font-size: 28px; }
[data-theme="cats"] .btn.play { animation: hop 2.6s 0.8s infinite; }
.help-btn { position: absolute; right: 0; top: 76px; width: 44px; height: 44px; font-size: 20px; }
[data-theme="cats"] .help-btn { top: 92px; }
@media (orientation: landscape) and (min-width: 700px) {
  .kitten-lobby { max-width: 900px; }
  .lobby-body { flex-direction: row; align-items: stretch; justify-content: center; }
  .lobby-side { width: 50%; justify-content: space-between; }
  .ring { width: 140px; height: 140px; }
  .badges { grid-template-columns: repeat(8, 40px); }
  .badge { width: 40px; height: 40px; }
}

/* The tutorial over the lobby. */
.kitten-help { position: fixed; background: rgba(0, 0, 0, 0.7); z-index: 9; }
.kitten-help .help-box { max-width: 520px; }
.kitten-help h3 { white-space: nowrap; }
.help-texts { display: grid; }
.help-texts p { grid-area: 1 / 1; min-height: 0; }
.help-texts p.unseen { visibility: hidden; }
.kitten-help .help-art { height: 132px; display: grid; place-items: center; margin-bottom: 10px; }
.help-pic { width: 120px; height: 120px; animation: bob 2s ease-in-out infinite; }
.help-boss { position: relative; display: flex; align-items: center; gap: 8px; }
.help-boss .help-pic { width: 108px; height: 108px; }
.help-items { display: flex; flex-direction: column; gap: 8px; }
.help-items .icon { width: 38px; height: 38px; }
.help-taps { position: relative; display: flex; gap: 8px; }
.help-taps .tile { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 8px; background: rgba(52, 104, 168, 0.45); font-size: 26px; }
.help-taps .tile.tapped { background: var(--progress); color: #000; }
.help-taps .tile.found { background: var(--done); }
.help-taps .finger { position: absolute; top: 50px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: rgba(255, 255, 255, 0.85); transition: left 0.2s; }
.kitten-help .dots { display: flex; justify-content: center; gap: 10px; margin: 12px 0; }
.kitten-help .dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(150, 162, 180, 0.5); }
.kitten-help .dots .on { background: var(--title); }
.help-buttons { display: flex; justify-content: center; gap: 16px; }
.help-buttons .btn { width: 150px; font-size: 18px; padding: 10px; }

/* The shop: shields and boosters, a row each with its price; in landscape a column each. */
.kitten-shop .subtitle { white-space: nowrap; overflow: hidden; }
.shop-columns { display: grid; gap: 4px 16px; }
@media (min-width: 760px) { .shop-columns { grid-template-columns: 1fr 1fr; } }
.shop-section .section-title { text-align: center; }
.shop-item { display: grid; grid-template-columns: 48px 1fr 96px; align-items: center; gap: 12px; min-height: 76px; margin-bottom: 8px; padding: 0 12px 0 14px; background: var(--panel); border-radius: 14px; transition: background 0.4s; }
.shop-item.bought { background: color-mix(in srgb, var(--panel), var(--done) 35%); }
.shop-item .icon { width: 48px; height: 48px; }
.shop-item .about { display: flex; flex-direction: column; min-width: 0; }
.shop-item .name { font-size: 20px; white-space: nowrap; overflow: hidden; }
.shop-item .sub { color: var(--dim); font-size: 15px; white-space: nowrap; overflow: hidden; }
.shop-item.bought .sub { color: var(--done); filter: brightness(1.4); }
.shop-item .price { padding: 10px 4px; font-size: 20px; display: flex; justify-content: center; }
.shop-item .price:disabled { color: var(--dim); }

/* A board against the kitten: the bar, the rival, the word, the board and the level; in landscape a column on the left. */
.kduel {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: calc(64px + env(safe-area-inset-top)) 116px 56px 1fr calc(76px + env(safe-area-inset-bottom));
  grid-template-areas: "bar" "head" "word" "board" "level";
  padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
.kduel.landscape {
  grid-template-columns: 300px 1fr;
  grid-template-rows: calc(64px + env(safe-area-inset-top)) 150px 56px 1fr calc(76px + env(safe-area-inset-bottom));
  grid-template-areas: "bar board" "head board" "word board" ". board" "level board";
}
.kbar { grid-area: bar; display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 8px 8px; }
.kbar .title { text-align: center; color: var(--dim); font-size: 20px; }
.kduel.landscape .kbar .title { display: none; }
.khead { grid-area: head; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px; min-width: 0; }
.duel-pic { flex: none; width: 108px; height: 108px; }
.kinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.kname { display: flex; align-items: center; gap: 10px; max-width: 100%; }
.kname .name { color: var(--title); font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.says { max-width: 100%; background: var(--panel); border-radius: 12px; padding: 4px 12px; font-size: 17px; white-space: nowrap; overflow: hidden; }
.krounds { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; width: 100%; }
.krounds .dots { display: flex; gap: 8px; padding-left: 2px; }
.krounds .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--panel); }
.krounds .dot.player { background: var(--done); }
.krounds .dot.kitten { background: var(--kitten); }
.krounds .dot.now { box-shadow: 0 0 0 3px var(--title); animation: ring-pulse 1.25s ease-in-out infinite; }
@keyframes ring-pulse { 50% { box-shadow: 0 0 0 4px var(--title); } }
.krounds .items { display: flex; gap: 12px; font-size: 17px; }
.kword { grid-area: word; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 12px; min-width: 0; }
.kline { color: var(--dim); font-size: 16px; display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.kline.player { color: var(--done); filter: brightness(1.35); }
.kline.kitten { color: var(--kitten); }
.ktarget { width: 100%; text-align: center; font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.35; white-space: nowrap; overflow: hidden; }
.kboard { grid-area: board; position: relative; min-height: 0; margin: 0 12px 12px; }
.kduel.landscape .kboard { margin: 0; }
.kboard canvas.board { position: absolute; inset: 0; display: block; touch-action: none; cursor: pointer; }
.klevel { grid-area: level; padding: 4px 16px env(safe-area-inset-bottom); }
.klevel-text { display: flex; justify-content: space-between; align-items: baseline; }
.klevel-name { color: var(--title); font-size: 20px; }
.klevel-count { color: var(--dim); font-size: 16px; }
.kbar-track { position: relative; height: 18px; margin-top: 6px; border-radius: 9px; background: var(--panel); overflow: hidden; }
.kbar-track .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 9px; background: var(--progress); }
.kbar-track .mark { position: absolute; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; background: color-mix(in srgb, var(--bg) 50%, transparent); }

/* The cover over the board: the countdown, or the board's summary. */
.kcover {
  position: absolute;
  z-index: 2;
  background: var(--panel);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  padding: 12px 16px;
  text-align: center;
  overflow: hidden;
}
.kcover.hidden { display: none; }
.kcover .look-for { color: var(--dim); }
.kcover .cover-word { width: 100%; color: var(--title); font-family: var(--display); font-weight: 700; font-size: 48px; line-height: 1.3; white-space: nowrap; overflow: hidden; }
.kcover .cover-category { color: var(--dim); font-size: 16px; }
.cover-shapes { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 16px; }
.dirs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.dir { width: 44px; height: 44px; border-radius: 10px; background: var(--button); display: grid; place-items: center; }
.dir svg { width: 60%; height: 60%; fill: none; stroke: var(--text); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.dir.new { background: var(--progress); }
.dir.new svg { stroke: #222a3a; }
.kcover .number { font-family: var(--display); font-weight: 700; font-size: 96px; line-height: 1; min-height: 1em; }
.kcover .number.pop { animation: count-pop 0.25s ease-out; }
@keyframes count-pop { from { transform: scale(1.5); } }
.summary-title { width: 100%; color: var(--title); font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.35; white-space: nowrap; overflow: hidden; }
.summary-title.lost { color: var(--kitten); }
.kcover .score { font-size: 20px; }
.summary-middle { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 0; }
.summary-middle .up { color: var(--title); font-size: 20px; }
.summary-middle .news { color: var(--progress); font-size: 16px; }
.summary-middle .next { color: var(--dim); font-size: 16px; }
.summary-pic { width: min(110px, 16vh); height: min(110px, 16vh); animation: bob 2s ease-in-out infinite; }
.kcover .coins.gold { font-size: 16px; white-space: normal; }
.summary-buttons { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 300px; }
.summary-buttons .btn { font-family: var(--display); font-weight: 700; padding: 12px; }
.kduel .overlay { z-index: 5; }
@media (prefers-reduced-motion: reduce) {
  .rival-pic, .help-pic, .summary-pic, [data-theme="cats"] .btn.play { animation: none; }
}
