/* public/styles/base.css */
:root {
  color-scheme: light;
  --ink: #182923;
  --muted: #52635a;
  --paper: #f7f7ed;
  --page: #fae5e8;
  --dash-color: #ca7e8d42;
  --white: #fffef8;
  --line: #dce0d3;
  --felt: #e5eee0;
  --green: #294d3e;
  --lime: #d9ed91;
  --radius: 30px;
  --tap-ink: #20382a;
  --tap-outline: #f9f7e9;
  --turn-arrow-ink: #a43143;
  transition: color 200ms, background-color 200ms;
  --shadow-ink: #1b2b22;
  --surface-shadow: 11px 13px 0 1px var(--shadow-ink);
  --control-shadow: 5px 5px 0 var(--shadow-ink);
  font-family:
    "Inter",
    "Segoe UI",
    system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 300px;
  min-height: 100vh;
  isolation: isolate;
}
button,
textarea,
input {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 3px solid #6243b0;
  outline-offset: 4px;
}
a {
  color: inherit;
}
h1,
h2,
p {
  margin: 0;
}
.sr-only,
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  z-index: 20;
  padding: 10px;
  background: var(--white);
}
.game-icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  vertical-align: -.13em;
}
@media (max-width: 470px) {
  :root {
    --surface-shadow: 8px 10px 0 1px var(--shadow-ink);
  }
}

