/* Molded plastic tray and two-sided cards rotating around physical hinges. */
.hero {
  padding-top: 30px;
  padding-bottom: 27px;
}
.hero h1 {
  font-size: 48px;
  margin-top: 13px;
}
.board-tray {
  --plastic: #2872bd;
  position: relative;
  padding: 0 25px;
  border: 3px solid #397cbb;
  border-top-color: #6da9de;
  border-bottom: 13px solid #174b83;
  border-radius: 27px 27px 20px 20px;
  background: linear-gradient(115deg, #438bcb 0%, #2872b9 45%, #225e9e 100%);
  box-shadow:
    inset 0 2px 2px #ffffff60,
    inset 3px 0 5px #ffffff20,
    inset -3px 0 5px #133e7960,
    0 5px 0 #123c6a,
    0 9px 0 -2px #c8b99b,
    0 20px 27px -12px #122a4e60;
  isolation: auto;
}
.tray-top-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 11px 25px;
  color: #c2e0fb;
  font-size: 8px;
  letter-spacing: 2px;
  font-weight: 700;
  text-shadow: 0 -1px #1e558c;
}
.tray-edition {
  font-size: 7px;
  letter-spacing: 1px;
}
.tray-edition b {
  padding: 3px 5px;
  border: 1px solid #79a9d1;
  border-radius: 3px;
  margin-left: 5px;
}
.tray-screw {
  position: absolute;
  top: 16px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #245e97;
  border: 1px solid #226096;
  box-shadow:
    0 1px #78ace0,
    inset 0 1px 2px #113c70;
}
.tray-screw:after {
  content: "";
  position: absolute;
  height: 1px;
  background: #174b83;
  top: 3px;
  left: 1px;
  right: 1px;
  transform: rotate(-40deg);
}
.screw-left {
  left: 12px;
}
.screw-right {
  right: 12px;
}
.character-grid {
  position: relative;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 29px 17px;
  padding: 0 0 25px;
}
.character-card {
  aspect-ratio: 0.86;
  border-radius: 9px;
  perspective: 850px;
  isolation: auto;
  transform-style: preserve-3d;
}
.card-base {
  inset: 7px -2px -1px;
  background: linear-gradient(155deg, #18568e, #2363a3 60%, #2f79b7);
  border: 2px solid #1c548c;
  border-bottom-color: #75a1c6;
  border-radius: 7px;
  color: #6294bc;
  box-shadow: inset 0 4px 9px #1238625c;
}
.card-back-mark {
  font:
    800 38px/1 Manrope,
    sans-serif;
  font-style: normal;
  color: #3e7bad;
  text-shadow:
    0 1px #78a1c142,
    0 -1px #194e7e;
  opacity: 1;
}
.card-back-name {
  color: #8db0cf;
  font-size: 9px;
  opacity: 1;
  letter-spacing: 1px;
  margin-top: 12px;
}
.card-leaf {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  transform-style: preserve-3d;
  transform-origin: 50% calc(100% - 3px);
  transform: rotateX(-9deg);
  transition: transform 620ms cubic-bezier(0.24, 0.75, 0.22, 1);
}
.card-front,
.card-reverse {
  position: absolute;
  inset: 0;
  border: 5px solid #f2c941;
  border-top-color: #ffe786;
  border-bottom-color: #c5911f;
  border-radius: 8px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #fff7d3;
  box-shadow:
    2px 3px 0 #ba861d,
    0 7px 8px #092d4c55,
    inset 0 0 0 1px #9e751b;
  transform: translateZ(1px);
  transition: box-shadow 0.25s;
}
.card-front {
  overflow: hidden;
}
.portrait-wrap {
  padding: 3px 3px 0;
  overflow: hidden;
  background: #fff7d3;
}
.portrait-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  border-radius: 2px 2px 0 0;
}
.character-name {
  padding: 7px 5px 6px;
  font-size: 11px;
  line-height: 1;
  color: #3e3825;
  background: #fff7d3;
  font-weight: 700;
  justify-content: center;
}
.card-indicator {
  display: none;
}
.card-reverse {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transform: rotateY(180deg) translateZ(1px);
  background: repeating-linear-gradient(
    90deg,
    #eac039 0,
    #eac039 3px,
    #e4b634 3px,
    #e4b634 5px
  );
  box-shadow:
    inset 0 0 0 3px #d6a02b,
    0 2px 5px #102e4340;
  color: #c69820;
}
.card-reverse > span {
  font:
    800 40px/1 Manrope,
    sans-serif;
  text-shadow: 0 1px #ffe172;
}
.card-reverse > small {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-top: 10px;
}
.card-hinge {
  position: absolute;
  z-index: 3;
  bottom: -3px;
  height: 10px;
  width: 64%;
  left: 18%;
  border-radius: 5px;
  background: linear-gradient(#bb881c, #ffe980 34%, #edc23f 52%, #bb841c);
  border: 1px solid #a57622;
  box-shadow: 0 3px 3px #102f5b66;
  display: flex;
  justify-content: space-evenly;
}
.card-hinge i {
  display: block;
  width: 1px;
  height: 100%;
  background: #ae7d25;
  box-shadow: 1px 0 #ffdd65;
}
.character-card:hover:not(.is-down) .card-front {
  transform: translateZ(1px);
  box-shadow:
    2px 3px 0 #ba861d,
    0 9px 12px #092d4c66;
}
.character-card:hover:not(.is-down) .card-leaf {
  transform: rotateX(-18deg);
}
.character-card.is-down .card-front,
.character-card.is-down:hover .card-front {
  transform: translateZ(1px);
  filter: none;
}
.character-card.is-down .card-leaf {
  transform: rotateX(-98deg);
}
.character-card.is-down:hover .card-leaf {
  transform: rotateX(-94deg);
}
.character-card:focus-visible {
  outline: 3px solid #fff5b8;
  outline-offset: 6px;
}
.character-card.guess-target .card-front {
  border-color: #fff09a;
  border-bottom-color: #dbac28;
  box-shadow:
    0 0 0 3px #ffffffaa,
    0 8px 10px #15375b66;
}
.board-front-rail {
  margin: 0 -10px;
  border-top: 2px solid #1b5997;
  box-shadow: inset 0 1px #5a98c9;
  min-height: 73px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 15px 15px;
}
.rail-instruction {
  color: #b1d2f2;
  font-size: 8px;
  line-height: 1.5;
  letter-spacing: 1.5px;
  font-weight: 700;
  text-shadow: 0 -1px #18416e;
}
.board-wordmark {
  font:
    900 italic 31px/0.9 Manrope,
    sans-serif;
  color: #fffdf0;
  letter-spacing: -1.7px;
  text-shadow:
    1px 2px #17457b,
    2px 3px #123b6c;
  transform: rotate(-3deg);
}
.board-wordmark span {
  color: #ffe16a;
}
.board-counter {
  font-size: 7px;
  color: #bfdcf5;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.board-counter i {
  width: 7px;
  height: 7px;
  background: #f2ca4a;
  border-radius: 50%;
  box-shadow:
    inset 0 1px 2px #fff5c0,
    0 1px 2px #173b68;
}
.board-tip {
  margin-top: 26px;
}
#question-input {
  width: 100%;
  min-height: 94px;
  resize: vertical;
  max-height: 220px;
  padding: 12px;
  border: 1px solid #d4decb;
  border-radius: 8px;
  background: #fbfcf6;
  color: #334b37;
  font-size: 12px;
  line-height: 1.65;
}
#question-input::placeholder {
  color: #a0a993;
}
.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 9px;
  margin: 7px 0 14px;
  font-size: 8px;
  color: #869478;
}
#question-count {
  flex-shrink: 0;
}
#incoming-question {
  margin: 0;
  padding: 14px;
  border-left: 3px solid #9eb779;
  border-radius: 0 8px 8px 0;
  background: #eff3e6;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.response-hint {
  font-size: 10px;
  line-height: 1.7;
  color: #8a967c;
  margin: 12px 0;
}
.response-buttons {
  display: flex;
  gap: 9px;
}
.response-buttons button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 50%;
  padding: 11px;
  border: 1px solid #c4d7b3;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}
