:root {
  --bb-green: #a8f5bc;
  --bb-gold: #ffe082;
  --bb-blue: #a8d8ff;
  --bb-ink: #f5fff7;
  --bb-muted: #c6d8ca;
  --bb-panel: rgba(255, 255, 255, .075);
  --bb-line: rgba(255, 255, 255, .14);
}

body { overflow: hidden; }
.game-shell { width: min(1180px, calc(100vw - 24px)); height: min(760px, calc(100dvh - 24px)); max-height: 760px; padding: 0; }
.screen { position: relative; border-radius: 30px; }
.menu-screen { display: grid; place-items: stretch; padding: 22px; overflow: hidden; }
.lobby-card { min-height: 0; display: grid; grid-template-rows: auto 1fr auto; gap: 16px; }
.lobby-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 22px 24px; border: 1px solid var(--bb-line); border-radius: 26px; background: radial-gradient(circle at 15% 20%, rgba(168,245,188,.16), transparent 34%), linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.045)); }
.lobby-head h1 { margin: 0; font-size: clamp(42px, 6vw, 74px); line-height: .92; letter-spacing: -.06em; }
.lobby-head .lead { margin-top: 10px; max-width: 680px; font-size: clamp(16px, 2vw, 21px); color: #dff0e2; }
.start-main { min-width: 160px; min-height: 56px; font-size: 18px; }
.lobby-grid { min-height: 0; display: grid; grid-template-columns: 1.1fr .9fr .9fr; gap: 14px; }
.setting-card { min-height: 0; padding: 18px; border: 1px solid var(--bb-line); border-radius: 24px; background: linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.038)); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); display: grid; align-content: start; gap: 12px; }
.setting-title { display: flex; align-items: center; gap: 9px; margin-bottom: 2px; color: var(--bb-ink); }
.setting-title span { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; background: rgba(168,245,188,.16); border: 1px solid rgba(168,245,188,.38); color: var(--bb-green); font-weight: 1000; font-size: 13px; }
.setting-title strong { font-size: 18px; }
.mode-box, .pitcher-box, .difficulty-box { display: grid; gap: 10px; margin: 0; }
.mode-box, .difficulty-box { grid-template-columns: 1fr; }
.pitcher-box { grid-template-columns: 1fr 1fr; }
.mode-option, .pitcher-option, .difficulty { min-height: 64px; text-align: left; border: 1px solid var(--bb-line); border-radius: 18px; background: var(--bb-panel); color: var(--bb-ink); padding: 12px 13px; cursor: pointer; transition: transform .12s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease; }
.mode-option:hover, .pitcher-option:hover, .difficulty:hover { transform: translateY(-1px); border-color: rgba(168,245,188,.45); }
.mode-option b, .pitcher-option b, .difficulty b { display: block; margin-bottom: 4px; font-size: 16px; line-height: 1.1; }
.mode-option em, .pitcher-option em, .difficulty em { display: block; color: var(--bb-muted); font-style: normal; font-size: 12.5px; line-height: 1.3; }
.mode-option.selected, .pitcher-option.selected, .difficulty.selected { border-color: var(--bb-green); background: rgba(104, 211, 145, .18); box-shadow: 0 0 0 3px rgba(168,245,188,.10); }
.pitcher-section.muted-section { opacity: .45; }
.pitcher-box.disabled { pointer-events: none; }
.lobby-help { min-height: 50px; padding: 12px 16px; border: 1px solid rgba(255,255,255,.10); border-radius: 18px; background: rgba(0,0,0,.18); display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; color: #dceee0; }
.lobby-help span { padding: 7px 11px; border-radius: 999px; background: rgba(168,245,188,.10); border: 1px solid rgba(168,245,188,.18); font-size: 13px; font-weight: 900; }
.hud { display: grid; grid-template-columns: repeat(6, minmax(82px, 1fr)) auto; align-items: stretch; }
.hud > div, .hud > div.compact { min-width: 0; }
.hud strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud .ghost-btn { margin-left: 0; height: 100%; }
.duel-panel { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 18px; background: rgba(3, 10, 6, .76); backdrop-filter: blur(10px); border-radius: 24px; }
.duel-card { width: min(520px, 96%); padding: 24px; border-radius: 24px; border: 1px solid rgba(255,255,255,.18); background: linear-gradient(180deg, rgba(12,31,21,.97), rgba(5,15,11,.98)); box-shadow: 0 24px 70px rgba(0,0,0,.45); }
.duel-card h2 { margin: 0 0 8px; font-size: clamp(28px, 7vw, 48px); letter-spacing: -.04em; }
.duel-card p { margin: 0 0 16px; color: #cfe3d3; line-height: 1.55; }
.duel-pitches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.duel-pitches button { border: 1px solid rgba(255,255,255,.15); border-radius: 16px; padding: 15px 12px; background: rgba(255,255,255,.08); color: #f6fff7; font-weight: 1000; cursor: pointer; }
.keyboard-hint { margin-top: 12px; color: #aebfaf; font-size: 13px; }
.result-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.result-actions .share-btn { background: linear-gradient(135deg, var(--bb-blue), var(--bb-green)); color: #06120d; }
.pitch-row { grid-template-columns: 1fr auto auto; }
.feedback { min-width: min(320px, 78%); }
@media (max-width: 980px) {
  body { overflow: auto; }
  .game-shell { width: min(100vw - 14px, 1180px); height: auto; min-height: calc(100dvh - 14px); max-height: none; padding: 0; }
  .menu-screen { overflow: auto; padding: 12px; }
  .lobby-grid { grid-template-columns: 1fr; }
  .lobby-head { grid-template-columns: 1fr; }
  .start-main { width: 100%; }
  .hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hud .ghost-btn { grid-column: 1 / -1; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .pitcher-box, .duel-pitches { grid-template-columns: 1fr; }
  .lobby-head, .setting-card { border-radius: 22px; padding: 16px; }
  .lobby-head h1 { font-size: 46px; }
}