/* public/styles/shell.css */
.shell {
  width: min(1180px, calc(100% - 76px));
  margin-inline: auto;
}
.topbar {
  border-bottom: 1px solid #e1e3d8;
  background: #fbfbf3;
}
.topbar-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-weight: 850;
  font-size: 29px;
  letter-spacing: -.095em;
  line-height: 1;
}
.brand-dot,
.intro h1 span {
  color: #55794b;
}
.brand-mark {
  display: block;
  width: 29px;
  height: 30px;
  position: relative;
  transform: rotate(-6deg);
}
.brand-mark i {
  position: absolute;
  width: 19px;
  height: 23px;
  top: 4px;
  left: 2px;
  border-radius: 4px;
  transform: rotate(-17deg);
  background: #9ab779;
  border: 1.4px solid var(--ink);
}
.brand-mark i + i {
  left: 9px;
  top: 3px;
  transform: rotate(15deg);
  background: var(--lime);
  font-style: normal;
  text-align: center;
  font-size: 15px;
  padding-top: 2px;
  letter-spacing: 0;
}
nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
nav button {
  font-size: .84rem;
  font-weight: 680;
  border: 0;
  border-radius: 9px;
  padding: 9px 12px;
  background: transparent;
  min-height: 40px;
}
nav button span {
  color: #59705a;
  margin-right: 3px;
  font-size: 1rem;
}
nav button:hover,
nav button[aria-current] {
  background: #eaf0dd;
}
.issue {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 630;
}
.issue-no {
  color: #464267;
  background: #eeebfc;
  padding: 4px 8px;
  border: 1px solid #e2dcf5;
  border-radius: 5px;
  font-size: .72rem;
  letter-spacing: .04em;
  font-weight: 800;
}
.intro h1 {
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  letter-spacing: -.081em;
  line-height: 1.03;
  font-weight: 840;
  margin: 9px 0 8px;
}
.sub {
  font-size: 1rem;
  color: var(--muted);
}
.play-column {
  min-width: 0;
}
.loading {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  background: var(--white);
  min-height: 180px;
}
.loading h1 {
  font-size: 1.8rem;
}
.loading p {
  margin: 12px 0 16px;
}
.loading button + button {
  margin-left: 8px;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 42px;
  margin-block: 24px 14px;
}
.game-grid {
  display: block;
}
main.shell {
  max-width: 860px;
  padding-bottom: 24px;
}
.site-menu {
  position: relative;
  z-index: 2;
}
.site-menu summary {
  cursor: pointer;
  padding: 8px;
}
.menu-items {
  position: absolute;
  right: 0;
  display: grid;
  min-width: 146px;
  padding: 6px;
  background: var(--paper, #fffdf4);
  border: 1px solid var(--shadow-ink);
  border-radius: 10px;
  box-shadow: var(--control-shadow);
}
.menu-items button {
  text-align: left;
}
.issue .archive-trigger {
  display: grid;
  place-items: center;
  min-height: 34px;
  min-width: 34px;
  padding: 4px;
  font-size: 1rem;
  line-height: 1;
}
.brand-mark .game-icon {
  width: 73%;
  height: 73%;
}
@media (max-width: 920px) {
  .shell {
    width: calc(100% - 40px);
  }
}
@media (max-width: 720px) {
  .sub {
    font-size: .88rem;
  }
}
@media (max-width: 470px) {
  .shell {
    width: calc(100% - 24px);
  }
  .topbar-inner {
    height: 58px;
    gap: 5px;
  }
  .brand {
    font-size: 25px;
    gap: 6px;
  }
  .brand-mark {
    transform: scale(.86) rotate(-6deg);
    transform-origin: left;
    width: 25px;
  }
  nav {
    gap: 2px;
  }
  nav button {
    min-height: 38px;
    padding-inline: 7px;
    font-size: .76rem;
  }
  nav button span {
    display: none;
  }
  .intro h1 {
    font-size: 2.62rem;
    margin-top: 12px;
  }
  .intro {
    position: relative;
  }
}

/* public/styles/controls.css */
.game-toolbar,
.board-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}
.game-toolbar {
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 15px;
}
.level-tabs {
  display: flex;
  gap: 4px;
  background: #eeefe4;
  border: 1px solid var(--shadow-ink);
  border-radius: 17px;
  padding: 3px;
  box-shadow: var(--control-shadow);
}
.level-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  align-self: stretch;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 13px;
  min-height: 37px;
  padding: 5px 11px;
  background: transparent;
  font-size: .84rem;
  font-weight: 700;
}
.level-tab.current {
  background: #fffef8;
  border-color: #daddce;
  box-shadow: 0 1px 2px #20251319;
}
.level-tab:not(.current):hover {
  background: #f8faef;
}
.level-mark {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: .68rem;
}
.level-easy .level-mark {
  background: #e5efca;
  color: #4c6935;
}
.level-medium .level-mark {
  background: #f8e9b8;
  color: #6d4c11;
}
.level-hard .level-mark {
  background: #eee1f7;
  color: #654281;
}
.level-rating:empty {
  display: none;
}
.level-rating {
  display: inline-flex;
  color: #356248;
}
.secondary,
.primary {
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: .82rem;
  font-weight: 720;
}
.secondary {
  background: var(--white);
}
.secondary:hover:not(:disabled) {
  background: #eef4e3;
  border-color: #b3c2aa;
}
.secondary:disabled {
  color: #627268;
  background: #f6f7ee;
}
.primary {
  background: #294d3e;
  border-color: #294d3e;
  color: #fffef1;
}
.primary:hover {
  background: #163628;
}
.tool-button {
  min-height: 38px;
  padding-inline: 10px;
  white-space: nowrap;
}
.level-tab.next-unsolved {
  border-color: currentColor;
  border-style: dashed;
}
[data-do=undo] {
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.tool-button {
  min-width: 40px;
  font-size: 1rem;
}
.level-mark .game-icon {
  width: .75em;
  height: .75em;
}
.tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.board-actions {
  margin-left: auto;
}
.tries-tile {
  display: grid;
  place-content: center;
  min-width: 39px;
  min-height: 38px;
  padding: 3px 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  box-shadow: 2px 2px 0 var(--shadow-ink);
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.tries-tile strong {
  font-size: 1rem;
}
.tries-tile span {
  margin-top: 2px;
  font-size: .62rem;
  color: var(--muted);
  font-weight: 700;
}
@media (max-width: 470px) {
  .level-tab {
    min-height: 38px;
    padding-inline: 6px;
    font-size: .76rem;
    gap: 4px;
  }
  .level-mark {
    width: 16px;
    height: 16px;
  }
  .level-tabs {
    gap: 1px;
  }
  .board-actions {
    gap: 4px;
  }
  .tool-button {
    padding-inline: 5px;
  }
  .game-toolbar {
    gap: 4px;
  }
}
@media (max-width: 365px) {
  .game-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .level-tabs {
    justify-self: start;
  }
  .board-actions {
    justify-self: end;
  }
}
@media (min-width: 366px) and (max-width: 470px) {
  .level-mark {
    display: none;
  }
  .level-tab {
    padding-inline: 5px;
    gap: 3px;
  }
}

/* public/styles/board.css */
.board {
  --player-rail: clamp(38px, 10vw, 66px);
  --rail-gap: clamp(7px, 2.4vw, 16px);
  --player-icon-size: clamp(31px, 8.2vw, 50px);
  padding: 19px 21px 13px;
  border: 1px solid var(--shadow-ink);
  border-radius: var(--radius);
  box-shadow: var(--surface-shadow);
  overflow: hidden;
  background-color: var(--felt);
  background-image: radial-gradient(#51774544 1px, transparent 1.35px);
  background-size: 12px 12px;
}
.board h2 {
  font-size: .81rem;
  font-weight: 780;
  white-space: nowrap;
}
.board-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}
.player-icon {
  display: grid;
  place-items: center;
  background: #d5e0d0;
  color: #355748;
  border-radius: 50%;
  font-size: .95rem;
}
.human-icon {
  background: #335847;
  color: #eef6df;
}
.hand-section {
  display: grid;
  grid-template-columns: var(--player-rail) minmax(0, 1fr);
  align-items: center;
}
.board .board-label {
  margin: 0;
  justify-content: center;
}
.player-icon,
.turn-indicator {
  width: var(--player-icon-size);
  height: var(--player-icon-size);
  justify-self: center;
  font-size: clamp(1.25rem, 4.8vw, 1.85rem);
}
.opponent-hand {
  padding-bottom: 15px;
}
.human-hand {
  padding-top: 15px;
}
.hand {
  --hand-card-width: clamp(54px, 11vw, 82px);
  --hand-card-height: clamp(75px, 15vw, 112px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-height: var(--hand-card-height);
  padding-inline-start: var(--rail-gap);
}
.hand .card {
  --card-width: var(--hand-card-width);
  --card-height: var(--hand-card-height);
}
.table-center {
  --table-card-width: clamp(54px, 11vw, 82px);
  --table-card-height: clamp(75px, 15vw, 112px);
  display: grid;
  grid-template-columns: var(--player-rail) calc(var(--rail-gap) + var(--table-card-width) + 16px) minmax(0, 1fr);
  align-items: center;
  padding-block: 12px;
  border-block: 1px solid #c5d7c3;
}
.turn-indicator {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  box-shadow: 2px 2px 0 var(--shadow-ink);
}
.turn-indicator .turn-arrow {
  width: 67%;
  height: 69%;
  color: var(--turn-arrow-ink);
}
.turn-indicator[data-player="0"] .turn-arrow {
  rotate: 180deg;
}
.turn-indicator[data-player=none] {
  visibility: hidden;
}
.empty-hand {
  display: grid;
  place-items: center;
  width: var(--hand-card-width, var(--table-card-width));
  height: var(--hand-card-height, var(--table-card-height));
  border: 2px dashed #526a5b;
  border-radius: 9px;
}
.empty-hand::before {
  content: "";
  width: 21px;
  height: 2px;
  background: #526a5b;
  transform: rotate(-44deg);
}
.turn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-left: auto;
  justify-content: end;
  align-items: center;
}
.compact {
  min-height: 40px;
  white-space: nowrap;
  padding: 6px 10px;
}
.color-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.choose {
  width: 40px;
  height: 40px;
  border: 1px solid #0003;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 800;
}
.choose[aria-pressed=true] {
  outline: 2px solid #514179;
  outline-offset: 1px;
}
.choose-red {
  background: #f78585;
  color: #69303a;
}
.choose-yellow {
  background: #f9d16e;
  color: #644a19;
}
.choose-green {
  background: #9bcc91;
  color: #254f37;
}
.choose-blue {
  background: #91a8f7;
  color: #263b80;
}
.board-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  margin: 17px 2px 0;
  font-size: .72rem;
}
.player-icon .game-icon {
  width: 68%;
  height: 68%;
}
.choose {
  display: grid;
  place-items: center;
}
.choose .game-icon {
  width: 18px;
  height: 18px;
}
.board > .turn-actions {
  margin-top: 10px;
}
@media (min-width: 1160px) {
  .board {
    padding-inline: 25px;
  }
  .hand {
    gap: 9px;
  }
}
@media (max-width: 920px) {
  .board {
    padding-inline: 15px;
  }
}
@media (max-width: 720px) {
  .hand-section {
    container-type: inline-size;
  }
  .hand {
    --hand-card-width: min(82px, calc((100cqw - var(--player-rail) - var(--rail-gap) - 24px) / 7));
    --hand-card-height: calc(var(--hand-card-width) * 1.38);
    gap: 4px;
  }
  .table-center {
    --table-card-width: min(82px, calc((100vw - 96px) / 7));
    --table-card-height: calc(var(--table-card-width) * 1.38);
  }
}
@media (max-width: 470px) {
  .table-center {
    --table-card-width: calc((100vw - 68px) / 7);
  }
}
@media (max-width: 470px) {
  .board {
    padding: 12px 9px 10px;
    border-radius: 24px;
  }
  .board-meta {
    font-size: .66rem;
  }
}

/* public/styles/cards.css */
.card {
  --card-width: 60px;
  --card-height: 79px;
  display: grid;
  place-items: center;
  isolation: isolate;
  position: relative;
  min-width: 0;
  width: var(--card-width);
  height: var(--card-height);
  border-radius: 9px;
  padding: 0;
  color: var(--card-ink);
  background: var(--card-color);
  border: 1px solid var(--card-edge);
  box-shadow: 0 2px 0 #28483a38, inset 0 0 0 2px #ffffff65;
  user-select: none;
  transition: transform 120ms, box-shadow 120ms;
}
.card-red {
  --card-color: #f78585;
  --card-ink: #69303a;
  --card-edge: #c8656c;
  --card-paper: #ffded8;
}
.card-yellow {
  --card-color: #f9d16e;
  --card-ink: #644a19;
  --card-edge: #c8a44d;
  --card-paper: #fff0c8;
}
.card-green {
  --card-color: #9bcc91;
  --card-ink: #254f37;
  --card-edge: #6da574;
  --card-paper: #e1f4d7;
}
.card-blue {
  --card-color: #91a8f7;
  --card-ink: #263b80;
  --card-edge: #6881d2;
  --card-paper: #e2e8ff;
}
.card-wild {
  --card-color: #574272;
  --card-ink: #342346;
  --card-edge: #3d2c51;
  --card-paper: #f0e2fb;
}
.card::before {
  position: absolute;
  z-index: -1;
  width: 61%;
  height: 66%;
  border-radius: 48% 52% 48% 52%;
  background: var(--card-paper);
  transform: rotate(27deg);
  content: "";
}
.card-wild::before {
  background:
    conic-gradient(
      #f4d28a 0 25%,
      #eeb5b8 25% 50%,
      #acbdf1 50% 75%,
      #b4d7a6 75%);
}
.card-face {
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  font-weight: 860;
  letter-spacing: -.10em;
  line-height: 1;
  padding-right: .07em;
}
.card-face.two,
.card-face.four {
  font-size: 1.22rem;
  letter-spacing: -.07em;
}
.card-face.skip,
.card-face.wild {
  letter-spacing: 0;
  padding: 0;
}
.corner {
  position: absolute;
  font-size: .61rem;
  line-height: 1;
}
.card-wild .corner {
  color: #f3e2ff;
}
.corner-top {
  top: 5px;
  left: 5px;
}
.corner-bottom {
  bottom: 5px;
  right: 5px;
}
.human-hand button[aria-disabled=true] {
  cursor: default;
  filter: saturate(.64);
}
.playable {
  cursor: grab;
  touch-action: none;
  box-shadow:
    0 2px 0 #28483a6e,
    0 0 0 2px #fcfff0,
    0 0 0 3px #729a74,
    inset 0 0 0 2px #ffffff65;
}
.playable:hover,
.selected {
  transform: translateY(-4px);
}
.selected {
  outline: 3px solid #2a593e;
  outline-offset: 2px;
}
.card-face .game-icon,
.corner .game-icon {
  display: block;
}
.card-face .game-icon {
  width: 1.12em;
  height: 1.12em;
}
@media (max-width: 470px) {
  .card {
    --card-width: 42px;
    --card-height: 60px;
    border-radius: 7px;
  }
  .corner {
    font-size: .53rem;
  }
  .corner-top {
    top: 4px;
    left: 4px;
  }
  .corner-bottom {
    bottom: 4px;
    right: 4px;
  }
  .card-face.two,
  .card-face.four {
    font-size: .95rem;
  }
}

/* public/styles/deck.css */
.stack-section {
  border-right: 1px solid #c5d7c3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.stack-button {
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 10px;
  position: relative;
}
.stack-button::before {
  pointer-events: none;
  content: "";
  position: absolute;
  inset: 2px -3px -2px 3px;
  border: 1px solid #667d62;
  background: #cfdfc9;
  border-radius: 9px;
  transform: rotate(8deg);
}
.stack-button .card {
  position: relative;
}
.stack-button.drop-target {
  outline: 3px dashed #386449;
  outline-offset: 5px;
}
.stack-button:hover .card {
  transform: translateY(-2px);
}
.deck-section {
  min-width: 0;
  padding-left: 16px;
}
.table-center .stack-section {
  padding-block: 8px;
}
.table-center .stack-section {
  padding-inline-start: var(--rail-gap);
}
.stack-button > .card,
.deck .card {
  width: var(--table-card-width);
  height: var(--table-card-height);
}
.deck {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow: visible;
  min-height: calc(var(--table-card-height) + 16px);
  padding: 8px 0;
  gap: 6px 0;
}
.deck .card {
  flex: 0 0 auto;
}
.deck .card:first-child {
  outline: 1px dashed #60755e;
  outline-offset: 2px;
}
.deck .card-face {
  font-size: 1.35rem;
}
.deck .card-face.two,
.deck .card-face.four {
  font-size: 1rem;
}
.deck .card + .card {
  margin-left: clamp(-18px, -3vw, -6px);
}
.deck .card:hover {
  transform: translateY(-4px);
}
.deck > .card,
.deck > .deck-stack,
.deck-fan > .card {
  z-index: calc(var(--deck-card-count) - var(--draw-index));
}
.deck-stack {
  position: relative;
  isolation: isolate;
  flex: 0 0 auto;
  margin-left: clamp(-18px, -3vw, -6px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}
.deck-stack::before,
.deck-stack::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 3px -4px -2px 4px;
  border: 1px solid #60755e;
  border-radius: 8px;
  background: #d4e0ce;
  transform: rotate(5deg);
}
.deck-stack::after {
  inset: 5px -7px -3px 7px;
  z-index: -2;
  transform: rotate(9deg);
}
.deck-stack .card:first-child {
  outline: none;
}
.deck-count-badge {
  position: absolute;
  z-index: 1;
  right: -7px;
  bottom: -5px;
  min-width: 24px;
  padding: 2px 5px;
  border: 1px solid var(--paper);
  border-radius: 999px;
  background: var(--shadow-ink);
  color: var(--white);
  font-size: .7rem;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.deck-stack[aria-expanded=true] .deck-count-badge {
  display: none;
}
.deck-fan {
  display: flex;
  position: absolute;
  z-index: calc(var(--deck-card-count) + 1);
  isolation: isolate;
  left: 0;
  bottom: calc(100% + 4px);
  max-width: 100%;
  padding: 6px;
  border-radius: 10px;
  background: #edf1e4;
  border: 1px solid var(--shadow-ink);
  box-shadow: var(--control-shadow);
}
.deck-fan[hidden] {
  display: none;
}
.deck-fan .card {
  flex-shrink: 1;
  width: min(var(--table-card-width), 15vw);
  outline: none;
}
.deck-fan .card + .card {
  margin-left: clamp(-28px, -5vw, -12px);
}
.deck-fan {
  transition:
    opacity 160ms ease,
    translate 160ms ease,
    display 160ms allow-discrete;
}
.deck-fan[hidden] {
  opacity: 0;
  translate: 0 4px;
}
@starting-style {
  .deck-fan:not([hidden]) {
    opacity: 0;
    translate: 0 4px;
  }
}
@media (max-width: 470px) {
  .deck-section {
    padding-left: 9px;
  }
}

/* public/styles/dialogs.css */
.countdown {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0 0 14px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f0f3e5;
  font-size: .8rem;
}
.countdown strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: .05em;
}
.clock-icon {
  font-size: 1.65rem;
  line-height: 1;
  color: #487058;
}
.active-color {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .69rem;
  font-weight: 770;
  text-transform: capitalize;
  padding: 2px 6px;
  border-radius: 5px;
  line-height: 1.4;
}
.active-green {
  color: #28513a;
  background: #d5e8cf;
}
.active-red {
  color: #852735;
  background: #f9dfe0;
}
.active-yellow {
  color: #705013;
  background: #f8eab3;
}
.active-blue {
  color: #253d89;
  background: #dfe6fd;
}
dialog {
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--shadow-ink);
  border-radius: 26px;
  padding: 0;
  width: min(520px, calc(100% - 28px));
  max-height: min(80vh, 750px);
  box-shadow: var(--surface-shadow);
}
dialog::backdrop {
  background: #1c2c22a0;
}
.dialog-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 19px;
  border-bottom: 1px solid var(--line);
}
.dialog-header h2 {
  font-size: 1.35rem;
  letter-spacing: -.045em;
}
.close-button {
  font-size: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 37px;
  height: 37px;
  background: var(--paper);
}
.dialog-body {
  font-size: .91rem;
  line-height: 1.5;
  padding: 18px 19px 23px;
}
.dialog-body h3 {
  margin: 18px 0 5px;
  letter-spacing: -.025em;
}
.dialog-body p {
  color: var(--muted);
  margin-bottom: 8px;
}
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 9px;
  margin-top: 15px;
}
.archive-list,
.stack-list {
  list-style: none;
  margin: 9px 0;
  padding: 0;
}
.archive-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  padding: 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.archive-button:hover {
  background: #edf3e2;
}
.archive-button small {
  display: block;
  color: var(--muted);
}
.stack-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 8px 0;
}
.stack-list .card {
  --card-width: 36px;
  --card-height: 46px;
}
.stack-list .card-face {
  font-size: 1.2rem;
}
.stack-list li div {
  display: grid;
}
.stack-list li div span {
  color: var(--muted);
}
.policy-list,
.solution-list {
  padding-left: 24px;
}
.rules-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
}
.rules-list dt {
  font-weight: 750;
}
.rules-list dd {
  margin: 0;
  color: var(--muted);
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 12px;
}
.stats-grid div {
  display: grid;
  gap: 3px;
  padding: 9px 13px;
  border-radius: 9px;
  background: #edf3e2;
}
.stats-grid strong {
  font-size: 1.5rem;
}
.stats-grid span {
  color: var(--muted);
  font-weight: 650;
}
.analytics-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 750;
  margin-block: 12px;
}
.analytics-toggle input {
  accent-color: #355740;
  width: 20px;
  height: 20px;
}
textarea {
  display: block;
  width: 100%;
  padding: 9px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
}
.archive-today {
  margin-bottom: 8px;
}
.help-step {
  padding: 10px 12px;
  margin-block: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.help-step h3 {
  margin: 0 0 7px;
}
.help-step p {
  margin: 0;
}
.help-example {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}
.help-example .card {
  --card-width: 33px;
  --card-height: 45px;
}
.help-example .card-face {
  font-size: 1.1rem;
}
.help-example .corner {
  font-size: .47rem;
}
.help-card {
  display: grid;
  justify-items: center;
  gap: 3px;
  font-size: .72rem;
  font-weight: 700;
}
.help-arrow {
  color: var(--muted);
}
.help-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  font-size: .76rem;
  font-weight: 700;
}
.help-details {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.help-details summary {
  cursor: pointer;
  font-weight: 700;
}
.help-details > p {
  margin-top: 8px;
}

/* public/styles/motion.css */
.backdrop-pattern {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  contain: strict;
  pointer-events: none;
}
.backdrop-pattern > span {
  --drift-angle: -49deg;
  --row-offset: 0px;
  position: absolute;
  inset: -35vmax;
  transform: rotate(var(--drift-angle));
  background-color: var(--dash-color);
  mask:
    url(/dash-tile.png) 0 0 / 58px 40px repeat,
    repeating-linear-gradient(
      to bottom,
      #000 0 20px,
      transparent 20px 40px) 0 var(--row-offset) / 100% 40px repeat;
  mask-composite: intersect;
  will-change: transform;
  animation: backdrop-drift 9s linear infinite;
}
.backdrop-pattern > span + span {
  --row-offset: 20px;
}
@keyframes backdrop-drift {
  to {
    transform: rotate(var(--drift-angle)) translateX(58px);
  }
}
.drag-ghost {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-7deg);
  opacity: .9;
}
.toast {
  position: fixed;
  z-index: 5;
  right: 14px;
  bottom: 14px;
  max-width: min(370px, calc(100% - 28px));
  background: var(--green);
  color: #fffef7;
  border-radius: 10px;
  padding: 10px 15px;
  box-shadow: 0 5px 20px #28302235;
  font-size: .86rem;
}
.restored {
  animation: restored 320ms ease-out;
}
@keyframes restored {
  from {
    opacity: .5;
    transform: translateY(4px);
  }
}
.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.confetti i {
  position: absolute;
  top: -12px;
  left: var(--x);
  width: 7px;
  height: 11px;
  background: hsl(var(--hue) 75% 52%);
  animation: celebrate-fall 1.4s var(--delay) ease-in both;
}
@keyframes celebrate-fall {
  to {
    transform: translate(24px, 360px) rotate(560deg);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .confetti {
    display: none;
  }
}
.card-flight {
  position: fixed;
  z-index: 20;
  pointer-events: none;
}
.card-flight .card {
  --card-width: var(--flight-width);
  --card-height: var(--flight-height);
}
.board,
.topbar,
.level-tabs,
.countdown {
  transition:
    background-color 200ms,
    border-color 200ms,
    box-shadow 160ms;
}
button,
.site-menu summary,
.brand {
  transition:
    background-color 150ms,
    box-shadow 150ms,
    scale 120ms;
}
button.card {
  transition:
    transform 120ms,
    box-shadow 120ms,
    scale 120ms;
}
button:active:not(:disabled):not([aria-disabled=true]),
.site-menu summary:active,
.brand:active {
  scale: .94;
}
.menu-items,
dialog[open] {
  animation: control-reveal 170ms ease-out;
}
@keyframes control-reveal {
  from {
    opacity: 0;
    translate: 0 -5px;
    scale: .98;
  }
}
.tap-burst {
  position: fixed;
  z-index: 90;
  pointer-events: none;
}
.tap-burst i {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 9px;
  height: 4px;
  border-radius: 4px;
  background: var(--tap-ink);
  box-shadow: 0 0 0 1px var(--tap-outline);
  transform-origin: 2px 2px;
  animation: tap-ray 280ms ease-out both;
}
@keyframes tap-ray {
  0% {
    opacity: 1;
    transform: rotate(var(--angle)) translateX(2px) scale(.7);
  }
  55% {
    opacity: 1;
    transform: rotate(var(--angle)) translateX(9px) scale(1);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--angle)) translateX(15px) scale(.45);
  }
}
@media (prefers-reduced-motion: reduce) {
  .backdrop-pattern > span {
    animation: none;
    will-change: auto;
  }
}
.round-victory {
  animation: round-win 380ms cubic-bezier(.21, 1.55, .55, 1) both;
}
@keyframes round-win {
  0% {
    scale: .55;
    rotate: -15deg;
    opacity: .4;
  }
  65% {
    scale: 1.24;
    rotate: 5deg;
  }
  100% {
    scale: 1;
    rotate: 0deg;
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .round-victory {
    animation: none;
  }
}
.stack-rewound > .card {
  animation: restored 260ms ease-out;
}
.round-victory.flawless-victory {
  animation: none;
}
.flawless-victory .game-icon {
  animation: flawless-arrival 720ms cubic-bezier(.22, .73, .31, 1) both;
}
@keyframes flawless-arrival {
  0% {
    translate: clamp(90px, 27vw, 188px) 28px;
    scale: .44;
    rotate: 46deg;
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  72% {
    translate: -8px -3px;
    scale: 1.28;
    rotate: -12deg;
  }
  100% {
    translate: 0 0;
    scale: 1;
    rotate: 0deg;
    opacity: 1;
  }
}
.undo-progress {
  position: fixed;
  z-index: 30;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  box-shadow: 5px 6px 0 var(--shadow-ink);
  pointer-events: none;
  animation: undo-pop 160ms ease-out both;
}
.undo-progress.holding {
  animation-delay: 110ms;
}
.undo-progress-drift {
  display: grid;
  place-items: center;
  animation: undo-drift 4s linear infinite;
}
.undo-progress-drift.paused {
  animation-play-state: paused;
}
.undo-progress .undo-progress-arrow {
  width: 60px;
  height: 60px;
}
@keyframes undo-pop {
  from {
    opacity: 0;
    scale: .56;
  }
}
@keyframes undo-drift {
  to {
    rotate: -360deg;
  }
}
@media (prefers-reduced-motion: reduce) {
  .flawless-victory .game-icon,
  .undo-progress,
  .undo-progress-drift {
    animation: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* public/styles/theme.css */
:root[data-theme=dark] {
  color-scheme: dark;
  --ink: #ecf4e9;
  --muted: #b4c5bc;
  --paper: #131c19;
  --page: var(--paper);
  --dash-color: #9cbda449;
  --white: #24362e;
  --line: #4a6155;
  --felt: #21382e;
  --green: #294d3e;
  --shadow-ink: #050907;
  --tap-ink: #e3f49c;
  --tap-outline: #17231c;
  --turn-arrow-ink: #ff8992;
}
[data-theme=dark] .topbar,
[data-theme=dark] .level-tabs,
[data-theme=dark] .countdown,
[data-theme=dark] .deck-fan,
[data-theme=dark] .dialog-body textarea {
  background: #1c2c25;
  border-color: var(--line);
}
[data-theme=dark] nav button:hover,
[data-theme=dark] nav button[aria-current],
[data-theme=dark] .level-tab.current,
[data-theme=dark] .level-tab:not(.current):hover,
[data-theme=dark] .secondary:hover:not(:disabled),
[data-theme=dark] .archive-button:hover,
[data-theme=dark] .stats-grid div {
  background: #334b3e;
  border-color: var(--line);
}
[data-theme=dark] .brand-mark {
  color: #182923;
}
[data-theme=dark] .secondary:disabled {
  background: #1d2a24;
  color: #9caf9f;
}
[data-theme=dark] .board {
  background-image: radial-gradient(#a2c59323 .8px, transparent 1px);
}
[data-theme=dark] .table-center,
[data-theme=dark] .stack-section {
  border-color: var(--line);
}
[data-theme=dark] .clock-icon,
[data-theme=dark] .level-rating,
[data-theme=dark] .empty-hand {
  color: var(--muted);
}
[data-theme=dark] .empty-hand {
  border-color: var(--muted);
}
[data-theme=dark] .empty-hand::before {
  background: var(--muted);
}
[data-theme=dark] .selected {
  outline-color: #e3f49c;
}
[data-theme=dark] .deck-count-badge {
  color: var(--ink);
  border-color: var(--line);
}

/* public/styles.css */
