:root{--gold:#d7aa38;--gold2:#ffe58c;--green:#004a30;--green2:#08704f;--cream:#f9f4dc;--red:#ff334c;--blue:#68b9ff;--black:#040705;--glow:#31ff9c}
*{box-sizing:border-box}body{margin:0;background:radial-gradient(circle at 50% 20%,#082719,#010302 76%);color:var(--cream);font-family:Inter,system-ui,sans-serif;overflow:hidden}.app{min-height:100dvh;display:grid;grid-template-rows:64px 38px 1fr 82px;gap:8px;padding:8px 14px}.topbar{display:grid;grid-template-columns:58px 1fr 230px 170px 58px;gap:12px;align-items:center}.icon,.meter,.controls button,.walk-strip button{background:linear-gradient(#0b0b09,#010101);border:1px solid var(--gold);box-shadow:inset 0 0 18px #000,0 0 10px #000;border-radius:13px;color:var(--cream)}.icon{height:52px;font-size:25px}.meter{text-align:center;padding:8px}.meter span{display:block;letter-spacing:.12em;font-size:12px;color:#d9d0aa}.meter b{font-size:18px;color:#31ff9c}.meter.small b{color:#ffd943}.brand{text-align:center;font-family:Cinzel,serif;color:var(--gold2);font-size:30px;letter-spacing:.12em;text-shadow:0 3px #291400,0 0 12px #000;line-height:.9}.brand small{display:block;font-size:16px}.felt-shell{display:flex;align-items:center;justify-content:center;min-height:0}.table{width:min(1460px,100%);height:min(640px,calc(100dvh - 216px));min-height:500px;position:relative;border-radius:40px 40px 44% 44%/36px 36px 16% 16%;border:10px solid #6a450c;box-shadow:inset 0 0 0 4px #c99a30,inset 0 0 90px #001b0e,0 14px 35px #000;background:radial-gradient(ellipse at 50% 35%,#10724d 0,#005036 48%,#002819 100%);overflow:hidden}.table:before{content:"";position:absolute;inset:0;background:repeating-linear-gradient(135deg,rgba(255,255,255,.025) 0 1px,transparent 1px 26px),radial-gradient(circle at 50% 50%,rgba(255,255,255,.08),transparent 45%);pointer-events:none}.table-light{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 40%,rgba(87,255,178,.12),transparent 42%);pointer-events:none}.title{position:absolute;top:10px;left:0;right:0;text-align:center;font-family:Cinzel,serif;font-weight:900;font-size:24px;color:var(--gold2);text-shadow:0 3px #111;z-index:2}.title span{display:block;font-family:Inter,sans-serif;font-size:12px;letter-spacing:.12em;color:white}.chip-tray{position:absolute;top:70px;left:50%;transform:translateX(-50%);height:94px;display:flex;gap:10px;align-items:center;padding:10px 22px;border-radius:12px;background:linear-gradient(#bd8428,#7c4a09);border:2px solid #ffe38d;z-index:4}.chip{width:56px;height:56px;border-radius:50%;border:0;color:#111;font-weight:900;font-size:18px;text-shadow:0 1px white;box-shadow:inset 0 0 0 8px rgba(255,255,255,.22),inset 0 0 0 14px rgba(0,0,0,.08),0 5px 10px #000;cursor:pointer;transition:.18s}.chip:hover{transform:translateY(-5px) scale(1.08)}.chip.selected{outline:4px solid #31ff9c;box-shadow:0 0 0 6px rgba(49,255,156,.18),0 0 22px #31ff9c,inset 0 0 0 8px rgba(255,255,255,.22),inset 0 0 0 14px rgba(0,0,0,.08)}.white{background:#eee}.redchip{background:#cf1833;color:white;text-shadow:0 2px #500}.green{background:#18944c;color:white;text-shadow:0 2px #063}.black{background:#111;color:white;text-shadow:none}.purple{background:#7625c4;color:white;text-shadow:0 2px #214}.gold{background:#d39814;color:white;text-shadow:0 2px #432}.shoe{position:absolute;right:70px;top:86px;width:135px;height:92px;transform:rotate(-38deg);background:linear-gradient(135deg,#1d1d1d,#000);border:4px solid #b57b18;border-radius:14px;box-shadow:0 8px 18px #000;z-index:3}.shoe span{position:absolute;inset:0;display:grid;place-items:center;color:#ffe08a;font-weight:900;letter-spacing:.1em}.card-stack{position:absolute;left:16px;top:28px;width:58px;height:36px;background:white;transform:rotate(-8deg);border-radius:3px}.deal-zone{position:absolute;top:225px;left:50%;transform:translateX(-50%);width:540px;display:grid;grid-template-columns:1fr 3px 1fr;gap:26px;align-items:center}.divider{height:136px;background:#eee;opacity:.8}.hand{text-align:center}.hand h2{font-family:Cinzel,serif;font-size:38px;margin:8px 0 0;color:white;text-shadow:0 4px #001}.bankerHand h2{color:var(--red)}.score{position:absolute;margin-top:42px;width:58px;height:58px;border-radius:10px;background:rgba(0,0,0,.5);border:1px solid rgba(255,255,255,.4);display:grid;place-items:center;font-size:34px;font-weight:900}.playerHand .score{left:-66px}.bankerHand .score{right:-66px}.cards{height:94px;display:flex;justify-content:center;gap:6px}.card{width:66px;height:92px;background:white;color:#111;border-radius:7px;box-shadow:0 5px 11px #0008;display:grid;place-items:center;font-size:28px;font-weight:900;transform-origin:center}.card.red{color:#d10}.card.deal{position:fixed;z-index:40;animation:dealCard .55s cubic-bezier(.22,.85,.28,1.2) forwards}.card.flip{animation:cardFlip .45s ease both}@keyframes dealCard{from{transform:translate(var(--sx),var(--sy)) rotate(-24deg) scale(.7);opacity:.15}to{transform:translate(0,0) rotate(0) scale(1);opacity:1}}@keyframes cardFlip{0%{transform:rotateY(0)}50%{transform:rotateY(90deg)}100%{transform:rotateY(0)}}.bet-layout{position:absolute;left:50%;bottom:32px;transform:translateX(-50%);width:min(930px,94%);display:grid;grid-template-columns:1.2fr .8fr 1.2fr;gap:12px;z-index:8}.betspot{min-height:84px;background:rgba(0,20,13,.76);border:2px solid #f3dc8f;color:white;border-radius:16px;box-shadow:inset 0 0 28px #000,0 0 0 1px #000;padding:12px 14px;cursor:pointer;position:relative;transition:.16s;overflow:hidden}.betspot:before,.shiny:before{content:"";position:absolute;inset:-80% -30%;background:linear-gradient(115deg,transparent 40%,rgba(255,255,255,.34) 48%,transparent 56%);transform:translateX(-90%);transition:.45s;pointer-events:none}.betspot:hover:before,.shiny:hover:before{transform:translateX(90%)}.betspot:hover{filter:brightness(1.14);transform:translateY(-3px)}.betspot:active,.button-pressed{transform:translateY(2px) scale(.98)!important;filter:brightness(1.35)}.betspot span{font-family:Cinzel,serif;font-size:27px;font-weight:900}.betspot small{display:block;color:#ffde58;font-size:12px}.betspot em{display:block;min-height:22px;color:#34ff9d;font-style:normal;font-weight:900;margin-top:5px}.betspot.banker span{color:var(--red)}.betspot.tie span{color:#70ff86}.betspot.special span{font-size:18px}.betspot.active{outline:4px solid #31ff9c;box-shadow:0 0 22px rgba(49,255,156,.55),inset 0 0 28px #000}.chip-stack{position:absolute;right:12px;bottom:10px;min-width:46px;min-height:30px}.mini-chip{position:absolute;right:0;bottom:0;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:#7625c4;color:white;font-size:12px;font-weight:900;border:3px dashed #fff;box-shadow:0 5px 10px #000}.fly-chip{position:fixed;z-index:200;width:48px;height:48px;border-radius:50%;display:grid;place-items:center;font-weight:900;color:white;border:3px dashed #fff;box-shadow:0 8px 20px #000;transition:.38s cubic-bezier(.2,.9,.2,1.18)}.dragon-panel{position:absolute;left:18px;bottom:22px;width:255px;background:rgba(0,0,0,.75);border:1px solid var(--gold);border-radius:10px;padding:12px;z-index:6}.dragon-panel h3{margin:0 0 10px;color:#ffe98d;font-size:16px}.dragon-panel p{display:flex;justify-content:space-between;margin:10px 0;font-weight:900}.dragon-panel b{color:#3bff9d;font-size:22px}#signal{border:1px solid #1cd879;border-radius:7px;text-align:center;padding:9px;color:#3bff9d;font-weight:900}.result-float{position:absolute;left:50%;top:38%;transform:translate(-50%,-50%) scale(.75);z-index:100;pointer-events:none;opacity:0;text-align:center;font-family:Cinzel,serif;font-size:34px;font-weight:900;padding:24px 40px;border-radius:18px;background:rgba(0,0,0,.82);border:2px solid var(--gold);box-shadow:0 0 45px rgba(255,215,100,.28)}.result-float.show{animation:winFloat 1.9s ease both}@keyframes winFloat{0%{opacity:0;transform:translate(-50%,-30%) scale(.7)}15%{opacity:1;transform:translate(-50%,-50%) scale(1.05)}70%{opacity:1;transform:translate(-50%,-50%) scale(1)}100%{opacity:0;transform:translate(-50%,-70%) scale(.96)}}.controls{display:grid;grid-template-columns:110px 120px 1fr 120px 240px;gap:12px;align-items:center}.controls button{height:56px;font-weight:900;font-size:18px;position:relative;overflow:hidden;cursor:pointer;transition:.15s}.controls button:active,.icon:active{transform:translateY(2px) scale(.98);filter:brightness(1.35)}.active-chip{text-align:center;color:#dacfa6}.active-chip b{color:#31ff9c;font-size:20px}#dealBtn,.deal{background:linear-gradient(#ffe777,#c58604)!important;font-size:32px!important;color:#130b00!important}.walk-strip{display:flex;align-items:center;gap:12px;padding:8px 12px;border:1px solid rgba(215,170,56,.45);border-radius:10px;background:rgba(0,0,0,.5)}.walk-strip strong{color:#ffe58c}.walk-strip span{flex:1;color:#d8ccb0;font-size:13px}.walk-strip button{height:26px;padding:0 14px}.walk-strip.good{border-color:#31ff9c}.walk-strip.warn{border-color:#ffe777;box-shadow:0 0 14px rgba(255,231,119,.18)}.walk-strip.danger{border-color:#ff334c}.drawer{position:fixed;left:0;right:0;bottom:0;transform:translateY(105%);transition:.25s ease;z-index:80;background:rgba(2,8,5,.98);border-top:2px solid var(--gold);padding:22px;color:white;max-height:78dvh;overflow:auto}.drawer.open{transform:translateY(0)}#closeDrawer{position:absolute;right:20px;top:12px;background:transparent;color:white;border:0;font-size:32px}.roadTabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}.roadTabs button,.drill button{background:#06140d;border:1px solid var(--gold);color:#ffe98d;border-radius:8px;padding:10px 14px;position:relative;overflow:hidden;cursor:pointer}.roadTabs button.active{background:rgba(215,170,56,.18);outline:2px solid rgba(49,255,156,.35)}.drawer-panel{display:none}.drawer-panel.active{display:block}.smalltabs button{font-size:13px;padding:7px 10px}#roadCanvas{width:100%;max-width:840px;background:#f9f9f9;border-radius:8px;margin-top:6px}#roadText,.count-card,.drill{border:1px solid rgba(215,170,56,.28);border-radius:12px;background:rgba(0,0,0,.35);padding:12px;line-height:1.45}.count-card b{color:#31ff9c}.drill-cards{display:flex;gap:8px;margin:10px 0;min-height:62px}.drill-card{width:44px;height:62px;background:white;color:#111;border-radius:6px;display:grid;place-items:center;font-weight:900;font-size:18px}.drill-card.red{color:#d10}.drill input{background:#06140d;border:1px solid var(--gold);border-radius:8px;color:#fff;padding:8px;width:80px;font-size:18px}.modal{position:fixed;inset:0;background:rgba(0,0,0,.78);z-index:180;display:none;place-items:center}.modal.open{display:grid}.modal-card{width:min(480px,94vw);background:linear-gradient(#06331f,#020705);border:2px solid var(--gold);border-radius:18px;padding:24px;position:relative;box-shadow:0 20px 80px #000}.modal-card h2{font-family:Cinzel,serif;color:#ffe58c}.modal-card #closeWalk{position:absolute;right:14px;top:10px;background:none;border:0;color:white;font-size:30px}.modal-stats{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:18px 0}.modal-stats div{background:rgba(0,0,0,.38);border:1px solid rgba(215,170,56,.28);border-radius:10px;padding:12px}.modal-stats span{display:block;color:#d8ccb0;font-size:12px}.modal-stats b{color:#31ff9c;font-size:22px}
@media (max-width:900px){.app{grid-template-rows:58px 34px 1fr 74px;padding:6px}.topbar{grid-template-columns:48px 1fr 112px 92px 48px;gap:6px}.brand{font-size:18px}.meter span{font-size:9px}.meter b{font-size:14px}.table{height:calc(100dvh - 188px);min-height:560px;border-width:6px;border-radius:24px}.title{font-size:19px}.chip-tray{top:58px;gap:5px;padding:8px 10px}.chip{width:44px;height:44px;font-size:15px}.shoe{right:26px;top:98px;width:90px;height:62px}.deal-zone{top:195px;width:330px;gap:12px}.hand h2{font-size:28px}.cards{height:74px}.card{width:48px;height:68px;font-size:21px}.divider{height:105px}.score{display:none}.bet-layout{grid-template-columns:1fr 1fr;gap:8px;width:94%;bottom:92px}.betspot{min-height:62px;padding:8px}.betspot span{font-size:20px}.betspot.special span{font-size:14px}.betspot small{font-size:10px}.dragon-panel{left:12px;bottom:12px;width:190px;font-size:12px;display:none}.dragon-panel b{font-size:17px}.controls{grid-template-columns:70px 76px 1fr 76px 118px;gap:6px}.controls button{font-size:12px}.active-chip{font-size:11px}#dealBtn{font-size:24px!important}.walk-strip span{display:none}.result-float{font-size:22px;padding:18px 22px}.mini-chip{width:30px;height:30px;font-size:10px}.chip-stack{right:6px;bottom:6px}}


/* === V7 POLISH UPGRADES === */
#menuBtn, #roadsBtn, #audioBtn, .tab, .smalltabs button { position:relative; overflow:hidden; }
#menuBtn:active, #roadsBtn:active, #audioBtn:active, .tab:active, .smalltabs button:active { transform: translateY(2px) scale(.97); filter:brightness(1.45); }
#menuBtn::after, #roadsBtn::after, #audioBtn::after, .tab::after, .smalltabs button::after {
  content:""; position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(circle at center, rgba(255,255,255,.55), transparent 48%);
  opacity:0; transform:scale(.4); transition:.22s;
}
#menuBtn:active::after, #roadsBtn:active::after, #audioBtn:active::after, .tab:active::after, .smalltabs button:active::after { opacity:.65; transform:scale(1.7); }

.dragon-panel{
  left:28px!important; top:180px!important; bottom:auto!important;
  width:255px!important; z-index:18!important;
  background:linear-gradient(145deg,rgba(0,18,11,.88),rgba(0,0,0,.78))!important;
  box-shadow:0 10px 28px rgba(0,0,0,.55), 0 0 18px rgba(49,255,156,.08);
}
.dragon-panel h3{white-space:nowrap}

.drawer h2{font-family:Cinzel,serif;color:#ffe58c;letter-spacing:.08em;margin:0 0 14px;text-shadow:0 3px #000;}
.story-card,.strategy-grid article{
  border:1px solid rgba(215,170,56,.32); border-radius:16px;
  background:linear-gradient(145deg,rgba(8,38,24,.78),rgba(0,0,0,.45));
  box-shadow:inset 0 0 28px rgba(0,0,0,.5),0 10px 28px rgba(0,0,0,.28);
  padding:18px; line-height:1.55; color:#f5ecd0;
}
.story-card h3,.strategy-grid h3{font-family:Cinzel,serif;color:#ffe58c;margin:0 0 10px;letter-spacing:.06em;}
.story-card b{color:#31ff9c}.strategy-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px}.strategy-grid article{min-height:130px}.strategy-grid p{margin:0;color:#d8ccb0}
#roadCanvas{
  background:radial-gradient(ellipse at 50% 20%,#163420,#050806 72%)!important;
  border:1px solid rgba(215,170,56,.55); border-radius:14px!important;
  box-shadow:inset 0 0 30px rgba(0,0,0,.7),0 8px 25px rgba(0,0,0,.35);
}
#roadText{margin-top:12px;color:#f5ecd0;background:linear-gradient(145deg,rgba(8,38,24,.72),rgba(0,0,0,.45))!important;}

.audio-note{font-size:12px;color:#d8ccb0;margin-top:6px;}

@media(max-width:900px){
  .dragon-panel{display:block!important;left:10px!important;top:148px!important;width:178px!important;padding:8px!important;font-size:11px!important;}
  .dragon-panel h3{font-size:12px!important;margin-bottom:6px!important}.dragon-panel p{margin:5px 0!important}.dragon-panel b{font-size:15px!important}#signal{padding:5px!important}
  .strategy-grid{grid-template-columns:1fr}.story-card,.strategy-grid article{padding:13px}
}

/* === V8: table roads, corrected Dragon 7 count, card backs === */
.table-roads{
  position:absolute;right:20px;bottom:126px;width:330px;z-index:16;
  background:linear-gradient(145deg,rgba(0,18,11,.92),rgba(0,0,0,.78));
  border:1px solid rgba(215,170,56,.78);border-radius:14px;padding:10px;
  box-shadow:0 12px 30px rgba(0,0,0,.6),0 0 18px rgba(255,225,130,.08),inset 0 0 26px rgba(0,0,0,.52);
  backdrop-filter:blur(4px);transition:.22s ease;
}
.table-roads-head{display:flex;align-items:center;gap:8px;margin-bottom:7px}.table-roads-head strong{font-family:Cinzel,serif;color:#ffe58c;letter-spacing:.08em;font-size:13px}.mini-road-tabs{display:flex;gap:4px;flex:1}.mini-road-tabs button,.mini-toggle{background:#06140d;border:1px solid rgba(215,170,56,.65);color:#ffe98d;border-radius:7px;padding:5px 8px;font-weight:900;cursor:pointer}.mini-road-tabs button.active{background:rgba(49,255,156,.14);outline:1px solid rgba(49,255,156,.55);color:#31ff9c}.mini-toggle{width:30px;font-size:18px;padding:1px 0}#miniRoadCanvas{width:100%;height:142px;border-radius:10px;border:1px solid rgba(255,229,140,.35);box-shadow:inset 0 0 18px rgba(0,0,0,.65)}#miniRoadText{margin:7px 2px 0;color:#d8ccb0;font-size:11px;line-height:1.25}.table-roads.collapsed{width:150px;height:42px;overflow:hidden;padding:8px 10px}.table-roads.collapsed canvas,.table-roads.collapsed p,.table-roads.collapsed .mini-road-tabs{display:none}.table-roads.collapsed .table-roads-head{margin:0}.dragon-panel{top:170px!important;left:24px!important}.count-tags{display:block;color:#d8ccb0;font-size:10px;line-height:1.25;margin:2px 0 7px;border-top:1px solid rgba(215,170,56,.18);padding-top:5px}.card.backed{position:relative;transform-style:preserve-3d;background:transparent!important;box-shadow:none!important;color:inherit!important;display:block;perspective:460px}.card.backed .card-back-face,.card.backed .card-front-face{position:absolute;inset:0;border-radius:8px;backface-visibility:hidden;display:grid;place-items:center;box-shadow:0 6px 14px rgba(0,0,0,.62),inset 0 1px rgba(255,255,255,.6);border:1px solid rgba(0,0,0,.16)}.card.backed .card-back-face{background:radial-gradient(circle at 50% 42%,#17614a,#073122 65%,#021109);border:2px solid #e5c45d;color:#ffe58c;font-family:Cinzel,serif;font-size:20px;text-shadow:0 2px #000}.card.backed .card-back-face:before{content:"";position:absolute;inset:8px;border-radius:5px;border:1px solid rgba(255,230,140,.65);background:repeating-linear-gradient(45deg,rgba(255,255,255,.055) 0 2px,transparent 2px 8px)}.card.backed .card-back-face span{position:relative;z-index:1}.card.backed .card-front-face{background:#fffdf7;transform:rotateY(180deg);font-family:Cinzel,serif;font-weight:900;grid-template-rows:1fr 1fr;color:#121212}.card.backed.red .card-front-face{color:#d10}.card.backed .rank{font-size:28px;line-height:1;align-self:end}.card.backed .suit{font-size:30px;line-height:1;align-self:start}.card.backed.flip{animation:cardDealReveal .56s ease both}@keyframes cardDealReveal{0%{transform:rotateY(0)}50%{transform:rotateY(92deg)}100%{transform:rotateY(180deg)}}
@media(max-width:900px){.table-roads{right:8px;bottom:78px;width:185px;padding:7px}.table-roads-head strong{font-size:11px}.mini-road-tabs button{font-size:10px;padding:4px 5px}#miniRoadCanvas{height:92px}#miniRoadText{display:none}.table-roads.collapsed{width:112px;height:36px}.dragon-panel{top:132px!important;left:8px!important;width:176px!important}.count-tags{font-size:8px}.card.backed .rank{font-size:21px}.card.backed .suit{font-size:22px}}


/* === V9 MOBILE / ROADS FIXES === */
.table-roads{display:none!important;}
.card.backed .card-back-face span{font-size:12px;letter-spacing:.12em;opacity:.82;color:#ffe58c;text-shadow:0 2px #000;}
.result-float{min-width:230px;}
.result-float[style*="255, 107, 121"], .result-float.loss{color:#ff334c!important;border-color:#ff334c!important;box-shadow:0 0 45px rgba(255,51,76,.26)!important;}
#roadsPanel{overflow-x:auto;-webkit-overflow-scrolling:touch;padding-bottom:12px;}
#roadCanvas{width:auto!important;max-width:none!important;min-width:840px;display:block;background:#071108!important;border:1px solid rgba(255,229,140,.35);box-shadow:inset 0 0 24px rgba(0,0,0,.7),0 8px 24px rgba(0,0,0,.35);}
#roadText{max-width:840px;margin-top:10px;color:#f9f4dc;}
.dragon-panel{bottom:auto!important;top:174px!important;left:22px!important;z-index:7;}
.bet-layout{z-index:9;}
.drawer{padding-bottom:calc(22px + env(safe-area-inset-bottom));}
.controls{padding-bottom:env(safe-area-inset-bottom);}

@media(max-width:900px){
  body{overflow:hidden;}
  .app{grid-template-rows:56px 32px 1fr 70px;padding:6px;gap:6px;}
  .topbar{grid-template-columns:44px 1fr 86px 82px 44px;gap:5px;}
  .brand{font-size:14px;letter-spacing:.06em;line-height:1;}
  .brand small{display:none;}
  .icon{height:46px;font-size:20px;border-radius:10px;}
  .meter{padding:6px 4px;border-radius:10px;}
  .meter span{font-size:8px;}
  .meter b{font-size:12px;}
  .walk-strip{padding:5px 8px;min-height:30px;}
  .walk-strip strong{font-size:12px;}
  .walk-strip button{height:22px;font-size:11px;padding:0 8px;}
  .table{height:calc(100dvh - 176px);min-height:470px;border-width:5px;border-radius:20px;}
  .title{top:8px;font-size:16px;}
  .title span{font-size:9px;}
  .chip-tray{top:50px;height:62px;gap:4px;padding:7px 8px;}
  .chip{width:38px;height:38px;font-size:12px;box-shadow:inset 0 0 0 6px rgba(255,255,255,.22),inset 0 0 0 11px rgba(0,0,0,.08),0 4px 8px #000;}
  .shoe{right:14px;top:76px;width:78px;height:54px;border-width:2px;}
  .shoe span{font-size:11px;}
  .card-stack{width:38px;height:24px;left:10px;top:18px;}
  .deal-zone{top:145px;width:320px;max-width:86%;gap:8px;}
  .hand h2{font-size:24px;margin-top:5px;}
  .cards{height:62px;gap:4px;}
  .card{width:42px;height:60px;font-size:18px;}
  .card.backed .rank{font-size:18px!important;}
  .card.backed .suit{font-size:20px!important;}
  .card.backed .card-back-face span{font-size:9px;}
  .divider{height:90px;}
  .bet-layout{bottom:72px;width:94%;grid-template-columns:1fr 1fr;gap:6px;}
  .betspot{min-height:55px;padding:7px;border-radius:12px;}
  .betspot span{font-size:17px;}
  .betspot.special span{font-size:12px;}
  .betspot small{font-size:9px;}
  .betspot em{font-size:12px;min-height:14px;margin-top:2px;}
  .dragon-panel{display:none!important;}
  .controls{grid-template-columns:58px 62px 1fr 64px 104px;gap:5px;}
  .controls button{height:50px;font-size:10px;border-radius:10px;}
  #dealBtn{font-size:20px!important;}
  .active-chip{font-size:9px;}
  .active-chip b{font-size:14px;display:block;}
  .drawer{max-height:86dvh;padding:16px 12px;}
  .drawer h2{font-size:18px;}
  .roadTabs{gap:5px;}
  .roadTabs button{padding:8px 9px;font-size:12px;}
  .smalltabs button{font-size:10px;padding:7px 7px;}
  #roadCanvas{min-width:720px;height:150px;}
  #roadText{font-size:13px;}
  .result-float{font-size:20px;padding:16px 18px;min-width:190px;}
}

@media(max-width:430px){
  .topbar{grid-template-columns:40px 1fr 72px 70px 40px;}
  .brand{font-size:12px;}
  .meter b{font-size:11px;}
  .chip{width:34px;height:34px;font-size:11px;}
  .chip-tray{top:48px;}
  .deal-zone{top:136px;}
  .bet-layout{bottom:68px;gap:5px;}
  .betspot{min-height:52px;}
  .betspot span{font-size:15px;}
  .betspot.special span{font-size:11px;}
  .controls{grid-template-columns:54px 58px 1fr 58px 94px;}
  .controls button{font-size:9px;}
  #dealBtn{font-size:18px!important;}
}


/* === V10: clean card faces, loss color, repeat button, phone layout === */
.clean-card{position:relative;display:block!important;overflow:hidden;border-radius:8px!important;box-shadow:0 6px 14px rgba(0,0,0,.62)!important;border:1px solid rgba(0,0,0,.16);}
.clean-card.card-back{background:radial-gradient(circle at 50% 42%,#17614a,#073122 65%,#021109)!important;border:2px solid #e5c45d!important;color:transparent!important;}
.clean-card.card-back .back-pattern{position:absolute;inset:8px;border-radius:5px;border:1px solid rgba(255,230,140,.75);background:
  radial-gradient(circle at 50% 50%,rgba(255,229,140,.22),transparent 38%),
  repeating-linear-gradient(45deg,rgba(255,255,255,.075) 0 2px,transparent 2px 8px),
  repeating-linear-gradient(-45deg,rgba(255,255,255,.045) 0 2px,transparent 2px 8px);}
.clean-card.card-front{background:#fffdf7!important;color:#151515!important;display:block!important;font-family:Cinzel,serif;font-weight:900;text-shadow:none!important;}
.clean-card.red.card-front{color:#d10!important;}
.clean-card .pip{position:absolute;inset:0;display:grid;place-items:center;font-size:34px;line-height:1;}
.clean-card .corner{position:absolute;display:flex;flex-direction:column;align-items:center;line-height:.9;font-size:14px;font-style:normal;}
.clean-card .corner i{font-style:normal;font-size:14px;}
.clean-card .tl{left:5px;top:5px}.clean-card .br{right:5px;bottom:5px;transform:rotate(180deg)}
.clean-card.card-reveal{animation:cleanReveal .38s ease both;}
@keyframes cleanReveal{0%{transform:rotateY(0) scale(1)}48%{transform:rotateY(88deg) scale(1.04)}100%{transform:rotateY(0) scale(1)}}
.card.backed .card-back-face,.card.backed .card-front-face{display:none!important;}
.result-float.loss{color:#ff334c!important;border-color:#ff334c!important;box-shadow:0 0 45px rgba(255,51,76,.28)!important;}
.controls{grid-template-columns:110px 120px 1fr 120px 120px 240px;}
#repeatBtn{color:#ffe58c;}
@media(max-width:900px){
  .controls{grid-template-columns:52px 56px 1fr 58px 58px 94px;gap:5px;}
  .controls button{font-size:9px;}
  #repeatBtn{font-size:8px;}
  .clean-card .pip{font-size:24px}.clean-card .corner{font-size:10px}.clean-card .corner i{font-size:10px}
}
@media(max-width:430px){
  .controls{grid-template-columns:48px 52px 1fr 52px 52px 86px;}
  .controls button{font-size:8px;padding:0 2px;}
  #dealBtn{font-size:17px!important;}
}

/* === V11 FINAL: full readable road drawer + simplified count text === */
.drawer{
  left:0!important;right:0!important;bottom:0!important;
  max-height:92dvh!important;
  padding:22px max(18px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left))!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}
.drawer h2{margin:0 48px 14px 0;line-height:1.05;}
#roadsPanel{
  overflow:visible!important;
  padding:0 0 18px 0!important;
}
.road-viewer{
  width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  border:1px solid rgba(255,229,140,.38);
  border-radius:14px;
  background:linear-gradient(135deg,rgba(11,42,22,.72),rgba(0,0,0,.45));
  box-shadow:inset 0 0 28px rgba(0,0,0,.7),0 10px 28px rgba(0,0,0,.38);
  padding:8px 10px 12px 10px;
}
#roadCanvas{
  display:block!important;
  width:auto!important;
  max-width:none!important;
  min-width:840px!important;
  height:190px!important;
  border-radius:11px!important;
  margin:0!important;
  background:#071108!important;
  border:0!important;
  box-shadow:none!important;
}
#roadText{
  display:block;
  max-width:none!important;
  width:100%;
  margin:12px 0 0 0!important;
  color:#fff9df!important;
  font-size:17px;
  line-height:1.45;
  border-radius:13px;
  border:1px solid rgba(255,229,140,.34);
  background:linear-gradient(135deg,rgba(0,18,11,.82),rgba(0,0,0,.72));
  padding:14px 16px!important;
}
.count-tags{font-size:10px!important;color:#fff3b2!important;}
@media(max-width:900px){
  .drawer{max-height:94dvh!important;padding:14px 10px calc(20px + env(safe-area-inset-bottom)) 10px!important;}
  .drawer h2{font-size:17px;margin-right:38px;}
  .road-viewer{padding:7px 8px 10px 8px;border-radius:12px;}
  #roadCanvas{min-width:760px!important;height:170px!important;}
  #roadText{font-size:14px!important;padding:12px!important;}
  .roadTabs button{white-space:nowrap;}
}
@media(max-width:430px){
  #roadCanvas{min-width:700px!important;height:160px!important;}
  #roadText{font-size:13px!important;}
}

/* === V12: road forecast + non-clipped road gems === */
.road-viewer{
  overflow-x:auto!important;
  overflow-y:hidden!important;
  padding:10px 12px 14px 12px!important;
}
#roadCanvas{
  width:auto!important;
  height:auto!important;
  min-width:900px!important;
  display:block!important;
}
.road-forecast{
  margin:12px 0 0 0;
  padding:12px 14px;
  border:1px solid rgba(49,255,156,.38);
  border-radius:12px;
  background:linear-gradient(135deg,rgba(2,28,17,.92),rgba(0,0,0,.72));
  color:#fff8d8;
  font-weight:800;
  line-height:1.35;
  box-shadow:inset 0 0 18px rgba(0,0,0,.62),0 0 18px rgba(49,255,156,.08);
}
.road-forecast b{color:#ffe58c;font-family:Cinzel,serif;letter-spacing:.04em;}
.road-forecast span{font-family:Cinzel,serif;font-size:18px;margin:0 6px;letter-spacing:.08em;text-shadow:0 2px #000;}
.road-forecast .forecast-B{color:#ff445f;}
.road-forecast .forecast-P{color:#56a7ff;}
.road-forecast em{font-style:normal;color:#31ff9c;}
.road-forecast small{display:block;margin-top:5px;color:#d9cfaa;font-weight:700;}
@media(max-width:900px){
  #roadCanvas{min-width:900px!important;height:auto!important;}
  .road-forecast{font-size:13px;padding:10px 11px;}
  .road-forecast span{font-size:16px;}
}

/* === V13: bankroll, history, multiplayer foundation === */
.tool-card{border:1px solid rgba(255,229,140,.32);border-radius:14px;background:linear-gradient(135deg,rgba(0,22,14,.86),rgba(0,0,0,.68));padding:16px;margin-top:10px;box-shadow:inset 0 0 22px rgba(0,0,0,.6)}
.tool-card h3{font-family:Cinzel,serif;color:#ffe58c;margin:0 0 8px;font-size:20px}.tool-card p{color:#fff8df;line-height:1.45;margin:8px 0 12px}.tool-actions{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0}.tool-actions .shiny,.mp-grid .shiny{background:linear-gradient(#0b0b09,#010101);border:1px solid var(--gold);box-shadow:inset 0 0 18px #000,0 0 10px #000;border-radius:10px;color:#ffe98d;padding:11px 14px;font-weight:900;cursor:pointer;position:relative;overflow:hidden}.danger-btn{border-color:#ff334c!important;color:#ff8792!important}.modal-actions{justify-content:center}.style-summary{border:1px solid rgba(49,255,156,.35);border-radius:10px;padding:10px 12px;color:#31ff9c;background:rgba(0,0,0,.35);font-weight:900;margin:12px 0}.history-list{display:grid;gap:10px;margin-top:12px;max-height:38dvh;overflow:auto;padding-right:4px}.history-item{border:1px solid rgba(255,229,140,.26);border-radius:12px;background:rgba(0,0,0,.38);padding:12px}.history-item b{display:block;color:#ffe58c;font-family:Cinzel,serif}.history-item span{display:block;color:#d9cfaa;font-size:12px;margin:3px 0}.history-item p{margin:5px 0;color:#fff}.history-item small{color:#31ff9c;font-weight:800}.empty-history{color:#d9cfaa}.mp-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;align-items:end}.mp-grid label{display:flex;flex-direction:column;gap:5px;color:#ffe58c;font-weight:900}.mp-grid input{background:#06140d;border:1px solid var(--gold);border-radius:8px;color:#fff;padding:10px;font-size:16px}.leaderboard-preview{margin-top:12px;border:1px solid rgba(49,255,156,.32);border-radius:12px;background:rgba(0,0,0,.38);padding:12px}.leaderboard-preview b{color:#ffe58c}.leaderboard-preview p{margin:6px 0;color:#31ff9c;font-weight:900}.modal .modal-card p{color:#fff8df;line-height:1.45}
@media(max-width:900px){.tool-actions .shiny,.mp-grid .shiny{padding:10px 11px;font-size:13px}.history-list{max-height:42dvh}.mp-grid{grid-template-columns:1fr}.controls{grid-template-columns:1fr 1fr 1fr;grid-auto-rows:52px}.active-chip{grid-column:1/-1;order:-1}.controls .deal{grid-column:span 2}}

/* === V14: detailed hand history + simulation === */
.log-title{font-family:Cinzel,serif;color:#ffe58c;margin:18px 0 8px;font-size:16px;letter-spacing:.04em}.hand-log-list{display:grid;gap:8px;max-height:40dvh;overflow:auto;padding-right:4px}.hand-row{border:1px solid rgba(255,229,140,.22);border-radius:12px;background:rgba(0,0,0,.42);padding:10px 12px;color:#fff8df}.hand-row b{font-family:Cinzel,serif;color:#ffe58c}.hand-row .win{color:#31ff9c;font-weight:900}.hand-row .loss{color:#ff334c;font-weight:900}.hand-row small{display:block;color:#d9cfaa;margin-top:4px;line-height:1.35}.hand-cards{font-family:Inter,system-ui,sans-serif;color:#fff;margin-top:5px}.hand-cards .red{color:#ff5a69}.hand-cards .black{color:#f8f8f0}.sim-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;align-items:end}.sim-controls label{display:flex;flex-direction:column;gap:6px;color:#ffe58c;font-weight:900}.sim-controls input,.sim-controls select{background:#06140d;border:1px solid var(--gold);border-radius:8px;color:#fff;padding:10px;font-size:16px}.sim-controls .checkline{flex-direction:row;align-items:center;color:#fff8df}.sim-controls .checkline input{width:18px;height:18px}.sim-summary{border:1px solid rgba(49,255,156,.35);border-radius:12px;background:rgba(0,0,0,.38);padding:12px;margin:14px 0;color:#fff8df;line-height:1.55}.sim-summary b{color:#ffe58c}.sim-summary .up{color:#31ff9c;font-weight:900}.sim-summary .dn{color:#ff334c;font-weight:900}.sim-log{max-height:32dvh}
@media(max-width:700px){.hand-row{font-size:13px}.sim-controls{grid-template-columns:1fr}.hand-log-list{max-height:45dvh}}

/* V15 special side-bet hit celebrations */
.special-hit{
  position:fixed;
  left:50%;
  top:45%;
  transform:translate(-50%,-50%) scale(.72);
  z-index:260;
  pointer-events:none;
  opacity:0;
  display:grid;
  gap:10px;
  justify-items:center;
  filter:drop-shadow(0 18px 35px rgba(0,0,0,.85));
}
.special-hit.show{animation:specialHitIn 2.55s cubic-bezier(.18,.89,.22,1) both;}
.special-card{
  min-width:min(420px,86vw);
  border:2px solid #ffe58c;
  border-radius:22px;
  padding:18px 24px 20px;
  text-align:center;
  color:white;
  background:linear-gradient(145deg,rgba(0,0,0,.92),rgba(3,34,22,.9));
  box-shadow:inset 0 0 32px rgba(255,255,255,.08),0 0 46px rgba(255,229,140,.28);
  position:relative;
  overflow:hidden;
}
.special-card:before{
  content:"";
  position:absolute;
  inset:-70% -40%;
  background:linear-gradient(115deg,transparent 42%,rgba(255,255,255,.38) 49%,transparent 56%);
  animation:specialShine 1.25s ease .08s both;
}
.special-card.dragon{border-color:#b96cff;box-shadow:inset 0 0 35px rgba(185,108,255,.18),0 0 54px rgba(185,108,255,.45)}
.special-card.panda{border-color:#ff9d35;box-shadow:inset 0 0 35px rgba(255,157,53,.18),0 0 54px rgba(255,157,53,.42)}
.special-card.divine{border-color:#fff1a9;box-shadow:inset 0 0 35px rgba(255,241,169,.16),0 0 58px rgba(255,229,140,.5)}
.special-emoji{font-size:64px;line-height:1;animation:emojiPop .78s cubic-bezier(.18,1.3,.28,1) both;}
.special-card b{display:block;font-family:Cinzel,serif;font-size:34px;letter-spacing:.1em;color:#ffe58c;text-shadow:0 3px 0 #000,0 0 18px rgba(255,229,140,.55);position:relative;z-index:1;}
.special-card span{display:block;margin-top:6px;color:#f8edc6;font-weight:900;letter-spacing:.04em;position:relative;z-index:1;}
.burst-particle{
  position:fixed;
  z-index:255;
  width:12px;height:12px;
  font-style:normal;
  font-weight:900;
  pointer-events:none;
  animation:burstParticle 1.15s cubic-bezier(.11,.83,.22,1) forwards;
  text-shadow:0 0 12px currentColor;
}
@keyframes specialHitIn{
  0%{opacity:0;transform:translate(-50%,-42%) scale(.58) rotate(-2deg)}
  12%{opacity:1;transform:translate(-50%,-50%) scale(1.08) rotate(1deg)}
  22%,76%{opacity:1;transform:translate(-50%,-50%) scale(1) rotate(0)}
  100%{opacity:0;transform:translate(-50%,-62%) scale(.92)}
}
@keyframes specialShine{from{transform:translateX(-80%)}to{transform:translateX(80%)}}
@keyframes emojiPop{0%{transform:scale(.2) rotate(-20deg);opacity:0}65%{transform:scale(1.18) rotate(4deg);opacity:1}100%{transform:scale(1) rotate(0)}}
@keyframes burstParticle{0%{opacity:0;transform:translate(0,0) scale(.6) rotate(0)}12%{opacity:1}100%{opacity:0;transform:translate(var(--x),var(--y)) scale(.15) rotate(520deg)}}
@media(max-width:700px){.special-card{min-width:86vw;padding:14px 14px 16px}.special-emoji{font-size:48px}.special-card b{font-size:24px}.special-card span{font-size:12px}}


/* === V16: launch mobile fix + story dedication photos === */
html, body{
  min-height:100%;
  width:100%;
}
body{
  overflow-x:hidden!important;
  overflow-y:auto!important;
  -webkit-text-size-adjust:100%;
  touch-action:manipulation;
}
.app{
  min-height:100dvh;
}
.story-upgraded{max-width:980px;}
.story-hero-photo,
.story-photo-grid{margin:12px 0 16px;}
.story-hero-photo img,
.story-photo-grid img{
  width:100%;
  display:block;
  border-radius:18px;
  border:1px solid rgba(255,229,140,.36);
  box-shadow:0 14px 32px rgba(0,0,0,.55), inset 0 0 18px rgba(255,229,140,.08);
}
.story-photo-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.story-photo-grid img{
  height:220px;
  object-fit:cover;
}
.dedication-card{
  border:1px solid rgba(255,229,140,.42);
  border-radius:18px;
  background:linear-gradient(135deg,rgba(215,170,56,.14),rgba(0,0,0,.58));
  padding:16px 18px;
  margin:16px 0;
  box-shadow:inset 0 0 24px rgba(255,229,140,.06),0 10px 24px rgba(0,0,0,.36);
}
.dedication-card h4{
  font-family:Cinzel,serif;
  color:#ffe58c;
  font-size:22px;
  margin:0 0 8px;
  letter-spacing:.04em;
}
.dedication-card p{margin:0!important;}

@media(max-width:900px){
  body{overflow-y:auto!important;}
  .app{
    display:block!important;
    min-height:auto!important;
    padding:6px 6px calc(132px + env(safe-area-inset-bottom))!important;
  }
  .topbar{
    position:sticky;
    top:0;
    z-index:70;
    display:grid!important;
    grid-template-columns:42px 1fr 84px 86px 42px!important;
    gap:6px!important;
    padding:3px 0 6px;
    background:linear-gradient(180deg,rgba(0,8,4,.98),rgba(0,8,4,.82));
    backdrop-filter:blur(8px);
  }
  .walk-strip{
    margin:4px 0 8px!important;
    min-height:34px!important;
    position:relative;
    z-index:3;
  }
  .walk-strip span{display:none!important;}
  .felt-shell{
    display:block!important;
    min-height:0!important;
  }
  .table{
    width:100%!important;
    height:720px!important;
    min-height:720px!important;
    max-height:none!important;
    border-width:7px!important;
    border-radius:22px!important;
    margin:0 auto 10px!important;
  }
  .title{top:10px!important;font-size:18px!important;}
  .title span{font-size:10px!important;}
  .chip-tray{
    top:78px!important;
    max-width:94%!important;
    overflow:visible!important;
    height:64px!important;
    gap:5px!important;
  }
  .shoe{top:114px!important;right:20px!important;transform:rotate(-36deg) scale(.86)!important;}
  .deal-zone{
    top:196px!important;
    width:min(360px,86vw)!important;
  }
  .bet-layout{
    position:absolute!important;
    bottom:62px!important;
    width:92%!important;
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
  }
  .betspot{
    min-height:78px!important;
    padding:10px 8px!important;
  }
  .betspot span{font-size:19px!important;}
  .betspot.special span{font-size:14px!important;}
  .betspot small{font-size:10px!important;}
  .controls{
    position:fixed!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    z-index:75!important;
    display:grid!important;
    grid-template-columns:1fr 1fr 1.35fr!important;
    grid-template-areas:
      "chip chip chip"
      "undo clear deal"
      "repeat roads deal";
    gap:7px!important;
    padding:8px 8px calc(8px + env(safe-area-inset-bottom))!important;
    background:linear-gradient(180deg,rgba(0,0,0,.68),rgba(0,0,0,.98) 32%);
    border-top:1px solid rgba(215,170,56,.42);
    box-shadow:0 -14px 28px rgba(0,0,0,.65);
  }
  .controls button{
    width:100%!important;
    height:46px!important;
    min-width:0!important;
    border-radius:12px!important;
    font-size:12px!important;
    padding:0 4px!important;
  }
  #undoBtn{grid-area:undo!important;}
  #clearBtn{grid-area:clear!important;}
  #repeatBtn{grid-area:repeat!important;}
  #roadsBtn{grid-area:roads!important;}
  #dealBtn{
    grid-area:deal!important;
    height:99px!important;
    font-size:24px!important;
  }
  .active-chip{
    grid-area:chip!important;
    font-size:10px!important;
    line-height:1.15!important;
    margin:0!important;
    padding:0!important;
  }
  .active-chip b{font-size:17px!important;}
  .dragon-panel{display:none!important;}
  .drawer{
    max-height:calc(100dvh - 20px)!important;
    padding:14px 10px calc(148px + env(safe-area-inset-bottom)) 10px!important;
  }
  .drawer h2{font-size:18px!important;margin-right:42px!important;}
  .roadTabs button{font-size:12px!important;padding:8px 9px!important;}
  .story-photo-grid{grid-template-columns:1fr!important;}
  .story-photo-grid img{height:auto!important;max-height:330px;}
}

@media(max-width:430px){
  .topbar{grid-template-columns:40px 1fr 74px 76px 40px!important;gap:4px!important;}
  .brand{font-size:12px!important;letter-spacing:.04em!important;}
  .meter span{font-size:8px!important;}
  .meter b{font-size:12px!important;}
  .icon{height:44px!important;}
  .table{height:700px!important;min-height:700px!important;}
  .chip-tray{top:72px!important;padding:7px!important;}
  .chip{width:35px!important;height:35px!important;font-size:11px!important;}
  .shoe{top:111px!important;right:12px!important;transform:rotate(-36deg) scale(.78)!important;}
  .deal-zone{top:185px!important;width:315px!important;max-width:90vw!important;}
  .cards{height:62px!important;}
  .card{width:41px!important;height:58px!important;}
  .hand h2{font-size:23px!important;}
  .bet-layout{bottom:58px!important;width:94%!important;gap:6px!important;}
  .betspot{min-height:74px!important;}
  .betspot span{font-size:16px!important;}
  .betspot.special span{font-size:12px!important;}
  .controls{grid-template-columns:1fr 1fr 1.28fr!important;gap:6px!important;}
  .controls button{height:43px!important;font-size:10px!important;}
  #dealBtn{height:92px!important;font-size:22px!important;}
}

@media(max-width:380px){
  .table{height:660px!important;min-height:660px!important;}
  .chip{width:31px!important;height:31px!important;font-size:10px!important;}
  .deal-zone{top:174px!important;}
  .bet-layout{bottom:50px!important;}
  .betspot{min-height:68px!important;}
}

/* === V17 multiplayer + mobile polish === */
.chip.gold{
  width:72px!important;height:46px!important;border-radius:10px!important;
  background:linear-gradient(135deg,#6b3f05 0%,#f6d675 16%,#8a5408 27%,#f5cf60 45%,#2a1600 50%,#f9dc78 65%,#7b4806 82%,#fff0a6 100%)!important;
  color:#fff!important;text-shadow:0 2px 2px #000,0 0 6px #000!important;
  border:2px solid #ffe99a!important;box-shadow:inset 0 0 0 2px rgba(0,0,0,.55),inset 0 0 18px rgba(255,255,255,.22),0 8px 14px #000!important;
  font-size:20px!important;position:relative;overflow:hidden;
}
.chip.gold::before{content:"BACCARAT";position:absolute;top:4px;left:0;right:0;font-size:6px;letter-spacing:.08em;color:#111;background:#0b0b0b;color:#ffe58c;padding:1px 0;text-shadow:none;}
.chip.gold::after{content:"$";font-size:11px;margin-left:1px;color:#ffe58c;text-shadow:0 1px #000;}
.result-float{border-width:3px!important;}
.result-float.show:not(.loss){animation:winFloat 1.9s ease both, winPulse .42s ease 2;box-shadow:0 0 22px #31ff9c,0 0 70px rgba(49,255,156,.28),inset 0 0 25px rgba(49,255,156,.12)!important;}
.result-float.loss.show{animation:winFloat 1.9s ease both, lossShake .22s ease 3;box-shadow:0 0 22px #ff334c,0 0 70px rgba(255,51,76,.24),inset 0 0 25px rgba(255,51,76,.12)!important;border-color:#ff334c!important;}
@keyframes winPulse{50%{transform:translate(-50%,-50%) scale(1.12)}}
@keyframes lossShake{25%{margin-left:-7px}75%{margin-left:7px}}
.money-burst{position:fixed;z-index:500;pointer-events:none;font-style:normal;font-weight:900;font-size:22px;animation:moneyBurst 1.15s ease-out forwards;text-shadow:0 3px 8px #000;}
.money-burst.win{color:#31ff9c}.money-burst.loss{color:#ff334c}
@keyframes moneyBurst{0%{opacity:0;transform:translate(0,0) scale(.4) rotate(0)}15%{opacity:1}100%{opacity:0;transform:translate(var(--x),var(--y)) scale(1.3) rotate(540deg)}}
.limit-note{border:1px solid rgba(49,255,156,.28);border-radius:10px;padding:10px 12px;color:#31ff9c;background:rgba(0,0,0,.35);font-weight:800;margin:12px 0;}
.checkline{display:flex!important;flex-direction:row!important;align-items:center;gap:8px}.checkline input{width:auto!important;accent-color:#31ff9c}
.chat-box{margin-top:14px;border:1px solid rgba(255,229,140,.28);border-radius:12px;background:rgba(0,0,0,.35);padding:12px}.chat-box>b{color:#ffe58c;font-family:Cinzel,serif}.chat-log{height:150px;overflow:auto;border:1px solid rgba(255,255,255,.1);border-radius:10px;margin:8px 0;padding:8px;background:rgba(0,0,0,.28)}.chat-log p{margin:5px 0;color:#fff}.chat-log b{color:#31ff9c}.chat-log .dim{color:#d9cfaa}.chat-row{display:grid;grid-template-columns:1fr 90px;gap:8px}.chat-row input{background:#06140d;border:1px solid var(--gold);border-radius:8px;color:#fff;padding:10px;font-size:16px}.up{color:#31ff9c}.dn{color:#ff334c}
.card.card-back{background:linear-gradient(135deg,#042715,#0b5a38,#031b10)!important;border:2px solid #ffe58c;color:transparent!important;}
.card.card-back .back-pattern{width:78%;height:82%;border-radius:6px;border:1px solid rgba(255,229,140,.7);background:radial-gradient(circle at center,rgba(255,229,140,.35),transparent 34%),repeating-linear-gradient(45deg,rgba(255,255,255,.08) 0 2px,transparent 2px 8px)}
.card.card-front{background:#fffdf7!important;color:#111}.card.card-front.red{color:#d10!important}.corner{position:absolute;font-size:13px;line-height:1;text-align:center}.corner.tl{top:5px;left:6px}.corner.br{bottom:5px;right:6px;transform:rotate(180deg)}.pip{font-size:30px}.card.card-front .back-pattern{display:none!important}
.score{transition:transform .18s, color .18s}.score:not(:empty){transform:scale(1.02)}
@media(max-width:740px){.chip.gold{width:64px!important;height:42px!important;font-size:18px!important}.chat-row{grid-template-columns:1fr}.chat-row button{height:46px}.mp-grid{grid-template-columns:1fr!important}}


/* V19 Free Play chip + Glitter Bricks win SFX */
.free-play-label{font-family:Cinzel,serif;font-size:10px;font-weight:900;color:#ffedf0;letter-spacing:.08em;text-shadow:0 0 10px rgba(255,51,76,.75);align-self:center;margin-right:-2px;white-space:nowrap}
.chip.freechip{background:radial-gradient(circle at 36% 30%,#fff 0,#fff 38%,#f7f0e8 39%,#f7f0e8 55%,#c9152e 56%,#c9152e 72%,#fff 73%);border-color:#ff334c;color:#b00019;font-size:10px;line-height:.9;text-shadow:none;box-shadow:inset 0 0 0 4px #fff,inset 0 0 0 9px #d31331,0 0 14px rgba(255,51,76,.3),0 5px 10px #000!important}
.chip.freechip small{display:block;font-size:11px;color:#111;margin-top:2px}.chip.freechip.selected{outline:3px solid #ffe777;box-shadow:0 0 0 4px rgba(255,231,119,.25),0 0 24px rgba(255,231,119,.7),inset 0 0 0 4px #fff,inset 0 0 0 9px #d31331!important}.free-play-active{display:block;margin-top:3px;color:#ffedf0;font-weight:900;text-shadow:0 0 10px #ff334c;letter-spacing:.04em}.hand-row.free-hand-row{border-color:rgba(255,51,76,.42);background:linear-gradient(135deg,rgba(255,255,255,.04),rgba(255,51,76,.08))}.free-tag{color:#ffedf0;background:#b80e26;border:1px solid #ff7181;border-radius:999px;padding:2px 8px;font-weight:900}.chip-tray{align-items:center}
@media(max-width:740px){.free-play-label{font-size:8px;position:absolute;left:9px;top:-14px}.chip.freechip{width:44px!important;height:38px!important;font-size:8px!important}.chip.freechip small{font-size:9px}.chip-tray{padding-left:8px!important}}


/* V19 Glitter Bricks > $999 win celebration */
.glitter-spark-rain{
  position:fixed;
  z-index:650;
  pointer-events:none;
  font-style:normal;
  font-weight:900;
  color:#ffe777;
  text-shadow:0 0 8px #fff,0 0 18px #ffe777,0 0 30px #31ff9c;
  animation:glitterSparkRain 1.62s cubic-bezier(.12,.82,.16,1) forwards;
  filter:drop-shadow(0 0 10px rgba(255,231,119,.7));
}
@keyframes glitterSparkRain{
  0%{opacity:0;transform:translate(0,0) scale(.35) rotate(0deg)}
  12%{opacity:1;transform:translate(calc(var(--x) * .18),var(--rise)) scale(1.18) rotate(120deg)}
  55%{opacity:1;transform:translate(calc(var(--x) * .58),calc(var(--rise) * .18)) scale(1) rotate(380deg)}
  100%{opacity:0;transform:translate(var(--x),var(--fall)) scale(.2) rotate(760deg)}
}
.result-float.glitter-win{border-color:#ffe777!important;box-shadow:0 0 26px #ffe777,0 0 88px rgba(255,231,119,.42),inset 0 0 32px rgba(255,231,119,.2)!important;}


/* V20 GlitterBricks logo + sharing polish */
.glitter-brand{display:flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;line-height:1!important;}
.glitter-brand img{width:48px;height:48px;object-fit:contain;filter:drop-shadow(0 0 10px rgba(255,231,119,.65));border-radius:8px;}
.glitter-brand b{font-family:Cinzel,serif;color:#ffe58c;text-shadow:0 2px #000,0 0 14px rgba(255,231,119,.45);letter-spacing:.08em;}
.topbar .brand.glitter-brand{font-size:16px;}
.title{letter-spacing:.04em;}
.mp-room-code{display:inline-block;margin:6px 0 0;padding:6px 10px;border:1px solid rgba(255,229,140,.45);border-radius:8px;color:#ffe58c;background:rgba(0,0,0,.35);font-weight:900;letter-spacing:.08em;}
.player-card-line{display:block;font-size:12px;color:#e8dec0;margin-top:2px}.player-last{color:#ffe58c}.player-bank{color:#fff}.player-up{color:#31ff9c}.player-down{color:#ff334c}
.chat-log .system{color:#ffe58c;font-style:italic}.chat-log time{opacity:.58;font-size:11px;margin-left:6px}
@media(max-width:740px){.glitter-brand img{width:36px;height:36px}.topbar .brand.glitter-brand{font-size:12px!important}.glitter-brand{gap:3px!important}}
@media(max-width:430px){.glitter-brand img{width:30px;height:30px}.topbar .brand.glitter-brand{font-size:10px!important}}

/* Hotfix: keep GlitterBricks logo for link previews only, not in-game UI */
.glitter-brand,
.brand.glitter-brand {
  display: none !important;
}

/* Safe mobile card readability fix — does not resize the game table */
@media (max-width: 900px) {
  .card {
    font-size: 22px !important;
  }

  .card .suit,
  .card .cs {
    font-size: 10px !important;
    opacity: 0.7 !important;
  }

  .card .rank,
  .card .cr {
    font-size: 28px !important;
    font-weight: 900 !important;
  }

  .score-box {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 20 !important;
  }
}

/* Compact Dragon count on phones without moving the table */
@media (max-width: 740px) {
  .dragon-count,
  .dragon-panel,
  .count-panel {
    transform: scale(0.82);
    transform-origin: top left;
  }
}

