/* テキーラ野球盤  style.css（スマホ縦向き向け） */
:root {
  --wood: #5a3418;
  --wood2: #3a2010;
  --cream: #fff4dc;
  --gold: #ffcc33;
  --red: #e2402e;
  --green: #2f9a4a;
  --ink: #1a120c;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--wood2); color: var(--cream); font-family: "Zen Kaku Gothic New", "Hiragino Sans", sans-serif; overflow: hidden; overscroll-behavior: none; }
body { user-select: none; -webkit-user-select: none; touch-action: manipulation; }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; max-width: 640px; margin: 0 auto;
  background: repeating-linear-gradient(92deg, var(--wood) 0 14px, #63391b 14px 22px, #4f2d14 22px 40px); }

/* ---------- スコアボード ---------- */
#score { display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: #0f1a12; border-bottom: 4px solid #000; box-shadow: inset 0 -2px 0 #2b3a2e; font-weight: 900; }
.inning { font-size: 20px; white-space: nowrap; color: var(--gold); }
.inning b { font-family: "Dela Gothic One", sans-serif; font-size: 28px; font-weight: normal; }
.teams { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.team { display: flex; justify-content: space-between; align-items: center; padding: 1px 8px; border-radius: 6px; font-size: 16px; }
.team .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team .pt { font-family: "Dela Gothic One", sans-serif; font-weight: normal; font-size: 22px; color: var(--gold); margin-left: 8px; }
.team.bat { background: rgba(255, 204, 51, .18); }
.team.bat .nm::before { content: "▶ "; color: var(--gold); }
.count { display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
.count div { display: flex; align-items: center; gap: 4px; }
.count i { font-style: normal; width: 12px; color: #9fb; }
.count span { display: flex; gap: 3px; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: #2a332c; border: 1px solid #000; }
.dot.b { background: #3fd46a; } .dot.s { background: #ffd23a; } .dot.o { background: #ff4b3a; }

/* ---------- 盤 ---------- */
#boardWrap { position: relative; flex: 1; min-height: 0; overflow: hidden; }
#board { position: absolute; inset: 0; display: block; touch-action: none; }
#pop {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  font-family: "Dela Gothic One", sans-serif; font-size: 54px; white-space: nowrap; pointer-events: none;
  color: #fff; -webkit-text-stroke: 3px #000; paint-order: stroke fill; text-shadow: 0 6px 0 #000;
  animation: pop .9s cubic-bezier(.2, 1.6, .4, 1);
}
#pop.hr { font-size: 64px; color: var(--gold); animation: pop .9s cubic-bezier(.2, 1.6, .4, 1), hr 0.4s steps(2) 0.9s 4; }
#pop.small { font-size: 40px; }
#pop .psub { display: block; font-size: 22px; text-align: center; -webkit-text-stroke: 2px #000; margin-top: 4px; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.2); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes hr { 50% { color: var(--red); } }

/* ---------- 操作パネル ---------- */
#ctrl { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); background: #1d120a; border-top: 4px solid #000; min-height: 130px; }
.msg { text-align: center; font-weight: 900; font-size: 17px; padding: 6px 0; }
.msg small { display: block; font-weight: 500; font-size: 13px; opacity: .75; margin-top: 2px; }
.grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
button { font: inherit; cursor: pointer; }
.pitch { border: 3px solid #000; border-radius: 12px; padding: 9px 6px; font-weight: 900; font-size: 16px; background: #f4e6c8; color: var(--ink); box-shadow: 0 4px 0 #000; }
.pitch.on { background: var(--gold); transform: translateY(2px); box-shadow: 0 2px 0 #000; }
.pitch small { display: block; font-size: 11px; font-weight: 700; opacity: .7; }
.row { display: flex; gap: 6px; margin-top: 6px; }
.magic { flex: 1; border: 3px solid #000; border-radius: 12px; padding: 9px 4px; font-weight: 900; font-size: 15px; background: #3a1f5a; color: #e8d8ff; box-shadow: 0 4px 0 #000; }
.magic.on { background: #9b4dff; color: #fff; transform: translateY(2px); box-shadow: 0 2px 0 #000; }
.magic:disabled { opacity: .35; }
.throw, .swing, .big { flex: 1.3; border: 3px solid #000; border-radius: 14px; padding: 12px 6px; font-family: "Dela Gothic One", sans-serif; font-size: 22px; background: var(--red); color: #fff; box-shadow: 0 5px 0 #000; }
.throw:active, .swing:active, .big:active { transform: translateY(3px); box-shadow: 0 2px 0 #000; }
.swing { width: 100%; font-size: 34px; padding: 22px 6px; background: #e8402e; }
.swing.done { background: #6b2a22; }
.sub { border: 3px solid #000; border-radius: 12px; padding: 10px; font-weight: 900; background: #f4e6c8; color: var(--ink); box-shadow: 0 4px 0 #000; }

/* ---------- ロビー ---------- */
#lobby { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 24px;
  background: radial-gradient(ellipse at 50% 30%, #6a3b18, #24130a 75%); }
.logo { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 8px; }
.logo h1 { margin: 0; font-family: "Dela Gothic One", sans-serif; font-weight: normal; font-size: 46px; line-height: 1.05; color: var(--gold);
  -webkit-text-stroke: 2px #000; paint-order: stroke fill; text-shadow: 0 5px 0 #000; }
.logo .glass { width: 64px; height: 76px; border: 4px solid #e8f4ff; border-top-width: 2px; border-radius: 4px 4px 14px 14px;
  background: linear-gradient(transparent 22%, rgba(255, 200, 60, .9) 22%); box-shadow: inset 0 -10px 0 rgba(255,255,255,.35), 0 6px 0 #000; transform: rotate(-8deg); }
#lobby label { display: flex; flex-direction: column; gap: 4px; font-weight: 900; font-size: 14px; }
#lobby input { font: inherit; font-size: 18px; padding: 12px; border-radius: 10px; border: 3px solid #000; background: #fff8ea; color: var(--ink); }
.note { font-size: 12px; opacity: .7; text-align: center; margin: 0; }
#lobbyMsg { min-height: 1.5em; text-align: center; color: var(--gold); font-weight: 900; margin: 0; }

#mute { position: fixed; right: 6px; bottom: calc(4px + env(safe-area-inset-bottom)); z-index: 40; background: none; border: 0; color: rgba(255,255,255,.45); font-size: 18px; }
#mute.off { text-decoration: line-through; color: rgba(255,255,255,.2); }
#lobby .big { flex: none; }
