* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
body { font-family:"Hiragino Maru Gothic ProN","Hiragino Sans","Noto Sans JP",sans-serif; color:#263238;
  background:radial-gradient(ellipse at 50% 25%, #00695c 0%, #004d40 55%, #00251a 100%); min-height:100vh; overflow-x:hidden; }
#app { max-width:680px; margin:0 auto; padding:10px; position:relative; z-index:1; }
.hidden { display:none !important; }
.screen { animation:fadein .3s; }
@keyframes fadein { from{opacity:0} to{opacity:1} }
.video-banner-wrap { position:relative; border-radius:18px; overflow:hidden; box-shadow:0 10px 30px rgba(0,0,0,.45); }
.video-banner { width:100%; height:200px; object-fit:cover; display:block; }
.game-title { position:absolute; inset:auto 0 10px 0; text-align:center; font-size:40px; color:#fff; text-shadow:0 2px 0 #004d40, 0 4px 16px rgba(0,0,0,.6); letter-spacing:6px; }
.panel { background:rgba(255,253,247,.97); border-radius:18px; padding:16px; margin-top:12px; box-shadow:0 8px 24px rgba(0,0,0,.35); }
.panel.center { text-align:center; }
.host-img { width:104px; animation:bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100%{ transform:translateY(0) } 50%{ transform:translateY(-6px) } }
.host-line { font-size:15px; font-weight:bold; color:#37474f; margin:4px 0 10px; min-height:22px; line-height:1.5; }
.setup-group { margin:10px 0; }
.setup-label { font-size:13px; font-weight:bold; color:#78909c; margin-bottom:5px; }
.seg-row { display:flex; gap:6px; flex-wrap:wrap; justify-content:center; }
.seg-btn { padding:9px 13px; border-radius:999px; border:2.5px solid #b0bec5; background:#fff; font-weight:bold; font-size:13.5px; cursor:pointer; color:#37474f; font-family:inherit; }
.seg-btn.sel { background:linear-gradient(180deg,#ffb300,#fb8c00); color:#fff; border-color:#fb8c00; box-shadow:0 3px 0 #d35400; }
.big-btn { display:block; width:100%; margin:12px 0 6px; padding:15px; font-size:19px; font-weight:bold; color:#fff; font-family:inherit;
  background:linear-gradient(180deg,#ff7043,#e53935); border:none; border-radius:999px; cursor:pointer; box-shadow:0 5px 0 #b71c1c; }
.big-btn:active { transform:translateY(3px); box-shadow:0 1px 0 #b71c1c; }
.sub-btn { display:block; width:100%; padding:11px; font-size:15px; font-weight:bold; color:#37474f; background:#eceff1; border:2px solid #b0bec5; border-radius:999px; cursor:pointer; margin-top:6px; font-family:inherit; }
.mini-btn { padding:7px 13px; border-radius:999px; border:2px solid #b0bec5; background:#fff; cursor:pointer; font-size:13px; font-family:inherit; }
.title-footer { display:flex; gap:8px; justify-content:center; margin-top:10px; }
/* game */
.game-head { display:flex; align-items:center; gap:8px; color:#fff; font-weight:bold; margin:2px 2px 8px; flex-wrap:wrap; font-size:13.5px; }
.badge { background:linear-gradient(180deg,#ffb300,#fb8c00); padding:4px 11px; border-radius:999px; font-size:13px; box-shadow:0 2px 0 #d35400; }
#hud-time { background:rgba(0,0,0,.35); padding:4px 11px; border-radius:999px; }
#turn-badge { margin-left:auto; background:rgba(255,255,255,.9); color:#00695c; padding:4px 11px; border-radius:999px; font-size:13px; }
#cp-row { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; }
.cp-box { background:rgba(255,253,247,.95); border-radius:12px; padding:6px 4px; text-align:center; border:3px solid transparent; min-height:98px; }
.cp-box.turn { border-color:#ffca28; box-shadow:0 0 0 3px rgba(255,202,40,.45); }
.cp-box img { width:44px; height:44px; object-fit:contain; }
.cp-box.me img { width:44px; }
.cp-box .cp-name { font-size:11.5px; font-weight:bold; color:#37474f; white-space:nowrap; overflow:hidden; }
.cp-box .cp-pairs { font-size:15px; font-weight:bold; color:#e65100; }
.cp-box .cp-pairs small { font-size:10.5px; color:#90a4ae; font-weight:normal; }
.cp-box .cp-speech { font-size:11px; color:#546e7a; min-height:14px; line-height:1.25; }
#board-wrap { margin-top:10px; background:rgba(0,0,0,.25); border:2.5px dashed rgba(255,255,255,.3); border-radius:16px; padding:10px; }
#board { display:grid; gap:6px; }
.mcard { position:relative; aspect-ratio:0.72; border-radius:7px; cursor:pointer; perspective:400px; }
.mcard .inner { position:absolute; inset:0; transform-style:preserve-3d; transition:transform .32s; }
.mcard.up .inner, .mcard.taken .inner { transform:rotateY(180deg); }
.mface { position:absolute; inset:0; backface-visibility:hidden; -webkit-backface-visibility:hidden; border-radius:7px; display:flex; flex-direction:column; align-items:center; justify-content:center; overflow:hidden; }
.mface.back { background:repeating-linear-gradient(45deg,#b71c1c 0 7px,#c62828 7px 14px); border:2px solid #fff3e0; color:#ffe0b2; box-shadow:inset 0 0 0 3px rgba(0,0,0,.12); }
.mface.back .back-mark { font-size:calc(var(--cw) * 0.34); line-height:1; }
.mface.face { background:linear-gradient(180deg,#ffffff,#f5f5f5); border:1.5px solid #b0bec5; transform:rotateY(180deg); font-weight:bold; }
.mface.face .corner { position:absolute; top:2px; left:4px; font-size:calc(var(--cw) * 0.21); line-height:1.1; text-align:center; }
.mface.face .pip { font-size:calc(var(--cw) * 0.44); }
.mface.red { color:#d32f2f; }
.mface.black { color:#263238; }
.mcard.taken { cursor:default; animation:takepop .35s; }
.mcard.taken .mface.face { background:linear-gradient(180deg,#fff8e1,#ffecb3); border-color:#ffb300; box-shadow:0 0 0 2px #ffb300; }
@keyframes takepop { 0%{ transform:scale(1) } 40%{ transform:scale(1.13) } 100%{ transform:scale(1) } }
.mcard.blank { visibility:hidden; }
.speech { margin-top:9px; background:#fffdf7; border:2.5px solid #80cbc4; border-radius:12px; padding:8px 13px; font-size:14px; min-height:42px; display:flex; align-items:center; }
.speech.good { border-color:#81c784; background:#e8f5e9; }
.sub-row { display:flex; justify-content:center; margin-top:10px; }
.sub-row .mini-btn { background:rgba(255,255,255,.85); }
.overlay { position:fixed; inset:0; background:rgba(0,0,0,.62); display:flex; align-items:center; justify-content:center; z-index:50; padding:14px; }
.overlay-card { background:#fffdf7; border-radius:18px; padding:18px; max-width:520px; width:100%; max-height:92vh; overflow-y:auto; text-align:center; box-shadow:0 18px 50px rgba(0,0,0,.5); }
.overlay-card h2 { font-size:21px; color:#263238; margin-bottom:8px; }
.overlay-video { width:100%; height:170px; object-fit:cover; border-radius:12px; margin-bottom:10px; }
.standings { width:100%; border-collapse:collapse; margin:8px 0; font-size:14.5px; }
.standings th, .standings td { padding:7px 5px; border-bottom:1.5px solid #eceff1; }
.standings th { color:#78909c; font-size:12px; }
.standings .me { background:#fff3c4; font-weight:bold; }
.standings .place { font-weight:bold; color:#e65100; }
#confetti { position:fixed; inset:0; pointer-events:none; z-index:80; }
