:root {
  color-scheme: light;
  font: 16px system-ui, sans-serif;
  --ink: #2f263b;
  --quiet: #62536d;
  --plum: #50376b;
  --paper: #fffdf9;
  --line: #e4d9e7;
  color: var(--ink);
  background: #f8f4ee;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid #7852a2; outline-offset: 3px; }
p, h1, h2, h3, ul { margin: 0; }
h1, h2, h3 { font-family: Georgia, serif; letter-spacing: -.035em; }
h2 { font-size: clamp(1.3rem, 4.9vw, 1.75rem); line-height: 1.08; overflow-wrap: anywhere; }
.playroom { max-width: 950px; margin: auto; padding: clamp(12px, 3.7vw, 27px); padding-bottom: max(21px, env(safe-area-inset-bottom)); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 11px; color: var(--plum); background: var(--paper); font-size: .79rem; font-weight: 740; text-decoration: none; }
.button:hover:enabled { border-color: #b99dce; background: #f1e9f6; }
.button:disabled { opacity: .6; }
.button.primary { background: var(--plum); border-color: var(--plum); color: white; }
.button.primary:hover:enabled { background: #3f2956; }
.button.quiet { background: #fffcf9; }

.welcome { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0,1fr) minmax(86px,32%); align-items: center; padding: clamp(12px,3.2vw,23px); border: 1px solid #dfcbed; border-radius: 24px; background: radial-gradient(ellipse at 88% 86%, #d9c4eb, transparent 66%), #efe4f6; }
.bar { display: flex; align-items: center; min-height: 32px; }
.wordmark { display: inline-flex; align-items: center; gap: 6px; font: bold 1.05rem Georgia, serif; color: #402f52; }
.wordmark span { display: grid; place-items: center; border-radius: 50%; width: 23px; height: 23px; font: .72rem system-ui; background: #e4d2ef; }
#sound { position: absolute; top: clamp(12px,3.2vw,23px); right: clamp(12px,3.2vw,23px); min-height: 32px; padding: 3px 8px; font-size: .72rem; white-space: nowrap; }
.welcome-body { margin-top: 10px; }
.welcome-body > p:last-child { font-size: .85rem; color: #564561; line-height: 1.44; }
.welcome h1 { font-size: clamp(2rem,7.4vw,4rem); letter-spacing: -.068em; line-height: .94; margin: 4px 0 8px; }
.overline { color: var(--plum); font-size: .76rem; font-weight: 760; }
.sadie { width: 100%; max-width: 161px; justify-self: center; align-self: end; filter: drop-shadow(0 4px 10px #53396c21); }
.daily-progress { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.daily-progress span { background: #fbf7fe; border: 1px solid #e0d0ea; border-radius: 99px; color: #574168; font-size: .7rem; font-weight: 730; padding: 3px 7px; }
.status { color: var(--quiet); margin-top: 7px; font-size: .82rem; line-height: 1.35; overflow-wrap: anywhere; }
.status:empty { display: none; }

.game-grid { margin-top: 11px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; align-items: start; }
[data-palette="lilac"] { --card: #f5ecfa; --edge: #e5d5ef; --shade: #e9dbf3; }
[data-palette="peach"] { --card: #fbf0e4; --edge: #efdcc8; --shade: #f2dfcc; }
[data-palette="meadow"] { --card: #eef4e9; --edge: #d9e5d3; --shade: #e0ecd9; }
[data-palette="sky"] { --card: #ecf2f8; --edge: #d7e3ec; --shade: #dde8f3; }
.game { min-width: 0; overflow: hidden; padding: clamp(12px,3.1vw,17px); border: 1px solid var(--edge); border-radius: 19px; background: var(--card); box-shadow: 0 3px 9px #47324f08; }
.game-top { display: flex; align-items: center; gap: 10px; }
.game-icon { display: grid; width: 41px; height: 41px; flex: none; place-items: center; border-radius: 13px; background: var(--shade); font-size: 1.22rem; }
.game-top p { margin-top: 3px; color: var(--quiet); font-size: .8rem; line-height: 1.38; }
.card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.card-progress { color: #52684b; font-size: .7rem; font-weight: 680; margin-left: auto; max-width: 100%; overflow-wrap: anywhere; }
.player { margin-top: 10px; border: 1px solid var(--edge); border-radius: 13px; background: #fffdfa; padding: 10px; min-width: 0; }
.player-header, .round-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.player-header { justify-content: space-between; }
.mode { gap: 2px; display: flex; flex-wrap: wrap; }
.mode .button { min-height: 32px; padding-inline: 8px; }
.mode .button[aria-pressed="true"] { background: var(--shade); border-color: var(--edge); color: var(--ink); }
.game-metric { color: var(--quiet); font-size: .72rem; }
.round-name { font: bold 1.02rem/1.25 Georgia, serif; margin: 8px 0 0; overflow-wrap: anywhere; }
.prompt { min-height: 1.45em; margin: 4px 0 6px; color: var(--quiet); font-size: .82rem; line-height: 1.35; }
.round-controls { margin: 5px 0; }
.round-controls .button { min-height: 33px; }
.round-controls:empty { display: none; }
.round-result { border-radius: 9px; background: #ebf2e6; color: #3a5534; padding: 6px 8px; margin-top: 6px; font-size: .8rem; font-weight: 680; }
.round-result:empty { display: none; }

.board { display: grid; gap: 5px; margin-block: 7px 2px; }
.board[data-columns="2"] { grid-template-columns: repeat(2,minmax(0,1fr)); }
.board[data-columns="3"] { grid-template-columns: repeat(3,minmax(0,1fr)); }
.board[data-columns="4"] { grid-template-columns: repeat(4,minmax(0,1fr)); }
.board[data-columns="5"] { grid-template-columns: repeat(5,minmax(0,1fr)); }
.board[data-columns="6"] { grid-template-columns: repeat(6,minmax(0,1fr)); }
.tile { display: grid; place-content: center; justify-items: center; gap: 2px; min-width: 0; min-height: 53px; border: 1px solid var(--edge); border-radius: 9px; background: var(--card); color: var(--ink); padding: 4px 2px; font-size: .7rem; font-weight: 680; overflow-wrap: anywhere; }
.tile:hover:enabled { border-color: #9e83b5; }
.tile-symbol { font-size: 1.25rem; line-height: 1.2; }
.tile.checked { background: #f3eee8; color: #756a69; }
.tile.correct, .tile.matched { background: #e9f1e1; border-color: #bfceba; }
.tile.hidden-snack .tile-symbol { color: #806599; }
.tile.revealed { background: #f9f1e2; border-color: #e5cead; }
.tile.is-paw { min-height: 59px; }
.tile.heart { background: #f9e1e8; color: #8a3e5a; }
.tile.flower { background: #e4eedc; color: #475f3a; }
.tile.star { background: #faf0ce; color: #72582b; }
.tile.moon { background: #eae0f5; color: #583a7a; }
.tile.is-paw.lit { outline: 3px solid currentColor; outline-offset: -4px; box-shadow: inset 0 0 0 6px #fff8; }
.sequence { display: flex; flex-wrap: wrap; gap: 5px; color: var(--plum); font-size: .77rem; line-height: 1.44; }
.sequence span { border-radius: 6px; background: var(--card); border: 1px solid var(--edge); padding: 3px 5px; }
.sequence:empty { display: none; }
.board.garden { gap: 0; max-width: 302px; margin-inline: auto; border: 1px solid #9bad90; border-radius: 6px; overflow: hidden; background: #edf3e8; }
.garden .tile { aspect-ratio: 1; min-height: 0; padding: 1px; border-radius: 0; border: 1px solid #dce9d6; background: #f4f7ee; }
.garden .tile:is(.top-wall,.right-wall,.bottom-wall,.left-wall) { --hedge: #77906a; }
.garden .tile.top-wall { border-top-color: var(--hedge); }
.garden .tile.right-wall { border-right-color: var(--hedge); }
.garden .tile.bottom-wall { border-bottom-color: var(--hedge); }
.garden .tile.left-wall { border-left-color: var(--hedge); }
.garden .tile:enabled { background: #e3eedb; }
.garden .tile.me { background: #eaddf2; }
.garden .tile img { width: clamp(25px,7vw,36px); border-radius: 30%; display: block; }
.garden .tile-symbol { font-size: .97rem; }
.garden .tile:focus-visible { outline-offset: -3px; }

.shelf { background: #fffaf2; border: 1px solid #ecdfcd; border-radius: 18px; margin-top: 10px; padding: clamp(12px,3vw,19px); }
.shelf-header, .dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 9px; flex-wrap: wrap; }
.shelf-header p { color: var(--quiet); font-size: .82rem; margin-top: 4px; }
.remix-list { list-style: none; display: grid; gap: 6px; padding: 0; margin-top: 8px; }
.remix-list:empty { display: none; }
.remix { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 8px; border: 1px solid var(--edge); background: var(--card); border-radius: 10px; padding: 7px; }
.remix h3 { font-size: 1.01rem; overflow-wrap: anywhere; }
.remix p { font-size: .73rem; color: var(--quiet); }
.remix-actions { display: flex; gap: 4px; margin-left: auto; }
.remix-actions .button { min-height: 33px; }
dialog { width: min(460px, calc(100% - 24px)); max-height: 92vh; border: 1px solid var(--line); border-radius: 17px; padding: 15px; background: #fffcf9; color: var(--ink); }
dialog::backdrop { background: #2e1e4480; }
label { display: block; margin: 9px 0 4px; color: var(--quiet); font-size: .82rem; font-weight: 720; }
input, select { width: 100%; min-width: 0; border: 1px solid #d9c9e0; border-radius: 8px; background: var(--paper); color: var(--ink); padding: 8px; }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.edit-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }

@media (max-width: 660px) {
  .game-grid { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .welcome { padding: 12px; border-radius: 20px; }
  .sadie { max-width: 115px; }
}
@media (max-width: 340px) {
  .welcome { grid-template-columns: minmax(0,1fr) minmax(73px,29%); }
  .welcome h1 { font-size: 1.85rem; }
  .tile { font-size: .63rem; }
}
.welcome { background: radial-gradient(ellipse at 86% 86%, var(--shade), transparent 68%), var(--card); border-color: var(--edge); }
.welcome h1 { overflow-wrap: anywhere; }
.gate { width: min(100% - 32px, 500px); margin: min(11vh, 100px) auto 30px; }
.gate .welcome { padding: clamp(20px, 5vw, 35px); grid-template-columns: minmax(0, 1fr) minmax(75px, 29%); }
.gate .button { margin-top: 14px; min-height: 44px; }
.gate .sadie { align-self: center; }
.gate .welcome-body { margin-top: 14px; }
.gate .welcome h1 { font-size: clamp(2rem, 8vw, 3.3rem); }
.gate p { overflow-wrap: anywhere; }
