/* Game page layout v2 — matches layout-preview structure; uses site.css tokens */

.game-page--layout-v2 {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.game-page--layout-v2 .game-header {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1.25rem;
}

.game-page--layout-v2 .game-header__brand {
  justify-self: start;
}

.game-page--layout-v2 .game-header__brand h1 {
  font-size: 1.2rem;
}

.game-page--layout-v2 .game-header__tagline {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border: 1px solid #d8cbb8;
  border-radius: 4px;
}

.game-page--layout-v2 .game-header__center {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  min-width: 0;
}

.game-page--layout-v2 .game-header__character {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background-color: var(--color-bg-panel);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  vertical-align: middle;
}

.game-page--layout-v2 .game-header__character:hover {
  border-color: var(--color-accent, #5b3a8a);
  box-shadow: 0 0 0 1px rgba(91, 58, 138, 0.25);
}

.game-page--layout-v2 .game-header__character:focus-visible {
  outline: 2px solid var(--color-accent, #5b3a8a);
  outline-offset: 2px;
}

.game-page--layout-v2 .character-info-modal__portrait {
  width: 120px;
  height: 120px;
  margin: 0 auto 0.75rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-page--layout-v2 .character-info-modal__initial {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.game-page--layout-v2 .character-info-modal__portrait--has-image .character-info-modal__initial {
  display: none;
}

.game-page--layout-v2 .character-info-modal__name {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  color: #1f1728;
}

.game-page--layout-v2 .character-info-modal__power {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #2a2035;
  font-weight: 600;
  text-align: left;
}

.game-message-modal__card--character {
  max-width: min(96vw, 26rem);
  width: min(96vw, 26rem);
  background: linear-gradient(
    180deg,
    rgba(255, 251, 244, 0.96) 0%,
    rgba(236, 226, 209, 0.98) 100%
  );
  border: 1px solid #a89888;
  text-align: left;
}

.game-message-modal__card--character .game-message-modal__title,
.game-message-modal__card--character .game-message-modal__body,
.game-message-modal__card--character .character-info-modal__name,
.game-message-modal__card--character .character-info-modal__power {
  color: #1f1728 !important;
  text-shadow: none;
}

.game-message-modal__card--character .game-message-modal__body {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.game-message-modal__card--character .game-message-modal__actions {
  justify-content: center;
  margin-top: 0.5rem;
}

.game-page--layout-v2 .game-header__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  justify-self: end;
  align-items: center;
  gap: 0.4rem;
}

.game-page--layout-v2 .game-header__nav .btn {
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
}

.game-page--layout-v2 #turn-banner {
  display: inline-block;
  margin: 0;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

.game-page--layout-v2 .game-main {
  grid-template-columns: 1fr 280px;
  align-items: stretch;
  padding: 1rem 1.25rem;
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 900px) {
  .game-page--layout-v2 .game-header {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .game-page--layout-v2 .game-header__center {
    justify-self: start;
    align-items: flex-start;
  }

  .game-page--layout-v2 .game-header__nav {
    justify-self: stretch;
    justify-content: flex-start;
  }

  .game-page--layout-v2 #turn-banner {
    text-align: left;
  }

  .game-page--layout-v2 .game-main {
    grid-template-columns: 1fr;
  }

  .game-page--layout-v2 .game-footer {
    grid-template-columns: 1fr;
  }
}

.game-page--layout-v2 .board-panel {
  padding: 5px;
  min-height: 420px;
  height: 100%;
  container-type: size;
  align-items: center;
  justify-content: center;
}

.game-page--layout-v2 #idPlayArea01 {
  width: min(100cqw, 100cqh);
  aspect-ratio: 1;
  height: auto;
  max-width: none;
  min-height: 0;
  margin: 0;
  flex-shrink: 0;
  overflow: hidden;
}

/* Spare / bank tiles are shown in the footer tray only */
.game-page--layout-v2 #idPlayArea01 .clsPrivateAreaPlayers,
.game-page--layout-v2 #idPlayArea01 .clsDice {
  display: none !important;
}

.game-page--layout-v2 .game-sidebar {
  gap: 0.6rem;
  min-height: 0;
  overflow-y: auto;
}

.game-page--layout-v2 .game-sidebar .panel {
  padding: 0.65rem 0.85rem;
}

.game-page--layout-v2 .game-sidebar .panel__title {
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
}

.game-page--layout-v2 .stat-list__row {
  padding: 0.2rem 0;
  font-size: 0.85rem;
}

.game-page--layout-v2 .panel--log {
  flex: 1;
  min-height: 5rem;
}

.game-page--layout-v2 #dice-panel.dice-panel {
  text-align: center;
}

.game-page--layout-v2 #dice-panel .dice-display-row {
  margin: 0.25rem 0;
}

.game-page--layout-v2 #dice-panel .dice-display {
  width: 3.75rem;
  height: 3.75rem;
}

