.tray-game {
  display: grid;
  grid-template-columns: minmax(0, 1.44fr) minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  grid-template-areas: "round round" "stage guide" "stage controls";
  gap: 16px clamp(18px, 3vw, 36px);
  margin-top: 24px;
  padding: clamp(15px, 2.5vw, 30px);
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fffdf6;
}

.tray-round {
  grid-area: round;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.tray-date {
  color: #8c372c;
  font-size: .9rem;
  font-weight: 750;
}

.tray-badge {
  padding: 3px 10px;
  border-radius: 20px;
  background: #e6edda;
  color: #254c39;
  font-size: .82rem;
  font-weight: 750;
}

.tray-guide {
  grid-area: guide;
  padding-top: 4px;
}

.tray-guide h2 {
  font-size: clamp(1.9rem, 3.7vw, 3rem);
}

.tray-guide p {
  max-width: 41ch;
  margin-top: .65em;
  color: #46594c;
}

.tray-guide h2:focus-visible {
  outline: 2px solid #aa591b;
  outline-offset: 4px;
  border-radius: 3px;
}

.tray-stage {
  grid-area: stage;
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  aspect-ratio: 720 / 430;
  overflow: hidden;
  background-color: #f5d1af;
  background-image: repeating-linear-gradient(0deg, #b64e3736 0 20px, transparent 20px 40px),
    repeating-linear-gradient(90deg, #b64e3736 0 20px, transparent 20px 40px),
    linear-gradient(135deg, #fce4ba, #e8b895);
  border-radius: 11px;
  border: 1px solid #bd9279;
}

.tray-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tray-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 4px;
  align-self: stretch;
  width: 93%;
  margin: 3.5% 0;
  padding: 2%;
  list-style: none;
  border: clamp(4px, .65vw, 8px) solid #52857b;
  border-radius: clamp(14px, 3vw, 31px);
  background: radial-gradient(ellipse at 35% 14%, #dadfb3, #aecaa1 70%, #98bca0);
  box-shadow: inset 0 0 0 1px #316254, inset 0 0 0 4px #e8ebbaab, 0 3px 0 #2a554b, 0 8px 16px #75412e65;
}

.tray-object {
  display: grid;
  grid-template-rows: auto auto;
  justify-items: center;
  align-content: center;
  min-width: 0;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 3px;
  color: #193b2d;
  text-align: center;
  font-size: clamp(.69rem, 1.65vw, .88rem);
  font-weight: 750;
  line-height: 1.14;
}

.tray-object img {
  width: clamp(54px, 12vw, 140px);
  max-width: 100%;
  height: clamp(44px, 8vw, 97px);
  object-fit: contain;
}

.tray-empty {
  place-self: center;
  width: 60%;
  height: 68%;
  border: 1px dashed #416f58;
  border-radius: 55% 45% 47% 53% / 56% 54% 46% 44%;
}

.tray-object:has(.tray-marker) {
  border-color: #45674c;
  background: #f9f1cda8;
}

.tray-marker {
  color: #7a2f24;
  font-size: .72rem;
}

.tray-cover {
  position: absolute;
  inset: 1%;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.tray-cover img {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: drop-shadow(0 6px 6px #56332e75);
}

.tray-cover p {
  padding: 7px 14px 9px;
  border: 1px solid #ad7663;
  border-radius: 9px;
  background: #fff1d5;
  color: #82392e;
  font: 650 clamp(1.4rem, 4vw, 2.4rem)/1 var(--serif);
}

.tray-controls {
  grid-area: controls;
}

.tray-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tray-game[data-phase="guess"] [data-tray-active] .tray-actions {
  display: none;
}

.tray-actions .btn {
  min-height: 44px;
}

.tray-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  min-height: 44px;
  margin-top: 8px;
  color: #46594c;
  font-size: .9rem;
  font-weight: 650;
  cursor: pointer;
}

.tray-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--green);
}

.tray-clock {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
  color: #475e4f;
  font-size: .87rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.tray-clock progress {
  flex: 1;
  min-width: 0;
  max-width: 180px;
  height: 10px;
  accent-color: #3d7252;
}

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

.tray-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 53px;
  padding: 7px 8px;
  border: 1px solid #a4ae9c;
  border-radius: 8px;
  color: #244534;
  background: #fff9e9;
  text-align: start;
  font-size: .9rem;
  font-weight: 750;
  line-height: 1.2;
}

.tray-choice:hover {
  border-color: #4b7954;
  background: #eff1df;
}

.tray-choice img {
  width: 32px;
  height: 35px;
  object-fit: contain;
  flex: none;
}

.tray-leave {
  min-height: 44px;
  margin-top: 8px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #49594e;
  text-decoration: underline;
  text-underline-offset: .2em;
  font-size: .9rem;
  font-weight: 650;
}

.tray-watch {
  margin-top: 16px;
  font-size: .94rem;
  color: #49594e;
}

.tray-watch a {
  color: #8f3526;
  font-weight: 700;
}

@media (max-width: 760px) {
  .tray-game {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    grid-template-areas: "round" "guide" "stage" "controls";
    gap: 12px;
  }

  .tray-game[data-phase="ready"] {
    grid-template-areas: "round" "guide" "controls" "stage";
  }

  .tray-stage {
    min-height: 216px;
  }
}

@media (max-width: 370px) {
  .tray-choice {
    gap: 5px;
    font-size: .82rem;
  }

  .tray-choice img {
    width: 25px;
  }
}