.response-true {
  background: #e5efd8;
  color: #4e7134;
}
.response-false {
  background: #f5e7dc;
  color: #9c6548;
  border-color: #e6cdbb !important;
}
.response-true:hover {
  background: #d6e6c4;
}
.response-false:hover {
  background: #efdbcb;
}
.answer-pill.pending {
  color: #8c8056;
  background: #f0ecd8;
}
.history-entry p {
  overflow-wrap: anywhere;
}
.secret-portrait > img,
.winner-art img,
.guess-preview-image {
  object-fit: cover;
  object-position: center 38%;
}
.secret-portrait {
  width: 76px;
  height: 88px;
}
.secret-portrait.has-character {
  border: 4px solid #e7c858;
  box-shadow: 0 2px 0 #bd9e3d;
}
.guess-preview-image {
  width: 155px;
  height: 175px;
  border: 6px solid #ecc63d;
  border-bottom-width: 12px;
  box-shadow: 0 4px 0 #be9023;
}
.site-footer a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.question-wait {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #879770;
  padding: 14px 0;
}
.question-wait .live-dot {
  animation: pulse-wait 1.6s ease-in-out infinite;
}
@keyframes pulse-wait {
  50% {
    opacity: 0.3;
  }
}
@media (max-width: 1150px) {
  .board-tray {
    padding: 0 18px;
  }
  .character-grid {
    gap: 25px 12px;
  }
  .character-name {
    font-size: 9px;
    padding: 6px 3px;
  }
  .card-front,
  .card-reverse {
    border-width: 4px;
  }
  .board-wordmark {
    font-size: 27px;
  }
  .tray-edition {
    display: none;
  }
}
@media (max-width: 930px) {
  .character-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .board-tray {
    padding: 0 18px;
  }
  .board-counter {
    display: none;
  }
  .card-back-mark {
    font-size: 30px;
  }
  .hero h1 {
    font-size: 44px;
  }
}
@media (max-width: 700px) {
  .hero h1 {
    font-size: 42px;
  }
  .board-tray {
    padding: 0 14px;
    border-radius: 22px 22px 17px 17px;
    border-bottom-width: 10px;
  }
  .character-grid {
    gap: 22px 11px;
    padding-bottom: 23px;
  }
  .character-card {
    aspect-ratio: 0.75;
  }
  .card-front,
  .card-reverse {
    border-width: 3px;
  }
  .portrait-wrap {
    padding: 2px 2px 0;
  }
  .character-name {
    padding: 6px 2px;
    font-size: 8px;
  }
  .card-hinge {
    height: 8px;
    bottom: -3px;
    width: 68%;
    left: 16%;
  }
  .card-reverse > span {
    font-size: 28px;
  }
  .card-reverse > small {
    font-size: 5px;
  }
  .card-back-name {
    font-size: 7px;
  }
  .tray-top-rail {
    padding: 17px 6px 23px;
    font-size: 7px;
    letter-spacing: 1.2px;
  }
  .board-front-rail {
    min-height: 62px;
    padding: 12px 9px;
  }
  .board-wordmark {
    font-size: 25px;
  }
  .rail-instruction {
    font-size: 6px;
  }
  .secret-portrait {
    width: 64px;
    height: 76px;
  }
  #question-input {
    font-size: 11px;
    padding: 9px;
  }
  .question-meta {
    flex-wrap: wrap;
    font-size: 7px;
    gap: 4px;
  }
  #incoming-question {
    padding: 10px;
    font-size: 12px;
  }
  .response-hint {
    font-size: 9px;
  }
  .response-buttons {
    gap: 5px;
  }
  .response-buttons button {
    font-size: 10px;
    padding: 9px 5px;
  }
  .response-buttons .icon {
    width: 13px;
    height: 13px;
  }
  .field-label {
    line-height: 1.6;
  }
}
@media (prefers-reduced-motion: reduce) {
  .card-leaf {
    transition: none;
  }
  .question-wait .live-dot {
    animation: none;
  }
}
.waiting-question {
  padding: 12px;
  border: 1px solid #e2e8d6;
  background: #f3f5eb;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.portrait-modal {
  width: 570px;
  text-align: center;
}
.portrait-modal > img {
  width: 100%;
  max-height: 60dvh;
  object-fit: contain;
  border-radius: 10px;
  background: #edf0e4;
}
.portrait-modal > p {
  margin: 16px 0 0;
  font-size: 11px;
}
.secret-portrait {
  padding: 0;
}
.secret-portrait:not(:disabled):hover {
  box-shadow:
    0 2px 0 #bd9e3d,
    0 0 0 3px #ddcc86;
}