.game-page--layout-v2 #dice-panel .dice-display__value {
  font-size: 1.65rem;
}

.game-page--layout-v2 .game-log {
  font-size: 0.85rem;
  min-height: 0;
}

/* Footer trays (layout-preview-style) */
.game-page--layout-v2 .game-footer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(144px, 1.4fr) minmax(187px, 1.67fr) minmax(200px, 1.8fr);
  gap: 0.75rem;
  padding: 0 1.25rem 1rem;
  align-items: stretch;
  flex-shrink: 0;
}

.game-page--layout-v2 .panel--footer-tray {
  min-height: 88px;
  margin: 0;
}

.game-page--layout-v2 .panel--footer-tiles {
  max-width: 280px;
  height: 176px;
  min-height: 176px;
}

/* Goal + gear trays: container_back.png (centered, scales with panel) + fog wash */
.game-page--layout-v2 .panel--footer-cards,
.game-page--layout-v2 .panel--footer-gear {
  position: relative;
  overflow: hidden;
  background: transparent;
  --card-container-bg: url("/img/treasure_adventure_cards/container_back.png");
}

.game-page--layout-v2 .panel--footer-cards::before,
.game-page--layout-v2 .panel--footer-gear::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--card-container-bg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.game-page--layout-v2 .panel--footer-cards::after,
.game-page--layout-v2 .panel--footer-gear::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 85% 75% at 50% 42%,
      rgba(255, 252, 246, 0.12) 0%,
      rgba(238, 228, 212, 0.42) 55%,
      rgba(210, 198, 180, 0.62) 100%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.22) 0%,
      rgba(225, 215, 200, 0.38) 45%,
      rgba(195, 185, 168, 0.52) 100%
    );
}

.game-page--layout-v2 .panel--footer-cards > *,
.game-page--layout-v2 .panel--footer-gear > * {
  position: relative;
  z-index: 2;
}

.game-page--layout-v2 .panel--footer-cards {
  min-height: 75px;
}

.game-page--layout-v2 .panel--footer-gear {
  max-width: 400px;
  min-height: 176px;
  padding: 0.4rem 0.5rem;
}

.game-page--layout-v2 .panel--footer-gear .panel__title {
  margin-bottom: 0.3rem;
  font-size: 0.68rem;
}

.panel__title--sub {
  margin-top: 0.35rem;
  margin-bottom: 0.25rem;
  font-size: 0.68rem;
}

.treasure-deck-slot {
  display: flex;
  justify-content: center;
  min-height: 88px;
  margin-bottom: 0.25rem;
}

.treasure-card-stack {
  position: relative;
  width: 56px;
  height: 80px;
  flex-shrink: 0;
}

.treasure-card-stack .treasure-card {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
}

.treasure-card--face-down {
  background-color: #e8dcc8;
}

.treasure-card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: flex-start;
}

