/* Tray on the shared felt — distinct from Recall’s flat card grid, not a light theme. */

.game-root { min-height: 44rem; }

.tray-num {
  display: inline-block;
  min-width: 2ch;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.tray-go {
  min-width: 8.6rem;
  white-space: nowrap;
}

.tray-stage {
  --tray-slot-w: 5.35rem;
  --tray-slot-h: 5.85rem;
  --tray-gap: 0.5rem 0.45rem;
  width: min(100%, 38rem);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  user-select: none;
}

.tray-status {
  min-height: 4.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.12rem;
  text-align: center;
}

.tray-line,
.tray-note {
  margin: 0;
  line-height: 1.35;
  min-height: 1.35em;
}

.tray-line { color: #f4f0e8; }

.tray-note {
  color: #d5ddd6;
  font-size: 0.95rem;
}

.tray-note.is-good { color: #e0b948; }

.tray-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Wooden tray with a quiet brass lip — sits on the felt, no light desk. */
.tray-well {
  position: relative;
  padding: 0.95rem 1.1rem 1.15rem;
  border-radius: 1.35rem;
  background:
    linear-gradient(145deg, #6a4a2e 0%, #4a3220 38%, #3a2718 100%);
  box-shadow:
    inset 0 1px 0 rgba(232, 200, 140, 0.28),
    inset 0 0 0 1px rgba(20, 12, 6, 0.55),
    inset 0 -14px 22px rgba(0, 0, 0, 0.28),
    0 10px 22px rgba(0, 0, 0, 0.28);
}

.tray-well::before {
  content: '';
  position: absolute;
  inset: 0.42rem;
  border-radius: 1.05rem;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 220, 160, 0.08), transparent 42%),
    linear-gradient(180deg, #2a1c12 0%, #1c130c 100%);
  box-shadow:
    inset 0 0 0 1px rgba(196, 162, 74, 0.28),
    inset 0 10px 18px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.tray-well-label {
  position: relative;
  z-index: 1;
  margin: 0 0 0.55rem;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c9b07a;
}

.tray-board {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, var(--tray-slot-w));
  gap: var(--tray-gap);
  justify-content: center;
  /* Always reserve two rows so Easy/Medium/Hard keep the same tray height. */
  grid-template-rows: repeat(2, var(--tray-slot-h));
  min-height: calc(var(--tray-slot-h) * 2 + 0.5rem);
}

.tray-slot {
  width: var(--tray-slot-w);
  height: var(--tray-slot-h);
  min-width: var(--tray-slot-w);
  min-height: var(--tray-slot-h);
  max-width: var(--tray-slot-w);
  max-height: var(--tray-slot-h);
  box-sizing: border-box;
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.28rem;
  padding-top: 0.15rem;
}

.tray-blank,
.tray-cover {
  width: 3.15rem;
  height: 3.15rem;
  margin-top: 0.15rem;
  border-radius: 50%;
  box-sizing: border-box;
  flex: none;
}

/* Shallow wells cut into the tray bed. */
.tray-blank {
  background: rgba(0, 0, 0, 0.35);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(196, 162, 74, 0.16);
}

.tray-cover {
  background:
    radial-gradient(circle at 50% 40%, #3d4a44, #24302b 70%);
  box-shadow:
    inset 0 0 0 1px rgba(196, 162, 74, 0.22),
    inset 0 3px 6px rgba(0, 0, 0, 0.4);
}

.tray-token {
  color: var(--item-ink, #1d2433);
}

.tray-token-face {
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background:
    radial-gradient(circle at 30% 26%, #fffdf7, #efe8d8 58%, #e2d8c4 100%);
  box-shadow:
    inset 0 0 0 1px rgba(184, 146, 58, 0.4),
    0 2px 5px rgba(0, 0, 0, 0.35);
}

.tray-token-face .tray-mark {
  width: 54%;
  height: 54%;
}

.tray-token-label {
  display: block;
  width: 100%;
  padding: 0 0.1rem;
  font-size: 0.68rem;
  line-height: 1.2;
  text-align: center;
  text-transform: lowercase;
  color: #f0e6d0;
  word-break: break-word;
  hyphens: auto;
}

.tray-token.is-missed-item .tray-token-face {
  box-shadow:
    inset 0 0 0 3px #8a6a20,
    0 0 0 2px rgba(224, 185, 72, 0.4);
}

.tray-mark {
  width: 52%;
  height: 52%;
  overflow: visible;
  pointer-events: none;
}

.tray-mark circle,
.tray-mark path,
.tray-mark rect,
.tray-mark polygon { fill: currentColor; }

.tray-key {
  position: absolute;
  top: 0.28rem;
  left: 0.35rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: #5c564c;
  opacity: 0.85;
  pointer-events: none;
}

.tray-shelf {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.7rem 0.75rem 0.8rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  min-height: 11.5rem;
}

.tray-shelf.is-live {
  box-shadow: inset 0 0 0 1px rgba(224, 185, 72, 0.7);
}

.tray-shelf.is-idle { opacity: 0.55; }

.tray-shelf.is-idle .tray-shelf-label { visibility: hidden; }

.tray-shelf-label {
  margin: 0;
  min-height: 1.35em;
  line-height: 1.35;
  text-align: center;
  font-size: 0.95rem;
  color: #d5ddd6;
}

.tray-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.tray-choices[data-count="6"],
.tray-choices[data-count="8"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tray-choice {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0.45rem 0.5rem 0.5rem;
  border: 0;
  border-radius: 12px;
  min-height: var(--tap-min);
  display: grid;
  grid-template-columns: 3.1rem 1fr;
  align-items: center;
  gap: 0.55rem;
  text-align: left;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  background: #fffdf7;
  color: #1d2433;
  box-shadow:
    inset 0 0 0 1px rgba(184, 146, 58, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.35);
}

.tray-choice:focus-visible {
  outline: 3px solid #e0b948;
  outline-offset: 3px;
}

.tray-choice:disabled {
  cursor: default;
}

.tray-choice.is-right {
  box-shadow:
    inset 0 0 0 3px #2e6b4a,
    0 0 0 2px rgba(46, 107, 74, 0.7);
}

.tray-choice.is-miss {
  background: #f6e4e1;
  box-shadow: inset 0 0 0 3px #a3302f;
}

.tray-choice-face {
  position: relative;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--item-ink, #1d2433);
  background:
    radial-gradient(circle at 30% 26%, #ffffff, #efe8d8 58%, #e2d8c4 100%);
  box-shadow: inset 0 0 0 1px rgba(184, 146, 58, 0.35);
}

.tray-choice-face .tray-mark {
  width: 54%;
  height: 54%;
}

.tray-choice-label {
  font-size: 0.92rem;
  line-height: 1.25;
  color: #1d2433;
  text-transform: lowercase;
}

.tray-actions {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  min-height: 2.75rem;
}

.tray-actions .btn { min-width: 8rem; }

@media (max-width: 640px), (pointer: coarse) {
  .tray-stage {
    --tray-slot-w: 5rem;
    --tray-slot-h: 5.65rem;
  }

  .tray-key { display: none; }
  .tray-note.is-keys { visibility: hidden; }
}

@media (max-width: 380px) {
  .tray-stage {
    --tray-slot-w: 4.55rem;
    --tray-slot-h: 5.45rem;
  }

  .tray-token-face,
  .tray-blank,
  .tray-cover {
    width: 2.85rem;
    height: 2.85rem;
  }

  .tray-token-label { font-size: 0.62rem; }

  .tray-choice {
    grid-template-columns: 2.75rem 1fr;
    padding: 0.4rem;
  }

  .tray-choice-face {
    width: 2.75rem;
    height: 2.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tray-tile,
  .tray-cover,
  .tray-shelf {
    transition: none !important;
  }
}
