/* Shared game materials reuse the home/profile palette, including the saved theme. */
.game-surface {
  --ink: var(--profile-ink);
  --text: var(--profile-ink);
  --accent-dark: var(--accent-ink);
  --accent-soft: var(--profile-selected);
  --accent-line: color-mix(in srgb, var(--accent) 30%, var(--line));
  --line-strong: color-mix(in srgb, var(--muted) 38%, var(--surface));
  --game-shadow: 0 4px 12px #334d8910, 0 16px 32px #334d8906;
}
.game-surface .bunker-page.in-game {
  --page-gutter: clamp(14px, 3.9vw, 28px);
  max-width: 1100px;
  padding: max(8px, env(safe-area-inset-top))
    max(var(--page-gutter), env(safe-area-inset-right))
    calc(24px + env(safe-area-inset-bottom))
    max(var(--page-gutter), env(safe-area-inset-left));
}
.game-surface .bunker-room-bar { margin-bottom: 14px; }
.ward-game-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ward-game-list > li { min-width: 0; max-width: 100%; }
.game-surface .bunker-room-bar .button {
  min-height: 44px;
  padding: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}
.game-surface .panel {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 50%, var(--surface));
  box-shadow: var(--game-shadow);
  border-radius: 22px;
}
.game-surface .button { min-height: 48px; border-radius: 16px; font-size: 15px; }
.game-surface .button.primary {
  background: linear-gradient(115deg, #2d54ff, #1947f8);
  border: 1px solid #2851ff;
  color: #fff;
  box-shadow: 0 6px 12px #2851ff25;
}
.game-surface .button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.game-surface .button.quiet { color: var(--accent); }
.game-surface .bunker-room-bar .button.quiet { color: var(--ink); }
.game-surface .button svg { flex: none; }
.game-surface .button:disabled { cursor: default; }
.game-surface .button:focus-visible,
.game-surface summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.game-surface .eyebrow { color: var(--accent); }
.game-surface .badge { letter-spacing: 0; border-radius: 9px; color: var(--ink); }
.game-surface .badge.accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.game-surface .bunker-game-heading {
  display: flex;
  align-items: center;
  position: relative;
  min-height: 95px;
  margin: 0 7px 15px;
}
.game-surface .bunker-game-heading > div:first-child { position: relative; z-index: 1; }
.game-surface .bunker-game-heading h1 { font-size: clamp(28px, 5vw, 38px); line-height: 1.1; margin-bottom: 5px; }
.game-surface .game-round { font-size: clamp(18px, 3.5vw, 24px); font-weight: 750; line-height: 1.2; }
.game-surface .game-heading-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.game-surface .game-heading-badges .badge { font-size: 10px; min-height: 24px; padding: 4px 8px; border-color: var(--line-strong); }
.game-surface .bunker-heading-art {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 51%;
  max-width: 250px;
  aspect-ratio: 1.64;
  background: url('/game-covers.png') 0 0 / 200% 200% no-repeat;
  mask-image: radial-gradient(ellipse 68% 68% at 55% 59%, #000 40%, transparent 76%);
  pointer-events: none;
}
.game-surface .stepper { position: relative; gap: clamp(10px, 4.5vw, 26px); margin: 0 7px 13px; isolation: isolate; }
.game-surface .stepper::before { content: ''; position: absolute; z-index: -1; left: 0; right: 0; top: 50%; height: 2px; background: var(--line); }
.game-surface .stepper .step { border: 1px solid var(--line); background: var(--bg); padding: 3px; border-radius: 9px; min-width: 0; }
.game-surface .stepper .step-number { width: auto; height: auto; min-height: 21px; font-size: 13px; background: none; color: var(--muted); }
.game-surface .stepper .step.active { background: #2851ff; border-color: #2851ff; box-shadow: 0 3px 7px #2851ff35; }
.game-surface .stepper .step.active .step-number { color: #fff; }
.game-surface .stepper .step.done .step-number { color: var(--accent); }
.game-surface .compact-scenario { padding: 8px 15px; margin-bottom: 12px; }
.game-surface .compact-scenario > summary { display: flex; align-items: center; gap: 10px; font-size: 13px; min-height: 34px; list-style: none; }
.game-surface .compact-scenario > summary::-webkit-details-marker { display: none; }
.game-surface .compact-scenario > summary::before { content: '▸'; flex: none; font-size: 16px; }
.game-surface .compact-scenario[open] > summary::before { transform: rotate(90deg); }
.game-surface .scenario-symbol { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; color: #ac7119; background: linear-gradient(135deg, #fff5dc, #ffd984); }
.game-surface .compact-scenario > p { font-size: 13px; margin-top: 10px; }
.game-surface .finds-list h3 { margin: 12px 0 4px; font-size: 15px; }
.game-surface .find-status { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--ink); }
.game-surface .game-grid { gap: 18px; }
.game-surface .game-main, .game-surface .game-aside { gap: 12px; min-width: 0; }
.game-surface .phase-panel { padding: 17px; }
.game-surface .phase-panel h2 { font-size: 22px; }
.game-surface .phase-panel p { color: var(--muted); font-size: 13px; margin-top: 5px; line-height: 1.4; }
.game-surface .bunker-turn-card { margin-block: 10px; padding: 12px; border-radius: 13px; background: var(--accent-soft); overflow-wrap: anywhere; }
.game-surface .bunker-turn-card p { color: var(--ink); }
.game-surface .bunker-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.game-surface .bunker-slots:has(> :last-child:nth-child(2)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.game-surface .bunker-slots:has(> :last-child:nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.game-surface .bunker-slots:has(> :last-child:nth-child(4)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.game-surface .bunker-slots:has(> :last-child:nth-child(6)) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.game-surface .bunker-slot { flex-direction: column; gap: 3px; padding: 8px 4px; min-width: 0; min-height: 57px; background: var(--surface-2); border-color: var(--line); border-radius: 13px; font-size: 17px; }
.game-surface .bunker-slot:disabled { opacity: 1; color: var(--muted); }
.game-surface .bunker-slot-icon { height: 20px; display: grid; place-items: center; }
.game-surface .bunker-slot:not(:disabled) { color: var(--accent); border-color: var(--accent-line); }
.game-surface .hand-panel { padding: 12px 9px 10px; }
.game-surface .hand-panel .panel-head { align-items: center; margin: 0 4px 9px; gap: 5px; }
.game-surface .hand-panel .panel-head h2 { font-size: 22px; }
.game-surface .hand-panel .panel-head .button { font-size: 11px; padding: 7px 2px; margin: 0; min-height: 44px; gap: 5px; }
.game-surface .hand-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.game-surface .trait-card { border-radius: 13px; padding: 10px; min-height: 0; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 2px 4px #314c8410; }
.game-surface .trait-card.public { background: var(--accent-soft); border-color: var(--accent-line); }
.game-surface .trait-card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px; margin-bottom: 6px; }
.game-surface .trait-card-label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; letter-spacing: -.02em; }
.game-surface .trait-icon { display: grid; place-items: center; flex: none; width: 23px; height: 25px; border-radius: 7px; background: #d8e5ff; color: #2851ff; }
.game-surface .trait-icon-bio { background: #e1f5d2; color: #368514; }
.game-surface .trait-icon-health { background: #ffd5da; color: #c52b46; }
.game-surface .trait-icon-hobby { background: #e6d9ff; color: #7b38d6; }
.game-surface .trait-icon-luggage { background: #ffebbc; color: #b17216; }
.game-surface .trait-icon-fact { background: #d1f3ff; color: #008bc4; }
.game-surface .trait-visibility { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 10px; }
.game-surface .trait-card h3 { font-size: 15px; line-height: 1.22; margin-bottom: 4px; overflow-wrap: anywhere; }
.game-surface .trait-card p { font-size: 12px; line-height: 1.3; color: var(--muted); }
.game-surface .private-covered { font-size: 11px; min-height: 88px; }
.game-surface .special-panel { margin: 0; padding: 8px 16px; }
.game-surface .special-panel > summary { min-height: 44px; font-size: 15px; }
.game-surface .crew-panel { padding: 14px 10px 10px; }
.game-surface .crew-panel .panel-head { margin: 0 4px 10px; align-items: center; }
.game-surface .crew-panel h2 { font-size: 22px; }
.game-surface .crew-list { grid-template-columns: minmax(0,1fr); gap: 5px; }
.game-surface .crew-member { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.game-surface .crew-member.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface)); }
.game-surface .crew-member summary { min-height: 46px; padding: 7px 9px; gap: 12px; }
.game-surface .crew-member .avatar { width: 34px; height: 29px; border-radius: 8px; font-size: 16px; }
.game-surface .crew-member .player-name { font-size: 14px; line-height: 1.2; }
.game-surface .crew-member .player-caption { font-size: 10px; line-height: 1.2; margin-top: 2px; }
.game-surface .crew-member summary::after { font-size: 20px; width: 24px; }
@media (max-width: 760px) {
  .game-surface .game-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
@media (min-width: 761px) {
  .game-surface .bunker-game-heading { min-height: 130px; }
  .game-surface .bunker-game-heading h1 { font-size: 38px; }
  .game-surface .hand-panel { padding: 18px; }
  .game-surface .trait-card { padding: 15px; }
  .game-surface .trait-card h3 { font-size: 18px; }
  .game-surface .trait-card p { font-size: 14px; }
}
@media (max-width: 360px) {
  .game-surface .trait-card { padding: 8px; }
  .game-surface .trait-card-top { gap: 4px; }
  .game-surface .trait-visibility { margin-left: 30px; }
  .game-surface .bunker-heading-art { width: 46%; }
  .game-surface .bunker-slots { gap: 7px; }
  .game-surface .bunker-slots:has(> :last-child:nth-child(6)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-surface .hand-panel .panel-head h2 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .game-surface *, .game-surface *::before, .game-surface *::after { animation: none !important; transition: none !important; }
}
