:root { color-scheme: light; --paper: #FBF4E4; --ink: #292d28; --accent: #435b3b; --line: #d7cfbd; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Arial, Helvetica, sans-serif; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; border-radius: 3px; }
button:focus-visible, select:focus-visible { outline: 4px solid #aa6a27; outline-offset: 4px; }
.start-screen { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; padding: 30px; }
h1 { margin: 0 0 18px; font-size: clamp(64px, 7vw, 130px); line-height: .96; letter-spacing: -.045em; text-align: center; }
.group-control { display: flex; align-items: center; gap: 24px; font-size: 22px; letter-spacing: .1em; }
select { background: var(--paper); border: 1px solid var(--ink); padding: 12px 20px; font-size: 30px; min-width: 100px; }
.primary { background: var(--accent); color: var(--paper); border: 0; padding: 20px 54px; font-size: 28px; font-weight: bold; letter-spacing: .07em; }
.primary:hover { background: #31462b; }
.text-button { background: transparent; border: 0; padding: 12px; font-size: 16px; letter-spacing: .06em; text-decoration: underline; text-underline-offset: 5px; }
.groups-screen { height: 100dvh; padding: 0 24px 20px; display: flex; flex-direction: column; }
.activity-header { flex: 0 0 70px; display: flex; align-items: center; justify-content: space-between; font-weight: bold; letter-spacing: .08em; }
.group-table { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--groups), minmax(0, 1fr)); border-top: 1px solid var(--line); }
.group-column { min-width: 0; min-height: 0; display: grid; grid-template-rows: 78px repeat(3, minmax(0, 1fr)); border-right: 1px solid var(--line); }
.group-column:last-child { border-right: 0; }
.group-name { background: transparent; border: 0; font-size: clamp(22px, 1.8vw, 35px); font-weight: bold; width: 100%; }
.group-name:hover { background: #eee5d1; text-decoration: underline; text-underline-offset: 7px; }
.item-slot { min-height: 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 10px; gap: 10px; }
.item-slot img { width: 100%; min-height: 0; flex: 1; object-fit: contain; max-height: 225px; }
.item-label { flex-shrink: 0; font-size: clamp(20px, 1.45vw, 28px); line-height: 1.15; text-align: center; max-width: 100%; }
.empty-mark { width: 30px; height: 2px; background: var(--line); }
dialog { background: var(--paper); color: var(--ink); width: min(1500px, calc(100vw - 64px)); max-width: none; max-height: calc(100dvh - 64px); padding: 28px 36px; border: 2px solid var(--ink); border-radius: 4px; }
dialog::backdrop { background: rgb(25 28 24 / 55%); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
h2 { font-size: 36px; margin: 0; letter-spacing: .03em; }
.close-button { border: 0; background: transparent; font-size: 42px; line-height: 1; width: 56px; height: 56px; }
.item-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.item-choice { position: relative; display: flex; flex-direction: column; align-items: center; background: var(--paper); border: 2px solid var(--line); padding: 16px 10px; gap: 12px; }
.item-choice img { width: 100%; height: clamp(90px, 18vh, 190px); object-fit: contain; }
.item-choice .item-label { font-size: clamp(18px, 1.4vw, 27px); }
.item-choice[aria-pressed="true"] { border: 3px solid var(--accent); padding: 15px 9px; }
.selection-mark { position: absolute; top: 8px; right: 8px; background: var(--accent); color: var(--paper); width: 30px; height: 30px; display: grid; place-items: center; font-size: 20px; }
.item-choice:disabled { cursor: default; }
.item-choice:disabled .item-label { opacity: .55; }
.dialog-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; }
#selection-count { font-size: 26px; }
#storage-status { position: fixed; bottom: 0; margin: 0; padding: 8px; background: var(--paper); border: 1px solid var(--ink); font-size: 14px; }
@media (max-width: 900px) {
  .groups-screen { padding: 0 10px 10px; }
  .group-table { overflow-x: auto; grid-template-columns: repeat(var(--groups), minmax(140px, 1fr)); }
  .group-column { grid-template-rows: 60px repeat(3, minmax(0, 1fr)); }
  .item-slot { padding: 8px; gap: 6px; }
  .item-label { font-size: 18px; }
  dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 16px; }
  .item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .item-choice img { height: 110px; }
  h2 { font-size: 28px; }
  .dialog-footer .primary { padding: 16px 24px; font-size: 22px; }
}
@media (max-height: 650px) and (min-width: 901px) {
  dialog { padding: 16px; }
  .dialog-header { margin-bottom: 10px; }
  .item-choice { padding-top: 8px; padding-bottom: 8px; }
  .item-choice img { height: 90px; }
  .dialog-footer { margin-top: 12px; }
}
