:root{--gold:#f6c35f;--gold-hi:#ffe7a7;--gold-deep:#915018;--purple:#220b34;--ink:#12081d;--text:#fff4dc;--muted:#d9c4a5;--green:#9df0b5;--red:#ffaaa0}
*{box-sizing:border-box}
html{min-height:100%;background:#10071b}
body{margin:0;min-height:100vh;min-height:100dvh;color:var(--text);font-family:Arial,Helvetica,sans-serif;background:#10071b;overflow-x:hidden}
button{font:inherit;color:inherit;touch-action:manipulation}
button:focus-visible{outline:2px solid #fff0b4;outline-offset:3px}
.scene{position:fixed;inset:0;z-index:0;overflow:hidden;background:#12091e}
.scene-image{position:absolute;inset:0;background:url('assets/background_desktop.png') center/cover no-repeat;transform:scale(1.02)}
.scene-shade{position:absolute;inset:0;background:linear-gradient(180deg,rgba(10,4,21,.58),rgba(13,4,23,.44) 45%,rgba(8,3,15,.78))}
.scene-vignette{position:absolute;inset:0;box-shadow:inset 0 0 170px rgba(0,0,0,.62)}
.app-shell{position:relative;z-index:1;width:min(1480px,100%);min-height:100vh;min-height:100dvh;margin:0 auto;padding:12px clamp(14px,2vw,30px) 10px;display:flex;flex-direction:column;gap:10px}
.topbar{min-height:66px;display:grid;grid-template-columns:48px minmax(180px,1fr) auto;align-items:center;gap:14px;border-bottom:1px solid rgba(244,197,105,.16);padding-bottom:8px}
.tool-button{width:42px;height:42px;padding:3px;border:0;background:transparent;display:grid;place-items:center;cursor:pointer;border-radius:50%;transition:transform .16s ease,filter .16s ease}
.tool-button img{display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 3px 5px rgba(0,0,0,.55))}
.tool-button:hover{transform:translateY(-1px);filter:brightness(1.14)}
.tool-button:disabled{opacity:.38;cursor:not-allowed}
.brand{min-width:0;display:flex;align-items:center;gap:16px}
.brand-logo{display:block;width:180px;height:62px;object-fit:contain;object-position:left center;filter:drop-shadow(0 5px 9px rgba(0,0,0,.5))}
.mode-chip{display:inline-flex;align-items:center;gap:7px;max-width:max-content;padding:7px 11px;border:1px solid rgba(247,197,100,.5);border-radius:99px;background:rgba(26,7,38,.7);color:#ffe1a1;font-size:9px;font-weight:900;letter-spacing:.13em;white-space:nowrap}
.mode-chip i,.status-dot{width:7px;height:7px;display:inline-block;border-radius:50%;background:#ffd36f;box-shadow:0 0 9px #ffc44e}
.utility{display:flex;align-items:center;gap:7px}
.game-layout{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(340px,410px);gap:clamp(24px,4vw,60px);align-items:center;padding:8px 0}
.wheel-panel{min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}
.wheel-heading{text-align:center;line-height:1.2}
.heading-kicker{color:#ffd991;font-size:9px;font-weight:900;letter-spacing:.32em;text-shadow:0 2px 8px #13061b}
.wheel-heading h1{margin:4px 0 2px;font:400 clamp(22px,2.3vw,32px)/1.05 Georgia,'Times New Roman',serif;letter-spacing:.07em;color:#fff0c5;text-shadow:0 2px 0 #783e13,0 7px 20px #08020d}
.wheel-heading p{margin:0;color:#e4c9a5;font-size:10px;font-weight:700;letter-spacing:.05em}
.wheel-stage{position:relative;width:min(100%,min(62vh,610px));aspect-ratio:1/1;display:grid;place-items:center;isolation:isolate}
.wheel-aura{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;z-index:-1;opacity:.24;pointer-events:none;animation:aura-turn 70s linear infinite}
.wheel-stage.is-spinning .wheel-aura{opacity:.42;animation-duration:8s}
.wheel-assembly{position:relative;width:100%;aspect-ratio:1/1;filter:drop-shadow(0 18px 26px rgba(0,0,0,.5))}
.wheel-rotor{position:absolute;inset:2.2%;z-index:2;transform:rotate(0deg);transform-origin:50% 50%;will-change:transform}
.wheel-face{position:absolute;inset:0;width:100%;height:100%;display:block;object-fit:contain;user-select:none;-webkit-user-drag:none}
.wheel-labels{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}
.wheel-label{font-family:Georgia,'Times New Roman',serif;font-weight:900;font-size:13px;fill:#fff5d2;stroke:#4b1909;stroke-width:2.8px;paint-order:stroke;filter:drop-shadow(0 1px 2px rgba(0,0,0,.9));text-anchor:middle;dominant-baseline:middle;letter-spacing:-.5px}
.wheel-label.long{font-size:11px}
.wheel-frame{position:absolute;inset:0;width:100%;height:100%;z-index:3;object-fit:fill;pointer-events:none;user-select:none}
.wheel-center{position:absolute;z-index:4;left:50%;top:50%;width:30%;height:30%;transform:translate(-50%,-50%);object-fit:contain;pointer-events:none;filter:drop-shadow(0 4px 7px rgba(0,0,0,.55))}
.wheel-pointer{position:absolute;z-index:6;left:50%;top:-10.5%;width:14%;height:20%;transform:translateX(-50%);object-fit:contain;filter:drop-shadow(0 5px 7px rgba(0,0,0,.75));pointer-events:none}
.wheel-status-row{width:min(100%,610px);display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px;align-items:center}
.status-pill{justify-self:start;display:inline-flex;align-items:center;gap:7px;padding:7px 11px;border:1px solid rgba(245,195,94,.42);border-radius:999px;background:rgba(23,7,35,.85);color:#ffe1a2;font-size:9px;font-weight:900;letter-spacing:.1em;white-space:nowrap}
.status-pill.is-spinning .status-dot{background:#8bdfff;box-shadow:0 0 9px #66bfff;animation:blink .7s infinite alternate}
.recent-results{min-width:0;display:flex;align-items:center;justify-content:center;gap:6px;overflow:hidden}
.recent-chip{min-width:38px;padding:6px 7px;border:1px solid rgba(255,213,131,.22);border-radius:8px;background:rgba(25,8,39,.8);color:#f4dfbb;text-align:center;font-size:10px;font-weight:900;white-space:nowrap;font-variant-numeric:tabular-nums}
.recent-chip.win{border-color:rgba(255,210,103,.58);color:#ffe39c}
.recent-chip.loss{color:#ffb5a8}
.history-link{border:0;background:none;color:#ffe0a1;font-size:9px;font-weight:900;letter-spacing:.09em;white-space:nowrap;cursor:pointer;padding:8px 0}
.history-link span{font-size:12px}
.control-panel{width:100%;max-width:410px;justify-self:center;display:flex;flex-direction:column;gap:13px;padding:20px 19px;border:1px solid rgba(249,195,93,.42);border-radius:24px;background:linear-gradient(150deg,rgba(39,12,51,.92),rgba(14,5,27,.94));box-shadow:0 18px 45px rgba(0,0,0,.34),inset 0 0 0 1px rgba(255,231,166,.07),inset 0 18px 30px rgba(255,176,67,.035)}
.field-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:5px;color:#ffe2a5;font-size:10px;font-weight:900;letter-spacing:.16em}
.field-heading small{color:#c8afcf;font-size:8px;font-weight:800;letter-spacing:.09em;white-space:nowrap}
.balance-asset{position:relative;width:100%;height:75px;display:grid;place-items:center}
.balance-asset>img{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;pointer-events:none}
.balance-asset strong{position:relative;z-index:1;width:68%;margin-left:12%;padding:0 16px;text-align:center;font:900 clamp(21px,2.4vw,28px)/1 Georgia,'Times New Roman',serif;color:#fff1c8;text-shadow:0 2px 4px #2a0b20;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bet-asset{position:relative;width:100%;height:70px;display:flex;align-items:center;justify-content:center;border:1px solid rgba(250,195,94,.82);border-radius:17px;background:linear-gradient(145deg,rgba(76,29,78,.97),rgba(23,7,39,.98) 55%,rgba(53,16,60,.97));box-shadow:inset 0 0 0 2px rgba(115,57,31,.55),inset 0 0 22px rgba(250,179,73,.10),0 5px 14px rgba(0,0,0,.22)}
.bet-asset:before{content:"";position:absolute;inset:4px;border:1px solid rgba(255,218,139,.19);border-radius:12px;pointer-events:none}
.bet-step-button{position:absolute;z-index:2;top:50%;width:42px;height:44px;transform:translateY(-50%);padding:2px;border:0;background:transparent;display:grid;place-items:center;cursor:pointer}
.bet-step-button img{width:100%;height:100%;object-fit:contain}
.bet-step-button.minus{left:4%}.bet-step-button.plus{right:4%}
.bet-step-button:disabled{opacity:.35;cursor:not-allowed}
.bet-value{position:relative;z-index:1;min-width:90px;text-align:center;font:900 23px/1 Georgia,'Times New Roman',serif;color:#fff1c8;text-shadow:0 2px 4px #250b2b;font-variant-numeric:tabular-nums}
.bet-presets{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;margin-top:1px}
.bet-presets button{min-width:0;padding:8px 4px;border:1px solid rgba(236,187,97,.28);border-radius:10px;background:rgba(47,16,57,.87);color:#f6d8a4;font-size:10px;font-weight:900;cursor:pointer;transition:background .15s,border-color .15s,transform .15s}
.bet-presets button.is-active{border-color:#ffe08d;background:linear-gradient(180deg,#8b4921,#4c174b);color:#fff2cf;box-shadow:inset 0 0 12px rgba(255,205,106,.12)}
.bet-presets button:disabled{opacity:.35;cursor:not-allowed}
.bet-presets button:not(:disabled):active{transform:scale(.96)}
.spin-button{position:relative;width:min(100%,340px);height:94px;align-self:center;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border:0;background:transparent;cursor:pointer;filter:drop-shadow(0 9px 12px rgba(0,0,0,.4));transition:transform .15s,filter .15s}
.spin-button>img{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;pointer-events:none}
.spin-button .spin-title,.spin-button .spin-subtitle{position:relative;z-index:1;text-shadow:0 2px 4px #381039}
.spin-title{font:400 29px/.95 Georgia,'Times New Roman',serif;letter-spacing:.13em;color:#fff3cb}
.spin-subtitle{font-size:9px;font-weight:900;letter-spacing:.19em;color:#ffe5b4}
.spin-button:hover:not(:disabled){transform:translateY(-2px);filter:brightness(1.1) drop-shadow(0 10px 14px rgba(0,0,0,.45))}
.spin-button:active:not(:disabled){transform:translateY(1px) scale(.99)}
.spin-button:disabled{opacity:.58;cursor:wait;filter:grayscale(.15)}
.last-result{min-height:64px;display:flex;align-items:center;justify-content:space-between;gap:15px;padding:9px 16px;border:1px solid rgba(245,191,92,.4);border-radius:14px;background:linear-gradient(105deg,rgba(29,9,40,.94),rgba(60,20,63,.82),rgba(24,7,34,.94));box-shadow:inset 0 0 18px rgba(255,185,79,.06),0 5px 12px rgba(0,0,0,.18)}
.result-text{min-width:0;display:flex;flex-direction:column;gap:5px}
.result-text small{color:#d9b77d;font-size:8px;font-weight:900;letter-spacing:.16em}
.result-text strong{color:#fff0c9;font-size:11px;font-weight:900;line-height:1.2;white-space:normal;overflow-wrap:anywhere}
.result-multiplier{flex:0 0 auto;min-width:54px;color:#ffdf8d;text-align:center;font:900 25px/1 Georgia,'Times New Roman',serif;text-shadow:0 2px 5px #40152b;white-space:nowrap}
.rtp-line{min-height:27px;display:flex;align-items:center;justify-content:center;gap:9px;color:#ceb7d0}
.rtp-seal{display:grid;place-items:center;width:24px;height:24px;border:1px solid rgba(255,204,110,.6);border-radius:50%;color:#ffe1a2;font-size:8px;font-weight:900}
.rtp-line strong{color:#ffe0a0;font-size:13px;font-variant-numeric:tabular-nums}
.rtp-line>span:not(.rtp-seal){font-size:8px;font-weight:900;letter-spacing:.12em}
.rtp-line button{width:20px;height:20px;border:1px solid rgba(255,218,141,.6);border-radius:50%;background:rgba(65,23,65,.9);color:#ffe6aa;font-weight:900;cursor:pointer}
.footer-note{display:flex;justify-content:space-between;gap:12px;padding-top:7px;border-top:1px solid rgba(240,193,103,.15);color:rgba(236,213,177,.62);font-size:8px;font-weight:800;letter-spacing:.14em}
/* dialogs */
.result-overlay,.modal-backdrop{position:fixed;inset:0;z-index:50;display:grid;place-items:center;padding:20px;background:rgba(6,2,13,.78);backdrop-filter:blur(7px);opacity:0;visibility:hidden;transition:opacity .22s,visibility .22s}
.result-overlay.is-visible,.modal-backdrop.is-visible{opacity:1;visibility:visible}
.result-dialog{position:relative;width:min(390px,92vw);min-height:340px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;padding:28px 22px;border:1px solid rgba(255,214,127,.62);border-radius:26px;background:radial-gradient(circle at 50% 15%,rgba(115,45,105,.92),rgba(24,7,38,.98) 68%);box-shadow:0 24px 65px rgba(0,0,0,.6),inset 0 0 35px rgba(255,190,77,.1);text-align:center;overflow:hidden;transform:translateY(18px) scale(.96);transition:transform .25s ease}
.result-overlay.is-visible .result-dialog{transform:translateY(0) scale(1)}
.result-ring{position:absolute;width:280px;height:280px;object-fit:contain;opacity:.18;animation:ring-turn 25s linear infinite;pointer-events:none}
.result-badge{position:relative;width:110px;height:95px;object-fit:contain;filter:drop-shadow(0 6px 9px rgba(0,0,0,.45))}
.result-dialog small{position:relative;color:#f5ce83;font-size:9px;font-weight:900;letter-spacing:.2em}
.result-dialog h2{position:relative;margin:0;color:#fff0bd;font:900 52px/1 Georgia,'Times New Roman',serif;text-shadow:0 3px 0 #7b3710,0 8px 18px rgba(0,0,0,.5)}
.result-dialog p{position:relative;margin:0;color:#ebd5b6;font-size:12px;font-weight:800}
.continue-button,.modal-action{position:relative;margin-top:11px;min-height:42px;padding:0 24px;border:1px solid #f6c66c;border-radius:999px;background:linear-gradient(180deg,#8c4b22,#4d1c56);color:#fff0c9;font-size:10px;font-weight:900;letter-spacing:.12em;cursor:pointer;box-shadow:0 5px 14px rgba(0,0,0,.3)}
.modal-card{position:relative;width:min(680px,94vw);max-height:min(82dvh,780px);overflow:auto;padding:30px 28px 24px;border:1px solid rgba(247,198,104,.56);border-radius:22px;background:linear-gradient(145deg,#30113f,#160821 75%);box-shadow:0 24px 70px rgba(0,0,0,.6)}
.modal-card h2{margin:0 36px 5px;text-align:center;color:#ffe0a0;font:400 23px/1.2 Georgia,'Times New Roman',serif;letter-spacing:.1em}
.modal-subtitle{margin:0 0 18px;text-align:center;color:#cdb6ca;font-size:11px}
.modal-close{position:absolute;right:14px;top:13px;width:34px;height:34px;border:1px solid rgba(255,213,128,.35);border-radius:50%;background:rgba(86,33,75,.7);color:#ffe6b7;font-size:22px;line-height:1;cursor:pointer}
.history-table-wrap{max-height:52dvh;overflow:auto;border:1px solid rgba(255,212,130,.15);border-radius:12px}
table{width:100%;border-collapse:collapse;font-size:11px;font-variant-numeric:tabular-nums}
th,td{padding:11px 8px;text-align:center;border-bottom:1px solid rgba(255,255,255,.07)}
th{position:sticky;top:0;background:#391647;color:#f9d38f;font-size:9px;letter-spacing:.09em}
td{color:#f6e6ca}td.win{color:#9ef2b6}td.loss{color:#ffb5a8}td.neutral{color:#ffdf96}
.history-empty{padding:26px;color:#d0bcd0;text-align:center}
.modal-action{display:block;margin:18px auto 0}
.modal-action.secondary{background:rgba(62,27,71,.9)}
.paytable-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:17px 0}
.paytable-item{padding:10px 5px;border:1px solid rgba(250,201,112,.24);border-radius:12px;background:rgba(255,255,255,.035);text-align:center}
.paytable-item strong{display:block;color:#ffe2a0;font:900 18px Georgia,'Times New Roman',serif}
.paytable-item small{color:#cdb9cd;font-size:9px}
.math-note{padding:14px 16px;border:1px solid rgba(255,205,108,.26);border-radius:13px;background:rgba(255,187,72,.07);color:#ead8c0;font-size:11px;line-height:1.6}
.math-note strong{color:#ffe4a5}.math-note p{margin:6px 0 0}
.demo-warning{padding:12px;border-radius:11px;background:rgba(176,58,64,.13);color:#ffc0b8;font-size:10px;line-height:1.5}
.toast{position:fixed;z-index:80;left:50%;bottom:max(20px,env(safe-area-inset-bottom));width:max-content;max-width:min(92vw,480px);padding:11px 17px;border:1px solid rgba(255,209,119,.5);border-radius:16px;background:rgba(27,8,39,.97);color:#fff1cf;text-align:center;font-size:11px;font-weight:800;box-shadow:0 10px 30px rgba(0,0,0,.45);opacity:0;visibility:hidden;transform:translate(-50%,12px);transition:.18s ease}
.toast.is-visible{opacity:1;visibility:visible;transform:translate(-50%,0)}
@keyframes aura-turn{to{transform:rotate(360deg)}}
@keyframes ring-turn{to{transform:rotate(360deg)}}
@keyframes blink{to{opacity:.35}}
@media(max-width:1040px) and (min-width:901px){.game-layout{grid-template-columns:minmax(0,1fr) minmax(320px,365px);gap:18px}.wheel-stage{width:min(100%,54vh,520px)}.control-panel{padding:17px;gap:10px}.brand-logo{width:155px}.utility{gap:3px}.tool-button{width:38px;height:38px}}
@media(max-width:900px){
  .modal-backdrop,.result-overlay{padding:10px}
  .modal-card{width:100%;max-width:680px}
  .result-dialog{width:min(390px,100%)}
  .scene-image{background-image:url('assets/background_mobile.png');background-position:center 48%;}
  .scene-shade{background:linear-gradient(180deg,rgba(10,4,22,.62),rgba(12,4,24,.55) 45%,rgba(8,3,17,.83))}
  .app-shell{width:100%;min-height:100dvh;padding:max(5px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));gap:6px}
  .topbar{min-height:52px;grid-template-columns:35px minmax(95px,1fr) auto;gap:4px;padding-bottom:4px}
  .tool-button{width:32px;height:32px;padding:1px}
  .brand{justify-content:center;flex-direction:column;gap:0}
  .brand-logo{width:104px;height:36px;object-position:center}
  .mode-chip{padding:2px 6px;font-size:6.5px;letter-spacing:.08em;gap:4px}
  .mode-chip i{width:5px;height:5px}
  .utility{gap:1px}
  .game-layout{display:flex;flex-direction:column;gap:5px;padding:0;align-items:stretch}
  .wheel-panel{gap:3px}
  .wheel-heading{display:none}
  .wheel-stage{width:100%;height:clamp(244px,38vh,315px);aspect-ratio:auto;display:flex;align-items:center;justify-content:center}
  .wheel-assembly{width:min(76vw,310px,calc(38vh - 5px));max-width:100%;flex:0 0 auto}
  .wheel-pointer{top:-10%;width:14%;height:20%}
  .wheel-status-row{width:100%;grid-template-columns:auto minmax(0,1fr) auto;gap:5px}
  .status-pill{padding:6px 8px;font-size:7px;letter-spacing:.07em;gap:5px}
  .status-dot{width:6px;height:6px}
  .recent-results{gap:3px}
  .recent-chip{min-width:0;flex:1;padding:5px 2px;font-size:8px;border-radius:7px}
  .history-link{font-size:7px;letter-spacing:.04em;padding:5px 0}
  .control-panel{max-width:none;padding:9px 11px 8px;gap:6px;border-radius:17px}
  .field-heading{margin-bottom:2px;font-size:8px;letter-spacing:.12em}
  .field-heading small{font-size:7px;letter-spacing:.05em}
  .balance-asset{height:57px}
  .balance-asset strong{font-size:20px;padding:0 8px}
  .bet-asset{height:58px}
  .bet-step-button{width:37px;height:39px}
  .bet-value{font-size:19px}
  .bet-presets{gap:5px}
  .bet-presets button{padding:6px 2px;font-size:9px;border-radius:8px}
  .spin-button{width:min(100%,290px);height:72px}
  .spin-title{font-size:23px}
  .spin-subtitle{font-size:7px;letter-spacing:.16em}
  .last-result{min-height:48px;padding:7px 11px;border-radius:11px;gap:8px}
  .result-text{gap:3px}
  .result-text small{font-size:7px;letter-spacing:.12em}
  .result-text strong{font-size:9px}
  .result-multiplier{min-width:45px;font-size:21px}
  .rtp-line{min-height:21px;gap:6px}
  .rtp-seal{width:20px;height:20px;font-size:7px}
  .rtp-line strong{font-size:11px}
  .rtp-line>span:not(.rtp-seal){font-size:7px;letter-spacing:.08em}
  .rtp-line button{width:18px;height:18px;font-size:11px}
  .footer-note{display:none}
  .result-dialog{min-height:300px;padding:22px 16px}
  .result-badge{width:95px;height:80px}
  .result-dialog h2{font-size:44px}
  .modal-card{width:min(96vw,650px);padding:26px 13px 18px}
  .modal-card h2{font-size:17px;margin:0 34px 5px}
  .modal-subtitle{font-size:10px}
  th,td{padding:9px 3px;font-size:8px}
  th{font-size:7px}
  .paytable-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .paytable-item{padding:8px 3px}
  .paytable-item strong{font-size:16px}
}
@media(max-width:380px){
  .app-shell{padding-left:7px;padding-right:7px}
  .topbar{grid-template-columns:31px minmax(80px,1fr) auto;gap:2px}
  .tool-button{width:29px;height:29px}
  .brand-logo{width:95px;height:34px}
  .mode-chip{font-size:6px}
  .utility{gap:0}
  .wheel-stage{height:clamp(232px,36vh,285px)}
  .wheel-assembly{width:min(75vw,290px,calc(36vh - 4px))}
  .status-pill{font-size:6.5px;padding:5px 6px}
  .history-link{font-size:6px}
  .control-panel{padding:8px 8px 7px}
  .bet-step-button{width:34px;height:36px}
  .bet-presets button{font-size:8px}
  .spin-button{height:66px}
}
@media(max-height:720px) and (max-width:900px){
  .topbar{min-height:45px}
  .brand-logo{height:31px}
  .wheel-stage{height:clamp(210px,36vh,260px)}
  .wheel-assembly{width:min(70vw,265px,calc(36vh - 4px))}
  .control-panel{gap:4px;padding-top:7px;padding-bottom:6px}
  .balance-asset{height:50px}
  .bet-asset{height:52px}
  .spin-button{height:60px}
  .last-result{min-height:43px}
  .rtp-line{min-height:19px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

@media (min-width:761px) and (max-width:900px){.control-panel{width:min(100%,500px)}.wheel-stage{width:min(100%,42vh,360px)}}

/* Final alignment pass: desktop pointer sits on the rim, not over the heading. */
@media(min-width:901px){.wheel-pointer{top:-1.5%;width:12%;height:18%}}
.tool-button.muted img{filter:grayscale(1) opacity(.55)}
.recent-empty{padding:6px 11px;border:1px solid rgba(255,213,131,.18);border-radius:8px;background:rgba(25,8,39,.65);color:#d9c39f;font-size:8px;font-weight:900;letter-spacing:.13em;white-space:nowrap}


/* PHOENIX WHEEL V3 - stable viewport, bounded result dialog, protected game artwork */
html,
body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden !important;
  overscroll-behavior: none;
  touch-action: pan-y;
  -webkit-text-size-adjust: 100%;
}

html.modal-open,
body.modal-open {
  overflow: hidden !important;
  height: 100%;
}

.scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  contain: strict;
  pointer-events: none;
}

.scene-image {
  transform: none !important;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
}

#app,
.game-layout,
.wheel-panel,
.control-panel,
.result-overlay,
.modal-backdrop {
  min-width: 0;
  max-width: 100%;
}

.result-overlay,
.modal-backdrop {
  width: 100vw;
  max-width: 100vw;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr);
  box-sizing: border-box;
}

.result-dialog {
  box-sizing: border-box;
  width: min(390px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  min-width: 0;
  max-height: calc(100dvh - 28px);
  padding-inline: clamp(12px, 4vw, 22px);
  overflow: hidden;
  overflow-wrap: anywhere;
}

.result-dialog > :not(.result-ring) {
  min-width: 0;
  max-width: 100%;
}

.result-dialog small {
  width: 100%;
  line-height: 1.4;
  letter-spacing: clamp(.04em, .8vw, .16em);
  overflow-wrap: anywhere;
}

.result-dialog p {
  width: 100%;
  max-width: 100%;
  line-height: 1.4;
  font-size: clamp(10px, 2.8vw, 12px);
  overflow-wrap: anywhere;
}

.result-dialog .continue-button {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.result-ring {
  width: min(280px, 78vw);
  max-width: 100%;
  max-height: 100%;
}

img,
svg {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
}

button,
.wheel-stage,
.wheel-assembly {
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 900px) {
  .result-overlay,
  .modal-backdrop {
    padding: max(14px, env(safe-area-inset-top))
             max(14px, env(safe-area-inset-right))
             max(14px, env(safe-area-inset-bottom))
             max(14px, env(safe-area-inset-left));
  }

  .result-dialog {
    width: min(390px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
    min-height: 0;
    gap: 8px;
  }
}


/* PHOENIX WHEEL V4 — phone-only hierarchy: balance, larger wheel, spin, bet, last result.
   Desktop/tablet layout above is intentionally untouched. */
@media (max-width: 700px) {
  .game-layout {
    display: grid !important;
    flex: 0 0 auto !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "balance"
      "wheel"
      "spin"
      "bet"
      "result";
    align-content: start;
    align-items: stretch;
    row-gap: clamp(3px, .75vh, 8px);
    padding: 0;
    min-height: 0;
  }

  /* Flatten only these two wrappers so the child sections can be placed in the new order. */
  .wheel-panel,
  .control-panel {
    display: contents !important;
  }

  .balance-section { grid-area: balance; width: 100%; margin: 0 auto; }
  .balance-section > .field-heading { display: none !important; }
  .balance-asset {
    width: min(100%, 500px);
    height: auto;
    aspect-ratio: 330 / 86;
    margin: 0 auto;
  }
  .balance-asset > img { object-fit: fill; }
  .balance-asset strong {
    width: 68%;
    margin-left: 12%;
    padding: 0 8px;
    font-size: clamp(20px, 5.3vw, 25px);
    line-height: 1;
  }

  .wheel-stage {
    grid-area: wheel;
    width: 100%;
    height: clamp(380px, 48svh, 420px);
    min-height: 0;
    padding: 38px 0 0;
    aspect-ratio: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
  }
  .wheel-assembly {
    width: min(94vw, 390px);
    max-width: calc(100vw - 16px);
    flex: 0 0 auto;
    transform: none !important;
  }
  .wheel-pointer { top: -10%; width: 14%; height: 20%; }

  /* Remove the small recent-history/status strip from the area above the controls. */
  .wheel-status-row { display: none !important; }

  .spin-button {
    grid-area: spin;
    width: min(100%, 290px);
    height: auto;
    aspect-ratio: 375 / 126;
    min-height: 0;
    margin: 0 auto;
    gap: 0;
  }
  .spin-title { font-size: clamp(24px, 7vw, 30px); letter-spacing: .12em; }
  .spin-subtitle { display: none !important; }

  .bet-section {
    grid-area: bet;
    width: min(100%, 500px);
    margin: 0 auto;
  }
  .bet-section > .field-heading {
    justify-content: center;
    margin: 0 0 4px;
  }
  .bet-section > .field-heading small { display: none !important; }
  .bet-asset { height: 60px; }
  .bet-presets { margin-top: 5px; }

  .last-result {
    display: flex !important;
    grid-area: result;
    width: min(100%, 500px);
    margin: 2px auto max(4px, env(safe-area-inset-bottom));
  }
  .rtp-line { display: none !important; }
}

@media (max-height: 720px) and (max-width: 700px) {
  .wheel-stage {
    height: 360px;
    padding-top: 30px;
  }
  .wheel-assembly {
    width: min(94vw, 390px, calc(43svh - 5px));
  }
  .spin-button { width: min(100%, 260px); }
  .balance-asset { max-width: 460px; }
}


/* PHOENIX WHEEL MOBILE V5 - fixed one-screen phone composition */
/* Phone-only rules. Desktop and tablet styles are intentionally unchanged. */
@media (max-width: 700px) {
  html,
  body {
    width: 100%; height: 100%; min-height: 0; max-width: 100%;
    overflow: hidden !important; overscroll-behavior: none;
  }
  body { height: 100svh; min-height: 100svh; max-height: 100svh; }
  .scene {
    position: fixed; inset: 0; width: 100%; height: 100svh; max-width: 100%;
    overflow: hidden; contain: strict;
  }
  .scene-image {
    position: absolute; inset: 0; width: 100%; height: 100%;
    transform: none !important; background-size: cover !important;
    background-position: center center !important; background-repeat: no-repeat;
  }
  .app-shell {
    width: 100%; height: 100svh; min-height: 0; max-height: 100svh; margin: 0 auto;
    padding: max(2px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
             max(4px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    display: grid; grid-template-rows: 44px minmax(0, 1fr); gap: 3px; overflow: hidden;
  }
  .topbar {
    width: 100%; min-width: 0; min-height: 44px; height: 44px;
    grid-template-columns: 30px minmax(76px, 1fr) auto; gap: 3px;
    padding: 0 1px 3px; overflow: hidden;
  }
  .tool-button { width: 28px; height: 28px; min-width: 28px; min-height: 28px; padding: 1px; }
  .brand { min-width: 0; justify-content: center; flex-direction: column; gap: 0; }
  .brand-logo { width: 94px; max-width: 100%; height: 31px; object-position: center; }
  .mode-chip { max-width: 100%; padding: 2px 6px; gap: 4px; font-size: 6px; letter-spacing: .06em; }
  .mode-chip i { width: 4px; height: 4px; }
  .utility { min-width: 0; gap: 1px; }
  .game-layout {
    width: 100%; height: 100%; min-width: 0; min-height: 0; max-width: 100%;
    display: grid !important; grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
    grid-template-areas: "balance" "wheel" "spin" "bet" "result";
    align-content: stretch; align-items: stretch; justify-items: stretch;
    gap: 3px; padding: 0; overflow: hidden;
  }
  .wheel-panel, .control-panel { display: contents !important; }
  .balance-section {
    grid-area: balance; width: 100%; min-width: 0; margin: 0;
    display: flex; justify-content: center; align-items: center;
  }
  .balance-section > .field-heading { display: none !important; }
  .balance-asset {
    width: min(88vw, 330px); height: clamp(56px, 9svh, 68px); max-height: 68px;
    aspect-ratio: auto; margin: 0 auto; flex: 0 0 auto;
  }
  .balance-asset > img { width: 100%; height: 100%; object-fit: fill; }
  .balance-asset strong {
    width: 68%; margin-left: 12%; padding: 0 6px;
    font-size: clamp(18px, 4.9vw, 22px); line-height: 1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .wheel-stage {
    grid-area: wheel; width: 100%; height: 100%; min-width: 0; min-height: 0; max-width: 100%;
    padding: 18px 0 4px; aspect-ratio: auto; display: flex;
    align-items: center; justify-content: center; overflow: visible; contain: layout;
  }
  .wheel-assembly {
    width: min(77vw, 39svh, 292px); height: auto; max-width: calc(100vw - 20px);
    max-height: 100%; flex: 0 0 auto; aspect-ratio: 1 / 1; transform: none !important;
  }
  .wheel-pointer { top: -10%; left: 50%; width: 14%; height: 20%; transform: translateX(-50%); }
  .wheel-heading, .wheel-status-row { display: none !important; }
  .spin-button {
    grid-area: spin; width: min(82vw, 292px); height: clamp(52px, 8.5svh, 62px);
    min-height: 0; margin: 0 auto; padding: 0; gap: 0;
  }
  .spin-title { font-size: clamp(23px, 6.2vw, 28px); letter-spacing: .12em; }
  .spin-subtitle { display: none !important; }
  .bet-section { grid-area: bet; width: min(100%, 420px); min-width: 0; margin: 0 auto; }
  .bet-section > .field-heading {
    justify-content: center; min-height: 10px; margin: 0 0 2px;
    font-size: 8px; line-height: 1;
  }
  .bet-section > .field-heading small { display: none !important; }
  .bet-asset { height: clamp(44px, 7.4svh, 53px); min-height: 44px; border-radius: 14px; }
  .bet-step-button { width: 34px; height: 36px; }
  .bet-value { font-size: 20px; }
  .bet-presets { gap: 5px; margin-top: 3px; }
  .bet-presets button {
    min-height: 25px; padding: 4px 2px; border-radius: 8px;
    font-size: 9px; line-height: 1;
  }
  .last-result {
    grid-area: result; display: flex !important; width: min(100%, 420px); min-width: 0;
    min-height: 34px; height: 34px; margin: 0 auto 1px; padding: 4px 10px;
    gap: 6px; border-radius: 10px; overflow: hidden;
  }
  .result-text { min-width: 0; gap: 1px; }
  .result-text small, .result-text strong {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .result-text small { font-size: 6px; line-height: 1.1; }
  .result-text strong { font-size: 8px; line-height: 1.1; }
  .result-multiplier { min-width: 36px; font-size: 17px; }
  .rtp-line, .footer-note { display: none !important; }
  .scene-image, .scene-shade, .scene-vignette { pointer-events: none; }
}

/* Short-height phones: preserve the main controls without page scrolling. */
@media (max-height: 680px) and (max-width: 700px) {
  .app-shell { grid-template-rows: 40px minmax(0, 1fr); gap: 2px; }
  .topbar { min-height: 40px; height: 40px; padding-bottom: 2px; }
  .brand-logo { height: 28px; }
  .balance-asset { width: min(88vw, 330px); height: 52px; }
  .wheel-stage { padding-top: 13px; padding-bottom: 1px; }
  .wheel-assembly { width: min(76vw, 40svh, 270px); }
  .spin-button { width: min(78vw, 270px); height: 49px; }
  .bet-asset { height: 42px; min-height: 42px; }
  .bet-presets { margin-top: 2px; }
  .bet-presets button { min-height: 22px; padding-block: 3px; }
  .last-result { height: 29px; min-height: 29px; }
}


/* PHOENIX WHEEL V6 - header controls and centered dynamic balance */
/* Desktop: enlarge all five top controls while reserving enough header width. */
@media (min-width: 1041px) {
  .topbar {
    min-height: 82px;
    grid-template-columns: 66px minmax(180px, 1fr) auto;
    gap: 16px;
    padding-bottom: 10px;
  }
  .tool-button {
    width: 61px;
    height: 61px;
    min-width: 61px;
    min-height: 61px;
    padding: 2px;
  }
  .utility { gap: 10px; }
}
@media (min-width: 901px) and (max-width: 1040px) {
  .topbar {
    min-height: 76px;
    grid-template-columns: 60px minmax(180px, 1fr) auto;
    gap: 12px;
    padding-bottom: 8px;
  }
  .tool-button {
    width: 55px;
    height: 55px;
    min-width: 55px;
    min-height: 55px;
    padding: 2px;
  }
  .utility { gap: 8px; }
}

/* Phone: 28px -> 32px (about +14%), keeping all five buttons inside the header. */
@media (max-width: 700px) {
  .topbar {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 3px;
  }
  .tool-button {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 1px;
  }
  .utility {
    flex: 0 0 auto;
    gap: 2px;
  }
}

/* Center the amount on the true geometric center of the balance frame. */
.balance-asset { position: relative; }
.balance-asset strong {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 66%;
  max-width: 66%;
  margin: 0;
  padding: 0 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  font-variant-numeric: tabular-nums lining-nums;
}


/* PHOENIX WHEEL V7 - taller phone SPIN button */
@media (max-width: 700px) {
  .spin-button {
    height: clamp(62px, 10.2svh, 74px) !important;
  }
}

@media (max-height: 680px) and (max-width: 700px) {
  .spin-button {
    height: 59px !important;
  }
}


/* PHOENIX WHEEL V8 - taller phone spin and balance */
@media (max-width: 700px) {
  .spin-button {
    height: clamp(71px, 11.7svh, 85px) !important;
  }

  .balance-asset {
    height: clamp(64px, 10.35svh, 78px) !important;
  }
}

@media (max-height: 680px) and (max-width: 700px) {
  .spin-button {
    height: 68px !important;
  }

  .balance-asset {
    height: 60px !important;
  }
}


/* PHOENIX WHEEL V9 - mobile wheel +15% */
@media (max-width: 700px) {
  .wheel-stage {
    padding-top: 10px;
    padding-bottom: 2px;
  }

  .wheel-assembly {
    width: min(88.5vw, 44.85svh, 336px);
    max-width: calc(100vw - 20px);
    max-height: 100%;
  }
}

@media (max-height: 680px) and (max-width: 700px) {
  .wheel-stage {
    padding-top: 8px;
    padding-bottom: 0;
  }

  .wheel-assembly {
    width: min(87.4vw, 46svh, 311px);
    max-height: 100%;
  }
}


/* PHOENIX WHEEL V10 - phone header logo beside back button */
@media (max-width: 700px) {
  .topbar {
    grid-template-columns: 32px 90px minmax(0, 1fr) !important;
    gap: 4px !important;
    align-items: center;
  }

  .topbar > .back-button {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  .topbar > .brand {
    grid-column: 2;
    grid-row: 1;
    width: 90px;
    min-width: 0;
    justify-self: start;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 0;
    transform: translateY(-2px);
  }

  .brand-logo {
    width: 84px !important;
    max-width: 100%;
    height: 25px !important;
    object-fit: contain;
    object-position: left center;
  }

  .mode-chip {
    max-width: 88px;
    margin-top: -2px;
    padding: 1px 4px;
    font-size: 6.5px;
    line-height: 1;
    letter-spacing: .045em;
    white-space: nowrap;
  }

  .topbar > .utility {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 2px;
  }
}

@media (max-width: 380px) {
  .topbar {
    grid-template-columns: 30px 80px minmax(0, 1fr) !important;
    gap: 3px !important;
  }

  .topbar > .brand {
    width: 80px;
  }

  .brand-logo {
    width: 76px !important;
    height: 23px !important;
  }

  .mode-chip {
    font-size: 5.8px;
  }
}

@media (max-height: 680px) and (max-width: 700px) {
  .brand-logo {
    height: 22px !important;
  }
  .mode-chip {
    margin-top: -2px;
    padding-top: 1px;
    padding-bottom: 1px;
  }
}


/* PHOENIX WHEEL V11 - logo and demo label horizontal */
@media (max-width: 700px) {
  .topbar {
    grid-template-columns: 30px minmax(0, 1fr) auto !important;
    gap: 4px !important;
  }

  .topbar > .brand {
    grid-column: 2;
    grid-row: 1;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 5px !important;
    width: max-content !important;
    max-width: 100%;
    min-width: 0;
    transform: none !important;
  }

  .brand-logo {
    width: 96px !important;
    height: 29px !important;
    max-width: calc(100% - 62px) !important;
    object-fit: contain;
    object-position: left center;
    flex-shrink: 1;
  }

  .topbar .mode-chip {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: auto;
    max-width: 60px;
    margin: 0 !important;
    padding: 3px 4px !important;
    font-size: 6px !important;
    line-height: 1.1;
    white-space: nowrap;
  }

  .topbar > .utility {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    min-width: 0;
  }
}

@media (max-width: 380px) {
  .topbar > .brand {
    gap: 3px !important;
  }

  .brand-logo {
    width: 82px !important;
    height: 26px !important;
  }

  .topbar .mode-chip {
    max-width: 55px;
    padding: 2px 3px !important;
    font-size: 5.5px !important;
  }
}


/* PHOENIX WHEEL EPIC RESULT V12 */

.result-overlay {
  background:
    radial-gradient(ellipse at 50% 48%, rgba(116,48,14,.24), transparent 58%),
    rgba(5,2,12,.88) !important;
  backdrop-filter: blur(9px) saturate(.78) !important;
  -webkit-backdrop-filter: blur(9px) saturate(.78);
}

.result-dialog {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  width: min(390px, calc(100vw - 34px));
  max-width: calc(100vw - 34px);
  min-width: 0;
  min-height: 0;
  max-height: calc(100dvh - 32px);
  overflow: hidden;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 25px 20px 22px;
  border: 2px solid #dba642;
  border-radius: 21px;

  background:
    radial-gradient(ellipse at 50% 0%, rgba(157,83,25,.34), transparent 45%),
    linear-gradient(180deg, #371342 0%, #210a30 52%, #12051e 100%);

  box-shadow:
    0 0 0 3px rgba(68,27,78,.9),
    0 0 0 5px rgba(203,148,57,.30),
    0 22px 65px rgba(0,0,0,.78),
    inset 0 1px 0 rgba(255,228,164,.38),
    inset 0 0 34px rgba(228,151,47,.10);

  text-align: center;
  transform: translateY(18px) scale(.94);
  transition: transform .32s cubic-bezier(.2,.85,.25,1);
}

.result-dialog::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 8px;
  border: 1px solid rgba(244,194,102,.38);
  border-radius: 14px;
  pointer-events: none;
}

.result-dialog::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: -48px;
  left: 50%;
  width: min(270px, 75vw);
  height: 155px;
  transform: translateX(-50%);
  background: url("assets/effect_sunburst.png") center / contain no-repeat;
  opacity: .30;
  pointer-events: none;
}

.result-dialog > :not(.result-ring) {
  position: relative;
  z-index: 2;
  min-width: 0;
  max-width: 100%;
}

.result-overlay.is-visible .result-dialog {
  transform: translateY(0) scale(1);
  animation: phoenix-result-enter .42s cubic-bezier(.16,1,.3,1) both;
}

.result-ring {
  position: absolute;
  z-index: 1;
  top: 15px;
  left: 50%;
  width: 205px;
  height: 175px;
  max-width: 78%;
  object-fit: contain;
  transform: translateX(-50%);
  opacity: .30;
  animation: ring-turn 24s linear infinite;
  pointer-events: none;
}

.result-badge {
  position: relative;
  z-index: 2;
  width: 150px;
  height: 108px;
  margin: 3px 0 0;
  object-fit: contain;
  filter: drop-shadow(0 7px 10px rgba(0,0,0,.65));
  animation: phoenix-badge-enter .48s .08s cubic-bezier(.16,1,.3,1) both;
}

.result-dialog small {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: 0;
  color: #ffdc91;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .17em;
  line-height: 1.45;
  text-align: center;
  text-shadow: 0 2px 5px #17051c;
}

.result-dialog h2 {
  position: relative;
  z-index: 2;
  margin: 0;
  color: #ffe5a2;
  font: 900 clamp(48px, 14vw, 64px)/1 Georgia, "Times New Roman", serif;
  letter-spacing: -.035em;
  text-shadow:
    0 2px 0 #9b5a1e,
    0 4px 0 #512019,
    0 8px 18px rgba(0,0,0,.75);
}

.result-dialog p {
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  min-height: 66px;
  margin: 3px 0 0;
  padding: 12px 27px;

  background: url("assets/panel_result.png") center / 100% 100% no-repeat;
  color: #fff0c9;
  font-size: clamp(10px, 2.9vw, 12px);
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 5px #2b0b23;
}

.result-dialog .continue-button {
  position: relative;
  z-index: 2;
  width: min(235px, 100%);
  min-height: 48px;
  margin: 3px 0 0;
  padding: 0 20px;

  border: 1px solid #ffd477;
  border-radius: 9px;
  background:
    linear-gradient(180deg, #71308a 0%, #3a1053 55%, #260b3d 100%);

  color: #ffebbd;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .15em;

  box-shadow:
    inset 0 1px 0 rgba(255,237,185,.42),
    inset 0 -3px 0 rgba(0,0,0,.20),
    0 5px 0 #6f3d19,
    0 9px 18px rgba(0,0,0,.42);

  cursor: pointer;
  transition: transform .12s, filter .12s;
}

.result-dialog .continue-button:active {
  transform: translateY(3px);
  filter: brightness(1.15);
}

/* Different result moods */
.result-dialog[data-outcome="jackpot"] {
  border-color: #ffe18a;
  box-shadow:
    0 0 0 3px rgba(92,42,20,.95),
    0 0 0 5px rgba(255,198,73,.48),
    0 0 45px rgba(255,172,42,.30),
    0 22px 65px rgba(0,0,0,.8),
    inset 0 0 38px rgba(255,185,55,.20);
}

.result-dialog[data-outcome="jackpot"] .result-ring {
  opacity: .55;
}

.result-dialog[data-outcome="win"] .result-ring {
  opacity: .38;
}

.result-dialog[data-outcome="push"] h2 {
  color: #e9d9ff;
  text-shadow: 0 2px 0 #6b438f, 0 6px 16px rgba(0,0,0,.75);
}

.result-dialog[data-outcome="loss"] {
  border-color: #a86a50;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(111,36,42,.28), transparent 47%),
    linear-gradient(180deg, #2b102e 0%, #180b27 60%, #100817 100%);
}

.result-dialog[data-outcome="loss"] .result-ring,
.result-dialog[data-outcome="loss"]::after {
  opacity: .12;
}

@keyframes phoenix-result-enter {
  0% { opacity: 0; transform: translateY(22px) scale(.90); }
  65% { opacity: 1; transform: translateY(-3px) scale(1.015); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes phoenix-badge-enter {
  0% { opacity: 0; transform: translateY(12px) scale(.72); }
  70% { opacity: 1; transform: translateY(-3px) scale(1.05); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 400px) {
  .result-dialog {
    width: calc(100vw - 34px);
    padding: 21px 15px 19px;
    gap: 6px;
  }

  .result-badge {
    width: 132px;
    height: 91px;
  }

  .result-dialog h2 {
    font-size: clamp(43px, 13vw, 52px);
  }

  .result-dialog p {
    min-height: 57px;
    padding-inline: 23px;
  }

  .result-dialog .continue-button {
    min-height: 45px;
  }
}

@media (max-height: 650px) and (max-width: 700px) {
  .result-dialog {
    gap: 4px;
    padding: 13px 14px 15px;
  }

  .result-badge {
    width: 105px;
    height: 73px;
  }

  .result-ring {
    width: 155px;
    height: 135px;
  }

  .result-dialog h2 {
    font-size: 42px;
  }

  .result-dialog p {
    min-height: 49px;
    margin-top: 1px;
  }

  .result-dialog .continue-button {
    min-height: 41px;
    margin-top: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .result-dialog,
  .result-dialog *,
  .result-dialog::after {
    animation: none !important;
    transition: none !important;
  }
}


/* PHOENIX V13 - fixed stationary result ring */
.result-dialog .result-ring {
  animation: none !important;
  transition: none !important;
  transform: translateX(-50%) rotate(0deg) !important;
  transform-origin: 50% 50%;
  will-change: auto;
}


/* PHOENIX WHEEL V14 - desktop vertical game layout */
@media (min-width: 901px) {

  .app-shell {
    width: min(1600px, 100%);
    min-height: 100svh;
    padding: 10px clamp(22px, 3vw, 52px) 12px;
    gap: 6px;
  }

  .topbar {
    flex: 0 0 auto;
    min-height: 82px;
    grid-template-columns: 66px minmax(0, 1fr) auto;
    gap: clamp(16px, 2vw, 30px);
    padding-bottom: 8px;
  }

  .game-layout {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(280px, 1fr) auto auto auto;
    grid-template-areas:
      "balance"
      "wheel"
      "spin"
      "bet"
      "result";
    align-content: stretch;
    align-items: center;
    justify-items: center;
    gap: clamp(6px, .85svh, 11px);
    padding: 4px 0 6px;
  }

  .wheel-panel,
  .control-panel {
    display: contents !important;
  }

  .wheel-heading,
  .wheel-status-row,
  .rtp-line,
  .footer-note {
    display: none !important;
  }

  .balance-section {
    grid-area: balance;
    width: min(100%, 820px);
    min-width: 0;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .balance-section > .field-heading {
    display: none !important;
  }

  .balance-asset {
    width: min(100%, 820px);
    height: clamp(74px, 8svh, 94px);
    max-width: 820px;
    margin: 0 auto;
  }

  .balance-asset strong {
    font-size: clamp(30px, 2.4vw, 39px);
    line-height: 1;
    width: 66%;
    max-width: 66%;
    padding: 0 8px;
  }

  .wheel-stage {
    grid-area: wheel;
    width: auto;
    height: min(100%, 57svh, 650px);
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1 / 1;
    justify-self: center;
    align-self: center;
    display: grid;
    place-items: center;
    overflow: visible;
    padding: 0;
  }

  .wheel-assembly {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    aspect-ratio: 1 / 1;
  }

  .wheel-pointer {
    top: -1.5%;
    left: 50%;
    width: 12%;
    height: 18%;
    transform: translateX(-50%);
  }

  .spin-button {
    grid-area: spin;
    width: min(58vw, 560px);
    height: clamp(82px, 9.5svh, 112px);
    min-height: 0;
    margin: 0 auto;
    padding: 0;
  }

  .spin-title {
    font-size: clamp(35px, 3vw, 46px);
    letter-spacing: .14em;
  }

  .spin-subtitle {
    display: none !important;
  }

  .bet-section {
    grid-area: bet;
    width: min(100%, 820px);
    min-width: 0;
    margin: 0 auto;
  }

  .bet-section > .field-heading {
    justify-content: center;
    margin: 0 0 5px;
    font-size: 12px;
  }

  .bet-section > .field-heading small {
    display: none !important;
  }

  .bet-asset {
    height: clamp(66px, 7.2svh, 82px);
  }

  .bet-step-button {
    width: 58px;
    height: 60px;
  }

  .bet-value {
    font-size: clamp(28px, 2.2vw, 36px);
  }

  .bet-presets {
    gap: 11px;
    margin-top: 7px;
  }

  .bet-presets button {
    min-height: clamp(34px, 4svh, 42px);
    padding: 8px;
    border-radius: 12px;
    font-size: 13px;
  }

  .last-result {
    grid-area: result;
    width: min(100%, 820px);
    min-height: clamp(56px, 6.4svh, 70px);
    margin: 0 auto;
    padding: 10px 18px;
    gap: 12px;
    border-radius: 15px;
  }

  .result-text {
    gap: 4px;
    min-width: 0;
  }

  .result-text small {
    font-size: 10px;
    letter-spacing: .14em;
  }

  .result-text strong {
    font-size: 13px;
  }

  .result-multiplier {
    min-width: 66px;
    font-size: 29px;
  }
}

/* Compact layout for shorter desktop screens and laptops */
@media (min-width: 901px) and (max-height: 820px) {

  .app-shell {
    padding-top: 7px;
    padding-bottom: 8px;
    gap: 4px;
  }

  .topbar {
    min-height: 72px;
  }

  .balance-asset {
    height: 66px;
  }

  .wheel-stage {
    height: min(100%, 53svh, 560px);
  }

  .spin-button {
    height: 76px;
  }

  .bet-asset {
    height: 60px;
  }

  .bet-presets {
    margin-top: 5px;
  }

  .bet-presets button {
    min-height: 32px;
    padding-block: 6px;
  }

  .last-result {
    min-height: 52px;
  }
}


/* PHOENIX WHEEL V15 - enlarged desktop interface */
@media (min-width: 901px) {

  /* Give the enlarged vertical layout room without collisions */
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100svh;
    padding-bottom: 16px;
  }

  .topbar {
    min-height: 84px;
    grid-template-columns: 66px minmax(0, 1fr) auto;
    gap: 14px;
  }

  /* All five header buttons: +40% */
  .topbar .tool-button {
    width: 59px;
    height: 59px;
    flex-shrink: 0;
  }

  .utility {
    gap: 9px;
  }

  /* Balance frame: +20% */
  .balance-asset {
    height: clamp(89px, 9.6svh, 113px);
  }

  /* Keep the balance centered for short and long values */
  .balance-asset strong {
    width: 68%;
    max-width: 68%;
    margin-left: 12%;
    padding: 0 12px;
    font-size: clamp(29px, 2.5vw, 40px);
  }

  /* Wheel: target +40%, preserve circular proportions */
  .wheel-stage {
    width: min(100%, 79.8svh, 910px);
    height: min(79.8svh, 910px);
    max-width: 100%;
    max-height: none;
    aspect-ratio: 1 / 1;
    justify-self: center;
  }

  .wheel-assembly {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
  }

  /* SPIN height: +25% */
  .spin-button {
    height: clamp(103px, 11.875svh, 140px);
  }

  .spin-title {
    font-size: clamp(38px, 3.2vw, 50px);
  }

  /* Bet area: +25% */
  .bet-section > .field-heading {
    font-size: 15px;
    margin-bottom: 7px;
  }

  .bet-asset {
    height: clamp(83px, 9svh, 103px);
  }

  .bet-step-button {
    width: 72px;
    height: 75px;
  }

  .bet-value {
    font-size: clamp(31px, 2.6vw, 42px);
  }

  .bet-presets {
    gap: 13px;
    margin-top: 9px;
  }

  .bet-presets button {
    min-height: clamp(43px, 5svh, 53px);
    padding: 10px 6px;
    border-radius: 13px;
    font-size: 15px;
  }

  /* Last result area: +25% */
  .last-result {
    min-height: clamp(70px, 8svh, 88px);
    padding: 13px 20px;
    gap: 16px;
  }

  .result-text small {
    font-size: 12px;
  }

  .result-text strong {
    font-size: 15px;
  }

  .result-multiplier {
    min-width: 76px;
    font-size: 34px;
  }
}

/* Short desktop/laptop screens: retain proportions, prevent overlap */
@media (min-width: 901px) and (max-height: 820px) {

  .topbar {
    min-height: 76px;
  }

  .topbar .tool-button {
    width: 59px;
    height: 59px;
  }

  .balance-asset {
    height: 80px;
  }

  .wheel-stage {
    width: min(100%, 74.2svh, 784px);
    height: min(74.2svh, 784px);
  }

  .spin-button {
    height: 95px;
  }

  .bet-asset {
    height: 75px;
  }

  .bet-step-button {
    width: 66px;
    height: 68px;
  }

  .bet-presets button {
    min-height: 40px;
  }

  .last-result {
    min-height: 65px;
  }
}


/* PHOENIX WHEEL V16 - desktop balance and wheel alignment */
@media (min-width: 901px) {

  /* Balance value: true center of the frame */
  .balance-asset {
    position: relative;
  }

  .balance-asset strong {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    width: 66% !important;
    max-width: 66% !important;
    padding: 0 8px !important;
    box-sizing: border-box;
    text-align: center !important;
    white-space: nowrap;
  }

  /* Close transparent gaps between wheel disc and outer frame */
  .wheel-rotor {
    inset: 0 !important;
  }

  .wheel-face {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

}
