@import url('./tokens.css');

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: 'Trebuchet MS', 'Avenir Next', Avenir, sans-serif; -webkit-font-smoothing: antialiased; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button { touch-action: manipulation; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible { outline: 3px solid #527e70; outline-offset: 5px; }
button, a { -webkit-user-select: none; user-select: none; }
button svg, [data-icon] svg { width: 20px; height: 20px; display: block; }
[hidden] { display: none !important; }
.site-header { max-width: 1376px; margin: auto; padding: 30px 52px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-size: 25px; font-weight: 800; letter-spacing: -1.1px; }
.brand-dot { color: #d8876c; }
.brand-mark { display: grid; grid-template-columns: 13px 13px; grid-template-rows: 13px 13px; gap: 3px; transform: rotate(-7deg); }
.brand-mark i { background: #e69a80; border-radius: 4px; }
.brand-mark i:nth-child(2) { grid-row: 2; }
.brand-mark i:nth-child(3) { grid-row: 2; background: #edbd62; }
.header-actions { display: flex; gap: 12px; align-items: center; }
.header-note { margin-right: 17px; font-size: 13px; color: var(--muted); letter-spacing: .3px; }
.icon-button { width: 43px; height: 43px; padding: 11px; border: 1px solid #e6e4db; border-radius: 50%; background: transparent; display: grid; place-items: center; }
.icon-button:hover { background: #efeee4; }
main { padding: 24px 24px 0; overflow: hidden; }
.intro { text-align: center; }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 2.3px; color: #818676; display: flex; align-items: center; justify-content: center; gap: 8px; }
.eyebrow span { width: 6px; height: 6px; border-radius: 50%; background: #9fac88; }
h1 { margin: 16px 0 12px; font-size: clamp(30px, 3.5vw, 46px); font-weight: 800; letter-spacing: -1.9px; line-height: 1.2; }
h1 span { color: #809571; }
.intro p { font-size: 15px; color: var(--muted); margin: 0; }
.mode-switch { margin: 28px auto 36px; padding: 5px; border-radius: 15px; background: #eeeee4; display: flex; width: max-content; gap: 3px; }
.mode-switch button { display: flex; align-items: center; justify-content: center; gap: 9px; min-width: 146px; padding: 12px 19px; background: transparent; border: 0; border-radius: 11px; font-size: 13px; color: #7e8374; font-weight: 700; }
.mode-switch button[aria-pressed='true'] { color: #4b5e43; background: #fffef9; box-shadow: 0 2px 5px #4148340d; }
.mode-switch svg { width: 17px; height: 17px; }
.play-space { max-width: 1076px; margin: auto; display: grid; grid-template-columns: 230px minmax(0, 410px) 252px; gap: 54px; align-items: center; }
.play-note { padding-bottom: 16px; }
.mascot { --block: 47px; display: grid; grid-template-columns: repeat(3, var(--block)); grid-template-rows: repeat(2, var(--block)); gap: 4px; transform: rotate(-9deg); width: max-content; margin: 0 0 32px 25px; }
.mascot i { border-radius: 12px; background: #ebbb66; box-shadow: inset 0 -5px 0 #d4a65555, inset 0 2px 0 #ffffff55; }
.mascot i:nth-child(1) { grid-column: 2; }.mascot i:nth-child(2) { grid-column: 1; grid-row: 2; }.mascot i:nth-child(3) { grid-column: 2; grid-row: 2; }.mascot i:nth-child(4) { grid-column: 3; grid-row: 2; }
.has-face { position: relative; }
.face { position: absolute; width: 23px; height: 16px; left: 50%; top: 48%; transform: translate(-50%, -50%); color: #594b3c; pointer-events: none; }
.face::before { content: ''; position: absolute; top: 1px; left: 3px; width: 4px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 13px 0 currentColor; }
.face::after { content: ''; position: absolute; width: 7px; height: 4px; border: 1.5px solid currentColor; border-top: 0; border-radius: 0 0 10px 10px; bottom: 0; left: 9px; }
.play-note h2 { font-size: 20px; letter-spacing: -.5px; margin: 0 0 12px; }
.play-note p { color: var(--muted); font-size: 13px; line-height: 1.9; margin: 0; }
.note-doodle { display: block; color: #bbb7a4; font-size: 49px; margin: 0 0 0 34px; transform: rotate(-15deg); line-height: 1; }
.gentle-note { display: flex; gap: 12px; align-items: center; margin-top: 25px; color: #858b78; font-size: 11px; line-height: 1.7; }
.gentle-note svg { width: 27px; height: 27px; color: #b3ad86; }
.board-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 5px 14px; height: 38px; }
#puzzle-label { font-size: 10px; letter-spacing: 2px; color: #818675; font-weight: 700; }
#progress { display: flex; gap: 7px; align-items: center; }
.progress-flower { font-family: sans-serif; font-size: 24px; line-height: 1; color: #dddfd2; }
.progress-flower.filled { color: var(--color); }
.free-progress { font-size: 11px; color: var(--muted); }
.board-frame { position: relative; background: #e6e8da; border: 1px solid #dce0cf; padding: 15px; border-radius: 25px; box-shadow: 0 8px 0 #d7dccb, 0 15px 27px #4c56320b; }
.board { display: grid; grid-template-columns: repeat(var(--size), minmax(0, 1fr)); gap: 7px; aspect-ratio: 1; }
.cell { position: relative; min-width: 0; padding: 0; border: 1px solid #daddcc; border-radius: 13px; background: #f1f2e7; box-shadow: inset 0 2px 3px #78856609; transition: background .16s, box-shadow .16s; }
.cell-dot { display: block; width: 4px; height: 4px; background: #ced3bf; border-radius: 50%; margin: auto; }
.cell.occupied { background: var(--color); border-color: var(--edge); box-shadow: inset 0 -5px 0 var(--shade), inset 0 2px 0 #ffffff45; animation: settle .23s ease-out; }
.cell.occupied .cell-dot, .cell.hint .cell-dot, .cell.preview .cell-dot { display: none; }
.cell.hint, .cell.preview { background: var(--light); border: 2px dashed var(--edge); }
.cell.hint::after { content: ''; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--edge); inset: 0; margin: auto; }
.board-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; gap: 7px; }
.text-button { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 12px 0; font-size: 11px; white-space: nowrap; color: #6f7964; min-height: 44px; }
.text-button:disabled { opacity: .4; }
.text-button:hover:not(:disabled) { color: #33452c; }
.text-button svg { width: 15px; height: 15px; }
.board-caption { font-size: 10px; color: #959a88; text-align: center; }
.piece-panel { background: #f3f0e7; border: 1px solid #e9e5d9; padding: 23px 18px 20px; border-radius: 22px; }
.tray-heading { display: flex; align-items: center; gap: 9px; }
.step-number { display: grid; place-items: center; flex-shrink: 0; background: #e5e5d6; border-radius: 50%; width: 22px; height: 22px; font-size: 10px; color: #778265; }
.tray-heading h2 { font-size: 14px; margin: 0; letter-spacing: -.2px; }
.tray-description { font-size: 10px; color: var(--muted); margin: 8px 0 20px 31px; }
.tray { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.piece-card { position: relative; display: grid; place-items: center; background: #fcfbf7; min-height: 115px; border: 2px solid transparent; border-radius: 14px; padding: 14px 4px 19px; touch-action: none; transition: background .15s, border-color .15s, transform .15s; }
.piece-card { container-type: inline-size; }
.piece-card:hover:not(:disabled) { background: white; transform: translateY(-2px); }
.piece-card.selected { border-color: #829b72; background: #fffef9; }
.piece-card.placed { opacity: .35; background: transparent; }
.piece-indicator { font-size: 8px; position: absolute; bottom: 7px; right: 9px; color: #a4a497; }
.piece-card.placed .piece-indicator { color: #426b36; font-size: 13px; }
.shape { --unit: 24px; display: grid; grid-template-columns: repeat(var(--cols), var(--unit)); grid-template-rows: repeat(var(--rows), var(--unit)); gap: 3px; pointer-events: none; }
.block { background: var(--color); border-radius: 6px; position: relative; box-shadow: inset 0 -3px 0 var(--shade), inset 0 1px 0 #ffffff55; }
.piece-card .shape { --unit: min(24px, calc((100cqw - 9px) / var(--cols))); }
.shape .block { pointer-events: auto; }
.shape .face { transform: translate(-50%, -50%) scale(.58); }
.placement-hint { display: flex; align-items: center; gap: 9px; margin-top: 19px; padding-top: 16px; border-top: 1px dashed #dcdccc; }
.placement-hint p { font-size: 11px; line-height: 1.6; color: #808573; margin: 0; }
.free-tray .piece-card:last-child { grid-column: 1 / -1; min-height: 88px; }
.encouragement { font-size: 13px; color: #7c896d; text-align: center; min-height: 20px; margin: 25px auto 0; }
footer { max-width: 1076px; border-top: 1px solid #e9e8de; margin: 35px auto 0; display: flex; justify-content: center; align-items: center; gap: 8px; color: #a2a595; padding: 23px 0 27px; font-size: 11px; }
footer svg { width: 13px !important; height: 13px !important; color: #a5af95; }
.celebration { position: absolute; inset: 15px; border-radius: 16px; background: #fffdf2ed; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; animation: appear .3s ease-out; }
.celebration-flower { font-size: 72px; color: #e6b757; line-height: 1; font-family: sans-serif; }
.celebration h2 { font-size: 35px; letter-spacing: -1px; margin: 18px 0 7px; }
.celebration p { font-size: 13px; color: var(--muted); margin: 0 0 24px; }
.primary-button { background: #7e946e; color: white; border: 0; border-radius: 13px; padding: 15px 19px; display: inline-flex; align-items: center; justify-content: center; gap: 16px; font-size: 13px; min-height: 48px; }
.primary-button:hover { background: #697f59; }
.drag-ghost { position: fixed; z-index: 5; pointer-events: none; opacity: .7; filter: drop-shadow(0 8px 6px #0002); }
.drag-ghost.ready { opacity: 1; filter: drop-shadow(0 12px 9px #00000024); }
.drag-ghost .shape { --unit: var(--ghost-unit, 32px); gap: var(--ghost-gap, 3px); }
dialog { position: fixed; width: min(460px, calc(100% - 32px)); border: 1px solid #e4e2d4; padding: 35px; border-radius: 24px; background: var(--paper); color: var(--ink); box-shadow: 0 20px 100px #26311a20; }
dialog::backdrop { background: #39443066; backdrop-filter: blur(4px); }
.dialog-close { position: absolute; right: 15px; top: 15px; }
.dialog-flower { font-family: sans-serif; color: #d4ae5c; font-size: 47px; }
dialog h2 { font-size: 23px; letter-spacing: -.6px; }
dialog p { font-size: 13px; color: #727966; line-height: 1.8; }
dialog .keyboard-help { font-size: 11px; padding-top: 10px; border-top: 1px solid #e4e4d7; }
dialog .primary-button { margin-top: 12px; width: 100%; }
.noscript { text-align: center; }
@keyframes settle { from { transform: scale(.85); } to { transform: scale(1); } }
@keyframes appear { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

@media (min-width: 1450px) {
  main { padding-top: 40px; }
  .mode-switch { margin-bottom: 48px; }
  .play-space { grid-template-columns: 230px minmax(0, 440px) 252px; max-width: 1130px; gap: 65px; }
  .encouragement { margin-top: 38px; }
}
@media (max-width: 1100px) {
  .play-space { grid-template-columns: 170px minmax(0, 380px) 224px; gap: 26px; max-width: 826px; }
  .play-note h2 { font-size: 18px; }.play-note p { font-size: 11px; }
  .mascot { --block: 38px; margin-left: 9px; }
  .piece-panel { padding: 20px 13px; }.tray-heading h2 { font-size: 13px; }
  .tray-description { margin-left: 0; }.shape { --unit: 21px; }
  .board-caption { display: none; }
}
@media (max-width: 850px) {
  .site-header { padding: 24px 28px; }
  main { padding-top: 18px; }
  .play-space { grid-template-columns: minmax(0, 390px) 230px; gap: 30px; max-width: 650px; }
  .play-note { display: none; }
  h1 { font-size: 36px; }.eyebrow { font-size: 9px; }
  .intro p { font-size: 13px; }
  .piece-card .shape { --unit: min(23px, calc((100cqw - 9px) / var(--cols))); }
}
@media (max-width: 600px) {
  .site-header { padding: 11px 20px; }.brand { font-size: 22px; }.header-note { display: none; }
  .header-actions { gap: 7px; }.icon-button { width: 42px; height: 42px; }
  main { padding: 5px 19px 0; }.eyebrow { display: none; }
  h1 { font-size: 25px; letter-spacing: -.9px; margin: 5px 0 0; }h1 span { display: block; }
  .intro p { display: none; }
  .mode-switch { margin: 16px auto 17px; padding: 4px; }.mode-switch button { min-width: 137px; padding: 11px 15px; font-size: 12px; }
  .play-space { display: flex; flex-direction: column; gap: 14px; max-width: 380px; }
  .game-column { width: 100%; }.board-heading { padding-bottom: 10px; height: 30px; }
  .board-frame { padding: 11px; border-radius: 21px; }.board { gap: 6px; }.cell { border-radius: 10px; }
  .board-actions { margin-top: 12px; }.board-caption { display: block; font-size: 9px; }
  .piece-panel { width: 100%; padding: 14px 12px 12px; border-radius: 17px; }
  .tray-heading { gap: 7px; }.tray-heading h2 { font-size: 12px; }.step-number { width: 20px; height: 20px; }
  .tray-description { position: relative; float: right; margin: -16px 0 15px; font-size: 9px; }
  .tray { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; clear: both; margin-top: 12px; }
  .piece-card { min-height: 92px; border-radius: 10px; padding: 10px 2px 16px; }.shape { gap: 2px; }.piece-card .shape { --unit: min(18px, calc((100cqw - 6px) / var(--cols))); }.block { border-radius: 5px; }
  .placement-hint { display: none; }
  .free-tray { grid-template-columns: repeat(3, minmax(0, 1fr)); }.free-tray .piece-card:last-child { grid-column: auto; min-height: 96px; }
  .encouragement { font-size: 11px; line-height: 1.6; margin-top: 14px; max-width: 330px; }
  footer { font-size: 9px; margin-top: 22px; padding: 17px 0 22px; gap: 6px; }
  .celebration { inset: 11px; }.celebration-flower { font-size: 58px; }.celebration h2 { font-size: 30px; }
}
@media (max-width: 360px) {
  main { padding-left: 12px; padding-right: 12px; }.site-header { padding-inline: 15px; }
  .tray-description { float: none; margin: 7px 0 0 27px; }.shape { --unit: 16px; }.piece-card { min-height: 90px; }
  .board-caption { display: none; }.intro p { font-size: 10px; }.brand { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