.treasure-card-row--gear {
  justify-content: center;
  min-height: 88px;
}

.treasure-card {
  flex-shrink: 0;
  width: 52px;
  height: 72px;
  border-radius: 4px;
  border: 1px solid #a89888;
  background-color: #f5f0e8;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 1px 4px rgba(42, 32, 53, 0.25);
}

.treasure-card--interactive {
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.treasure-card--interactive:hover,
.treasure-card--interactive:focus-visible {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 14px rgba(42, 32, 53, 0.35);
  outline: 2px solid rgba(107, 77, 138, 0.7);
  outline-offset: 2px;
}

.treasure-goal-slot {
  display: flex;
  justify-content: center;
  min-height: 80px;
}

.treasure-goal-slot .treasure-card--goal {
  width: 64px;
  height: 88px;
}

.treasure-goal-slot--modal {
  margin: 0.5rem 0 0.75rem;
  min-height: 0;
}

.treasure-goal-slot--modal .treasure-card--goal:not(#treasure-card-modal-art) {
  width: 88px;
  height: 120px;
}

.treasure-goal-name {
  margin: 0 0 0.5rem;
  font-weight: 700;
  text-align: center;
  color: #3d3048;
}

.treasure-goal-hint {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
}

.game-message-modal__card--treasure {
  max-width: min(96vw, 26rem);
  width: min(96vw, 26rem);
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(
      180deg,
      rgba(255, 251, 244, 0.84) 0%,
      rgba(236, 226, 209, 0.86) 100%
    ),
    url("/img/treasure_adventure_cards/container_back.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.game-message-modal__card--treasure > * {
  position: relative;
  z-index: 1;
}

.game-message-modal__card--treasure .game-message-modal__title,
.game-message-modal__card--treasure .game-message-modal__body,
.game-message-modal__card--treasure .treasure-goal-name,
.game-message-modal__card--treasure p,
.game-message-modal__card--treasure span,
.game-message-modal__card--treasure label {
  color: #1f1728 !important;
  text-shadow: none;
}

.game-message-modal__card--treasure .btn {
  color: #1f1728;
}

#treasure-card-modal-art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(88vw, 20rem);
  max-width: 100%;
  min-height: 14rem;
  max-height: min(72vh, 28rem);
  margin: 0 auto;
  background-color: #f5f0e8;
  border: 1px solid #a89888;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(42, 32, 53, 0.28);
  overflow: hidden;
}

#treasure-card-modal-art .treasure-card-modal__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(72vh, 28rem);
  object-fit: contain;
}

#treasure-card-modal .treasure-goal-slot--modal {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

#treasure-card-modal .treasure-goal-name {
  font-size: 1rem;
}

#treasure-card-modal .game-message-modal__body {
  font-size: 0.85rem;
  max-width: 20rem;
  margin-left: auto;
  margin-right: auto;
}

.game-page--layout-v2 .setup-bank-tiles {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  align-content: flex-start;
  gap: 0.35rem;
  max-height: calc(176px - 1.75rem);
  overflow-x: hidden;
  overflow-y: auto;
}

.game-page--layout-v2 .setup-bank-tiles .setup-tile-pick {
  width: 44px;
  height: 44px;
}

.game-page--layout-v2 #footer-tiles-panel {
  display: none;
}

.game-page--layout-v2 #footer-tiles-panel.footer-tiles-panel--visible {
  display: block;
}

.setup-tile-pick--held {
  cursor: default;
  border: none;
  padding: 0;
  background: transparent;
}

.footer-held-tile-hint {
  flex: 1 1 100%;
  margin: 0.2rem 0 0;
  font-size: 0.68rem;
}

.game-page--layout-v2 .game-footer__placeholder {
  margin: 0;
  font-size: 0.75rem;
}

.game-page--layout-v2 .game-footer__hard-reset {
  position: absolute;
  right: 1.25rem;
  bottom: 1rem;
  z-index: 1;
}
