/* Presentation layer. Existing map, wallet and game controllers own their DOM. */
.play-page .hex-cell.is-pending .hex-shape{stroke:var(--game-gold);stroke-width:3;stroke-dasharray:5 3;opacity:.7}
.play-page {
  --panel-gap: 20px;
  --panel-space: 24px;
  font-size: 16px;
  background: var(--page-background);
}
.play-page .game-shell { width: min(1560px, calc(100% - 64px)); }
.play-page .panel { border-color: var(--border); box-shadow: 0 12px 35px #09050d16; }
.play-page .game-header { min-height: 112px; }
.play-page .game-title h1 { font-size: clamp(19px, 2vw, 26px); }
.play-page .game-header nav { gap: 24px; font-size: 14px; }
.play-page .game-header nav a { display: inline-flex; align-items: center; min-height: 44px; }
.play-page button, .play-page summary, .play-page input, .play-page select { min-height: 44px; }
.play-page button:focus-visible, .play-page a:focus-visible,
.play-page summary:focus-visible, .play-page textarea:focus-visible { outline:3px solid var(--color-focus); outline-offset: 4px; }
.play-page .eyebrow { font-size: 11px; letter-spacing: .14em; }
.play-page .small-copy, .play-page .empty-copy { font-size: 14px; line-height: 1.65; }
.play-page .text-button { font-size: 14px; min-height: 44px; }
.play-page .gold-button, .play-page .wallet-button, .play-page .action-row button { font-size: 16px!important; min-height: 48px; }
.play-page label, .play-page legend { font-size: 16px; }
.play-page .season-strip { padding-block: 24px 12px; gap: 16px 24px; }
.play-page .season-ident { flex-wrap: wrap; gap: 8px 12px; }
.play-page .season-ident strong { font-size: 15px; }
.play-page .season-ident > span:last-child, .play-page .test-label { font-size: 12px; }
.play-page .season-clock > span { font-size: 11px; }
.play-page .season-clock strong { font-size: 23px; font-variant-numeric: tabular-nums; }
.play-page .connection-bar { font-size: 13px; margin-bottom: 20px; }
.play-page .connection-bar .text-button { font-size: 14px; }
.play-page .clan-standings > .empty-copy { grid-column: 1 / -1; }
.play-page #economy { margin-top: var(--panel-gap); padding: var(--panel-space); }
.play-page #legacy-economy .economy-screen { margin-block: 28px; }
.play-page .clan-standings { gap: 16px; margin-bottom: 20px; }
.play-page .clan-card { padding: 18px 20px; background: var(--panel-background); }
.play-page .clan-card h3 { font-size: 21px; }
.play-page .clan-subline, .play-page .clan-score > span { font-size: 12px; }
.play-page .clan-score strong { font-size: 30px; }
.play-page .clan-rank { font-size: 11px; }
.play-page .you-tag { font-size: 9px; }
.play-page .game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  grid-template-areas: "battlefield player" "battlefield controls" "chat chat";
  grid-template-rows: auto 1fr auto;
  align-items: start;
  gap: 20px;
}
.play-page .game-layout > .player-panel { grid-area: player; width: auto; }
.play-page .game-layout > .player-sidebar { grid-area: controls; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.play-page .game-layout > .battlefield { grid-area: battlefield; display: flex; flex-direction: column; min-height: 0; align-self: start; }
.play-page .game-layout > .chat-panel { grid-area: chat; display: block; margin: 0; padding: 0; }
/* A definite viewport keeps the SVG's intrinsic ratio out of flex row sizing. */
.play-page .game-layout > .battlefield .map-viewport { flex: none; height: clamp(280px, 40svh, 520px); min-height: 0; max-height: calc(100svh - 120px); }
.play-page .map-viewport > svg#game-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.play-page .map-heading { padding: 26px 28px 12px; }
.play-page .map-heading h2 { font-size: clamp(23px, 2.1vw, 31px); line-height: 1.3; }
.play-page .map-count { font-size: 13px; }
.ui-map-goal { padding: 0 28px 20px; font-size: 16px; color: #e6d7ef; max-width: 680px; }
.ui-guide-entry { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 28px 12px; padding: 14px 16px; background: #d9b27909; border: 1px solid #ae895047; border-radius:var(--radius-panel); }
.ui-guide-entry > div { min-width: 0; }
.ui-guide-entry .eyebrow { color: var(--game-gold); margin-bottom: 4px; }
.ui-guide-entry p { font-size: 14px; line-height: 1.5; color: var(--soft); }
.ui-guide-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 44px; flex: none; color: var(--game-gold); font-size: 14px; }
.play-page .map-controls { bottom: 20px; right: 20px; }
.play-page .map-controls button { width: 46px; min-height: 46px; }
.play-page .map-footer { gap: 14px; padding: 20px 28px; border-top: 1px solid #a489b51c; }
.play-page .map-legend { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.play-page .map-legend > span, .play-page #map-help { font-size: 13px; line-height: 1.6; }
.play-page .hex-cell[data-ui-guide-target=true] .hex-shape { stroke: #fff4b9; stroke-width: 3.6; stroke-dasharray: 4 2; filter: drop-shadow(0 0 5px #f0d299a0); }
.play-page .hex-cell[data-ui-guide-target=true]:focus-visible .hex-shape { stroke: #fff; stroke-width: 4.5; }
.play-page .player-heading h2 { font-size: 21px; }
.play-page .player-heading .eyebrow { font-size: 10px; }
.play-page .player-heading { margin-bottom: 20px; }
.ui-wallet-chooser { margin-bottom: 12px; border: 1px solid var(--gold-line); border-radius:var(--radius-panel); background: #34243f; }
.ui-wallet-chooser:has(#wallet-form[hidden]) { display: none; }
.ui-wallet-chooser summary { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; list-style: none; font-weight: 650; color: var(--game-gold); cursor: pointer; }
.ui-wallet-chooser summary::-webkit-details-marker { display: none; }
.ui-wallet-chooser[open] summary { border-bottom: 1px solid var(--border); }
.ui-wallet-chooser #wallet-form, .ui-wallet-chooser #wallet-note { margin: 16px; }
.play-page .ui-wallet-chooser #wallet-note { font-size: 14px; }
.ui-feature-note { padding-top: 8px; color: var(--soft); }
.play-page .player-panel:has(#player-stats:not([hidden])) .ui-feature-note { display: none; }
.play-page .wallet-address { font-size: 14px; }
.play-page .clan-option { min-height: 72px; padding: 14px; }
.play-page .clan-option > span { font-size: 16px; }
.play-page .clan-option small { font-size: 12px; }
.play-page .clan-option input { min-height: 0; height: 20px; width: 20px; }
.play-page .player-clan { font-size: 15px; }
.play-page .energy-heading > span { font-size: 12px; }
.play-page .energy-heading strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.play-page .energy-meter { gap: 5px; margin-block: 10px; }
.play-page .energy-pip { height: 10px; }
.play-page .energy-timer { font-size: 14px; line-height: 1.6; }
.play-page .personal-stats dt { font-size: 12px; }
.play-page .personal-stats dd { font-size: 26px; font-variant-numeric: tabular-nums; }
.play-page .cell-panel { display: block; }
.play-page .cell-panel h2 { font-size: 26px; }
.play-page .cell-coordinates, .play-page .cell-details, .play-page .cell-yield { font-size: 14px; }
.play-page .cell-details { gap: 8px; }
.play-page .cell-yield { margin-top: 10px!important; }
.play-page .cell-panel .action-list { padding-top: 0; margin-top: 22px; gap: 16px; }
.play-page .action-row p { font-size: 14px; line-height: 1.55; margin-top: 7px; }
.play-page .energy-cost { font-size: 14px; }
.play-page .action-feedback, .play-page .form-error { font-size: 14px; }
.ui-chat-disclosure > summary { min-height: 72px; display: flex; gap: 20px; align-items: center; padding: 16px 24px; cursor: pointer; list-style: none; }
.ui-chat-disclosure > summary::-webkit-details-marker { display: none; }
.ui-chat-summary-title { font: 500 20px/1.4 var(--serif); }
.ui-chat-summary-copy { color: var(--soft); font-size: 14px; }
.ui-chat-chevron { color: var(--game-gold); font-size: 26px; line-height: 1; margin-left: auto; transition: transform .15s; }
.ui-chat-disclosure[open] .ui-chat-chevron { transform: rotate(180deg); }
.ui-chat-disclosure[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.play-page .ui-chat-disclosure > .panel-heading, .play-page .ui-chat-disclosure > #chat-room { margin-inline: 24px; }
.play-page .ui-chat-disclosure > .panel-heading { align-items: flex-start; }
.play-page .ui-chat-disclosure > #chat-room { display: block; padding-bottom: 24px; }
.play-page .game-layout > .chat-panel .chat-tabs { max-width: 360px; }
.play-page .game-layout > .chat-panel .chat-tabs button { font-size: 16px; }
.play-page .game-layout > .chat-panel .chat-messages { height: 280px; min-height: 160px; }
.play-page .chat-access, .play-page .chat-message p, .play-page .chat-panel label { font-size: 16px; }
.play-page .game-layout > .chat-panel #chat-keys, .play-page .game-layout > .chat-panel .chat-cooldown, .play-page .game-layout > .chat-panel .chat-feedback { font-size: 13px; }
.play-page .below-map { margin-top: 20px; }
.play-page .rules-list { gap: 20px; }
.play-page .rules-list b, .play-page .rules-list span, .play-page .event-copy p { font-size: 16px; }
.play-page .rules-list::before, .play-page .event-feed time, .play-page .event-copy span { font-size: 12px; }
.play-page .rewards-note, .play-page .history-row p { font-size: 14px; }
.play-page .history-row small, .play-page .quiet-badge { font-size: 12px; }
.play-page .game-footer { font-size: 13px; padding-block: 32px; }
.play-page .ui-guide-dialog { width: min(620px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 28px; background: var(--panel-background); color: var(--text); border: 1px solid var(--gold-line); border-radius:var(--radius-panel); box-shadow: var(--shadow-dialog); overflow: auto; overscroll-behavior: contain; }
.ui-guide-dialog::backdrop { background: #100919d9; backdrop-filter: blur(4px); }
.ui-guide-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.play-page .ui-guide-close { flex: none; padding: 8px 12px; color: var(--game-gold); border: 1px solid var(--border); background: #ffffff05; font-size: 14px; }
.play-page .ui-guide-dialog h2 { font-size: clamp(25px, 5vw, 34px); line-height: 1.25; margin-bottom: 12px; }
.ui-guide-intro { font-size: 18px; color: #eee0d1; line-height: 1.6; }
.ui-guide-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; counter-reset: guide; padding: 0; margin: 24px 0; border-block: 1px solid var(--border); }
.ui-guide-steps li { counter-increment: guide; padding: 14px 10px; color: var(--soft); font-size: 12px; border-right: 1px solid var(--border); }
.ui-guide-steps li:last-child { border: 0; }
.ui-guide-steps li::before { content: '0' counter(guide); display: block; font-size: 16px; color: #bfa2d0; margin-bottom: 8px; }
.ui-guide-steps li[aria-current=step] { background: #e4c08812; color: var(--game-gold); }
.ui-guide-steps li[aria-current=step]::before { color: var(--game-gold); }
.ui-guide-message { font-size: 14px; line-height: 1.6; padding: 12px 14px; border: 1px solid var(--border); border-radius:var(--radius-panel); color: var(--soft); }
.ui-guide-explanation { font-size: 16px; line-height: 1.65; margin-top: 18px!important; }
.ui-guide-context { display: grid; gap: 10px; margin-top: 18px; font-size: 16px; }
.ui-guide-context:empty { display: none; }
.ui-guide-cost { font-size: 23px; color: var(--game-gold); }
.ui-guide-gas, .ui-guide-safety { font-size: 14px; line-height: 1.65; color: var(--soft); }
.ui-guide-safety { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 20px!important; }
.ui-guide-faction { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; border: 1px solid var(--border); border-radius:var(--radius-panel); padding: 12px 14px; background: #0d081424; }
.ui-guide-faction > span { font-size: 14px; color: var(--soft); }
.ui-guide-faction-state { grid-column: 1 / -1; }
.ui-guide-faction[data-faction=zeus] strong { color: var(--zeus); }
.ui-guide-faction[data-faction=hades] strong { color: var(--hades); }
.ui-guide-faction[data-faction=momus] strong { color: var(--momus); }
.ui-guide-controls { display: flex; align-items: center; gap: 20px; margin-top: 24px; }
.ui-guide-controls .gold-button { flex: 1; }
.ui-guide-controls .text-button { flex: none; min-width: 60px; }
@media (min-width: 1600px) { .play-page .game-layout { grid-template-columns: minmax(0, 1fr) 360px; } }
@media (max-width: 1100px) {
  .play-page .game-shell { width: calc(100% - 40px); }
  .play-page .game-header { flex-wrap: wrap; gap: 12px 24px; padding-block: 18px; }
  .play-page .game-header nav { width: 100%; justify-content: space-between; margin: 0; }
  .play-page .game-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
  .play-page .map-heading, .play-page .map-footer { padding-inline: 20px; }
  .ui-map-goal { padding-inline: 20px; }
  .ui-guide-entry { margin-inline: 20px; flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 899px) {
  .play-page { --panel-space: 20px; --panel-gap: 16px; }
  .play-page .game-layout { display: flex; gap: 16px; }
  .play-page .game-layout > .player-panel { order: 0; width: 100%; }
  .play-page .game-layout > .player-sidebar { display: contents; }
  .play-page .game-layout > .battlefield { order: 1; min-height: 0; width: 100%; }
  .play-page .game-layout > .player-sidebar > .cell-panel { order: 2; width: 100%; }
  .play-page .game-layout > .player-sidebar > .achievement-panel { order: 3; width: 100%; }
  .play-page .game-layout > .chat-panel { order: 4; width: 100%; }
  .play-page .game-layout > .battlefield .map-viewport { height: clamp(280px, min(83vw, 55svh), 500px); }
  .play-page .player-panel:has(#player-stats:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 28px; }
  .play-page .player-panel:has(#player-stats:not([hidden])) .player-heading { margin: 0; }
  .play-page .player-panel:has(#player-stats:not([hidden])) #player-stats { grid-column: 2; grid-row: 1 / span 4; }
  .play-page .player-panel:has(#player-stats:not([hidden])) #wallet-session { grid-column: 1; margin: 0; flex-wrap: wrap; }
  .play-page .player-panel:has(#player-stats:not([hidden])) #wallet-status { grid-column: 1; }
  .play-page .clan-standings { gap: 10px; }
  .play-page .clan-card { padding: 14px; }
  .play-page .action-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .play-page .action-row { display: block; }
}
@media (max-width: 600px) {
  .play-page .game-shell { width: calc(100% - 24px); }
  .play-page .game-header { min-height: 0; padding-top: 20px; gap: 12px 16px; }
  .play-page .game-brand { font-size: 23px; }
  .play-page .game-title { padding-left: 16px; }
  .play-page .game-title h1 { font-size: 18px; }
  .play-page .game-title .eyebrow { font-size: 8px; }
  .play-page .game-header nav { gap: 8px; font-size: 13px; flex-wrap: wrap; }
  .play-page .season-strip { gap: 10px; padding-top: 20px; }
  .play-page .season-ident { width: 100%; }
  .play-page .season-ident > span:last-child { display: block; font-size: 12px; }
  .play-page .season-clock { margin-left: 0; }
  .play-page .season-clock > span { display: block; font-size: 10px; }
  .play-page .season-clock strong { font-size: 21px; }
  .play-page .test-label { margin-left: 0; font-size: 11px; }
  .play-page .connection-bar { margin-bottom: 16px; font-size: 12px; }
  .play-page .clan-standings { gap: 8px; margin-bottom: 16px; }
  .play-page .clan-card { padding: 12px 9px; gap: 7px; }
  .play-page .clan-card h3 { font-size: 16px; }
  .play-page .clan-emblem { width: 30px; height: 30px; }
  .play-page .clan-subline { font-size: 11px; line-height: 1.6; }
  .play-page .clan-score strong { font-size: 23px; }
  .play-page .clan-score > span, .play-page .clan-rank { font-size: 10px; }
  .play-page .you-tag { display: inline-block; font-size: 8px; margin-left: 0; }
  .play-page .player-panel { padding: 16px; }
  .play-page .player-heading { margin-bottom: 14px; }
  .play-page .player-heading .eyebrow { display: none; }
  .play-page .player-heading h2 { font-size: 20px; }
  .play-page .player-panel:has(#player-stats:not([hidden])) { display: block; }
  .play-page .player-panel:has(#player-stats:not([hidden])) .player-heading { margin-bottom: 12px; }
  .play-page .player-panel:has(#player-stats:not([hidden])) #wallet-session { margin-bottom: 16px; }
  .play-page .personal-stats { gap: 12px; margin-top: 14px; padding-top: 12px; }
  .play-page .personal-stats dd { font-size: 22px; }
  .play-page .clan-options { grid-template-columns: 1fr; }
  .play-page .clan-option { flex-direction: row; align-items: center; gap: 12px; }
  .play-page .clan-option input { position: static; }
  .play-page .map-heading { padding: 20px 16px 10px; }
  .play-page .map-heading h2 { font-size: 23px; }
  .play-page .map-count { font-size: 12px; }
  .ui-map-goal { padding: 0 16px 16px; line-height: 1.65; }
  .ui-guide-entry { margin: 0 16px 8px; padding: 12px; }
  .ui-guide-link { width: 100%; }
  .play-page .map-footer { padding: 16px; }
  .play-page .map-legend { gap: 10px 16px; }
  .play-page .map-legend > span, .play-page #map-help { font-size: 12px; }
  .play-page .map-controls { gap: 4px; right: 12px; bottom: 12px; }
  .play-page .action-list { grid-template-columns: 1fr; }
  .play-page .action-row { display: grid; grid-template-columns: 142px minmax(0, 1fr); gap: 12px; align-items: center; }
  .play-page .action-row button { padding: 10px; }
  .play-page .action-row p { margin: 0; font-size: 13px; }
  .ui-chat-disclosure > summary { padding: 16px; flex-wrap: wrap; gap: 4px 12px; }
  .ui-chat-summary-title { font-size: 18px; }
  .ui-chat-summary-copy { font-size: 13px; }
  .play-page .ui-chat-disclosure > .panel-heading, .play-page .ui-chat-disclosure > #chat-room { margin-inline: 16px; }
  .play-page .ui-guide-dialog { padding: 20px; max-height: calc(100dvh - 24px); }
  .ui-guide-header { gap: 12px; }
  .ui-guide-header .eyebrow { font-size: 9px; }
  .ui-guide-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ui-guide-steps li { border-bottom: 1px solid var(--border); }
  .ui-guide-steps li:nth-child(2) { border-right: 0; }
  .ui-guide-steps li:nth-child(3) { border-bottom: 0; }
  .ui-guide-faction { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .play-page .ui-chat-chevron { transition: none; }
  .play-page *, .play-page *::before, .play-page *::after { scroll-behavior: auto!important; animation: none!important; transition: none!important; }
}
