* { box-sizing: border-box; }
.play-shell { min-height: 100vh; background: linear-gradient(180deg, rgba(143, 224, 200, .22), transparent 360px), #fbfcf7; }
.h5-layout { width: min(1160px, calc(100% - 28px)); margin: 0 auto 40px; display: grid; grid-template-columns: minmax(0, 720px) minmax(310px, 400px); gap: 18px; align-items: start; }
.mosaic-panel, .ledger { border: 1px solid rgba(31, 55, 68, .16); border-radius: 8px; background: rgba(255, 255, 255, .88); box-shadow: 0 22px 70px rgba(20, 35, 45, .15); padding: clamp(16px, 3vw, 26px); }
.panel-heading, .meta-stack, .controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-heading { justify-content: space-between; margin-bottom: 20px; }
.meta-stack span { min-height: 36px; border: 1px solid rgba(31, 55, 68, .16); border-radius: 6px; padding: 7px 10px; background: #edf4ef; color: #203747; font-weight: 850; }
.mosaic-board { --cols: 5; --rows: 5; display: grid; grid-template-columns: minmax(56px, 92px) minmax(0, 1fr); grid-template-rows: minmax(46px, auto) minmax(0, 1fr); gap: 8px; align-items: stretch; }
.clue-corner, .row-clues span, .column-clues span { display: grid; place-items: center; border: 1px solid rgba(31, 55, 68, .16); border-radius: 6px; background: #edf4ef; color: #203747; font-size: 13px; font-weight: 900; text-align: center; }
.clue-corner { min-height: 46px; color: #0b8f8a; }
.column-clues { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 6px; }
.row-clues { display: grid; grid-template-rows: repeat(var(--rows), minmax(0, 1fr)); gap: 6px; }
.column-clues span { min-height: 46px; padding: 5px 3px; align-content: end; white-space: pre-line; }
.row-clues span { min-height: 0; padding: 0 6px; }
.mosaic-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), minmax(0, 1fr)); aspect-ratio: var(--cols) / var(--rows); border: 2px solid #203747; border-radius: 8px; overflow: hidden; background: #203747; }
.cell-button { min-width: 0; min-height: 0; border: 1px solid rgba(32, 55, 71, .34); background: #fffdf0; color: #203747; font: inherit; font-weight: 950; cursor: pointer; transition: transform 120ms ease, background 120ms ease; }
.cell-button:hover { transform: translateY(-1px); }
.cell-button.filled { background: #203747; color: #fbfcf7; }
.cell-button.empty { background: #f4d66a; color: #203747; }
.cell-button.unknown { background: #fffdf0; color: rgba(32, 55, 71, .4); }
.mark-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mark-controls button, .controls button { min-height: 44px; border: 0; border-radius: 6px; padding: 0 12px; background: #0b8f8a; color: #fff; font: inherit; font-weight: 900; cursor: pointer; }
.mark-controls button[aria-pressed="true"] { outline: 3px solid rgba(245, 188, 67, .62); outline-offset: 2px; }
.mark-controls [data-mark="Empty"], #hint-button { background: #f5bc43; color: #203747; }
.mark-controls [data-mark="Unknown"], #reset-button { background: #edf4ef; color: #203747; }
#undo-button { background: #ef5d48; }
#submit-button { background: #203747; }
h1, h2, h3 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(34px, 6vw, 60px); line-height: 1; }
h2 { font-size: clamp(24px, 4vw, 34px); line-height: 1.05; }
h3 { margin: 18px 0 8px; color: #0b8f8a; font-size: 13px; text-transform: uppercase; }
.rule-list { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.rule-list li { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid rgba(31, 55, 68, .16); border-radius: 6px; padding: 8px 10px; background: #edf4ef; color: #52626d; font-weight: 850; }
.rule-list .ok { color: #0b8f8a; border-color: rgba(11, 143, 138, .45); }
.rule-list .bad { color: #b53c2b; border-color: rgba(239, 93, 72, .46); }
.status { min-height: 48px; color: #203747; font-weight: 780; }
@media (max-width: 900px) {
  .h5-layout { grid-template-columns: 1fr; width: min(100% - 18px, 720px); }
  .mosaic-board { grid-template-columns: minmax(48px, 76px) minmax(0, 1fr); gap: 6px; }
  .mark-controls { grid-template-columns: 1fr; }
}
