/* N-Slice preserves ornaments while the straight frame sections stretch. */
:root{--gold:#efc455;--gold-hi:#ffe69c;--gold-lo:#bb892c}
.control-panel,.action-dock{
  /* Obby footer logo: exact brand color with lighter/darker UI tones. */
  --bet-brand:#f8ff13;
  --bet-brand-hi:#fcff99;
  --bet-brand-lo:#c5cc0f;
  --bet-brand-line:#f8ff132e;
  --bet-brand-line-strong:#f8ff1380;
  --gold:var(--bet-brand);
  --gold-hi:var(--bet-brand-hi);
  --gold-lo:var(--bet-brand-lo);
}
.game-layout{
  --panel-width:416px;
  --composition-gap:24px;
  display:grid;
  grid-template-columns:var(--panel-width) minmax(0,min(calc(100vw - var(--panel-width) - 2 * var(--layout-inset) - var(--composition-gap)),calc(100dvh - 90px)));
  justify-content:center;
  gap:var(--composition-gap);
}
.control-panel{
  --ornament-scale:.5;
  --panel-content-inset:64px;
  --panel-divider-inset:45px;
  --panel-section-gutter:calc(var(--panel-content-inset) - var(--panel-divider-inset));
  position:relative;
  isolation:isolate;
  width:var(--panel-width);
  margin-block:calc(8px - var(--layout-inset));
  padding:32px var(--panel-content-inset);
  gap:0;
  border:0;
  border-radius:0;
  background:none;
  box-shadow:none;
  backdrop-filter:none;
}
/* Opaque gold decoration overlays the live controls; the center is empty. */
.panel-art{position:absolute;inset:-14px 0;overflow:hidden;z-index:6;pointer-events:none}
/* Explicit paint order: surface 0, live UI 1 (sticky tabs 5), ornament 6. */
.mode-tabs,.bet-controls,.control-panel .action-stack{position:relative;z-index:1}
/* Fixed ornaments and flexible rails use the same crop and scale as Coins. */
.panel-art .n-slice{
  position:absolute;
  left:calc(-48px * var(--ornament-scale));
  top:calc(-82px * var(--ornament-scale));
  width:calc(100% + 100px * var(--ornament-scale));
  height:calc(100% + 178px * var(--ornament-scale));
}
.bet-controls{
  gap:24px;
  margin-right:calc(8px - var(--panel-section-gutter));
  padding:24px calc(var(--panel-section-gutter) - 7px) 24px 1px;
  scrollbar-gutter:stable;
  scrollbar-color:var(--bet-brand-line-strong) transparent;
}
/* The mode switch and actions bound the scrolling fields. Their rules meet
   the inner gold rails; controls sit farther in for breathing room. */
.mode-tabs{
  margin-inline:calc(-1 * var(--panel-section-gutter));
  padding:0 var(--panel-section-gutter) 16px;
  gap:8px;
  border:0;
  border-bottom:1px solid var(--bet-brand-line);
  border-radius:0;
  background:none;
}
.mode-tabs button{border-radius:10px;padding:17px 5px;color:#cecfca;font-weight:500}
.mode-tabs .active{color:var(--bet-brand);background:linear-gradient(160deg,#303514b3,#20251099 55%,#141a13);box-shadow:inset 0 0 0 1px var(--bet-brand-line-strong),inset 0 1px #fcff9926}
.mode-selector{
  display:flex;
  flex:1;
  min-width:0;
  gap:4px;
  padding:4px;
  border-radius:13px;
  background:#080f0db3;
  box-shadow:inset 0 1px 4px #0006;
}
.mode-selector button{min-height:44px;padding:12px 5px;border-radius:9px;color:#aeb6aa;font-weight:600}
.mode-selector .active{background:linear-gradient(#f8ff1326,#f8ff1314);box-shadow:inset 0 0 0 1px #f8ff133d,inset 0 1px #fcff991a}
.mode-selector button:not(.active):not(:disabled):hover{background:#ffffff08}
.active-dot{background:var(--bet-brand);box-shadow:0 0 5px #f8ff1333}
.mode-tabs .active:before,.mode-tabs .active:after,.primary-action:before,.primary-action:after{content:none}
.field-label{color:#c4c5be;font-size:13px;font-weight:500}
.bet-amount-group{gap:12px}
.bet-amount-group>.field-label{margin:0;line-height:20px}
.mine-selector>.field-label,.auto-field>.field-label{margin-bottom:10px;line-height:20px}
.input-shell,.input-shell:focus-within{height:64px;min-height:64px;border-color:var(--bet-brand-line);border-radius:11px;background:linear-gradient(155deg,#181c1c,#070b0c 70%);box-shadow:inset 0 1px #fff1,inset 0 -2px 8px #0006}
.input-shell{cursor:text}
.input-value,.input-shell input{height:100%}
.input-shell input{color:#f4f3ed}
.input-shell input:focus-visible{outline:none;outline-offset:0;box-shadow:none}
/* Dim the entire disabled field once, including units and accessory controls. */
.bet-controls .input-shell:has(input:disabled){opacity:.4;cursor:not-allowed}
.bet-controls .input-shell input:disabled,.bet-controls .input-shell button:disabled{opacity:1}
.input-currency{color:var(--bet-brand-hi);font-size:18px;font-weight:500;letter-spacing:0}
.inline-adjust button{border-left-color:var(--bet-brand-line);color:#deded5}
.auto-mode .inline-adjust button{width:58px}
.half-double-row button,.mine-options button,.random-action{
  border-color:var(--bet-brand-line);
  border-radius:10px;
  color:#e0e0d9;
  background:linear-gradient(150deg,#1b2020,#080c0d 76%);
  box-shadow:inset 0 1px #fff1,inset 0 -1px #0008;
}
.half-double-row button{font-weight:500}
.mine-options{gap:8px}
.mine-options button{height:40px;font-weight:500;border-radius:8px}
.mine-options button[aria-pressed=true]{
  color:#141807;
  background:linear-gradient(165deg,#fcff74,var(--bet-brand) 40%,var(--bet-brand-lo));
  border-color:var(--bet-brand);
  box-shadow:inset 0 1px #fff7,0 0 10px #f8ff131a;
  font-weight:700;
}
.primary-action{
  border-radius:12px;
  border-color:var(--bet-brand);
  background:linear-gradient(170deg,#fcff74,var(--bet-brand) 30%,var(--bet-brand) 70%,#dce311);
  color:#141807;
  box-shadow:inset 0 1px #fff8,inset 0 -2px #8e960a66,0 0 18px #f8ff1314;
  font-weight:700;
}
.primary-action.cashout{background:linear-gradient(170deg,var(--bet-brand-hi),var(--bet-brand) 45%,#e1e916);box-shadow:inset 0 1px #fff8,0 0 22px #f8ff1326}
.primary-action:disabled{background:linear-gradient(#272c1d,#12170f);color:#8c927e;border-color:#f8ff1326;box-shadow:inset 0 1px #fff1}
.primary-action.is-pending:disabled{background:linear-gradient(170deg,var(--bet-brand-hi),var(--bet-brand) 45%,#e1e916);color:#141807;border-color:var(--bet-brand);box-shadow:inset 0 2px 6px #0005;transform:scale(.98);filter:brightness(.86);cursor:progress}
.auto-field .input-shell>span,.auto-field .input-shell>button{color:var(--bet-brand-hi);font-weight:500}
.control-panel button:focus-visible,.action-dock button:focus-visible{outline:2px solid var(--bet-brand);outline-offset:3px}
.auto-settings{gap:24px}
.auto-pairs{gap:12px}
.random-action{font-size:16px}
.control-panel .action-stack{
  margin-inline:calc(-1 * var(--panel-section-gutter));
  padding:16px var(--panel-section-gutter) 0;
  border-top:1px solid var(--bet-brand-line);
  gap:12px;
}

@media(orientation:landscape) and (max-width:1279px){
  .game-layout{--panel-width:376px;--composition-gap:20px}
  .control-panel{--ornament-scale:.43;--panel-content-inset:58px;--panel-divider-inset:40px}
  .inline-adjust button{width:58px}
}
@media(orientation:landscape) and (max-height:640px){
  .game-layout{--panel-width:340px;--composition-gap:16px}
  .control-panel{--ornament-scale:.35;--panel-content-inset:46px;--panel-divider-inset:32px;padding:24px var(--panel-content-inset)}
  .mode-tabs button{padding-block:12px}
  .mode-tabs{padding-bottom:12px}
  .bet-controls{padding-block:16px}
  .control-panel .action-stack{padding-top:12px}
}
@media(orientation:portrait){
  .game-layout{display:flex;justify-content:flex-start;gap:0}
  .control-panel{
    --ornament-scale:.3;
    --panel-content-inset:40px;
    --panel-divider-inset:28px;
    width:min(430px,calc(100% - 16px));
    margin:12px auto 8px;
    padding:22px var(--panel-content-inset);
  }
  .mode-tabs{
    position:sticky;
    top:0;
    z-index:5;
    padding-top:12px;
    margin-top:-12px;
    background:#0a0e0f;
  }
  .bet-controls{gap:24px;margin-right:0;padding:24px 1px;overflow:visible;scrollbar-gutter:auto}
  .inline-adjust button,.auto-mode .inline-adjust button{width:44px}
  .input-value{padding-inline:10px}
  .input-shell input{font-size:20px}
  .input-currency{font-size:17px}
  .action-dock{background:#090d0e}
  .action-dock .action-stack{
    position:relative;
    width:100%;
    margin-inline:0;
    padding:12px var(--mobile-edge,12px);
    border:0;
    background:none;
    gap:10px;
  }
  .action-dock .primary-action{height:56px;min-height:56px;font-size:20px}
  .action-dock .random-action{height:48px;min-height:48px;font-size:14px;gap:8px}
  .action-dock .random-action svg{width:22px;height:22px}
  .action-dock .action-stack:before{
    content:'';
    position:absolute;
    top:0;
    left:var(--mobile-edge,12px);
    right:var(--mobile-edge,12px);
    height:1px;
    background:var(--bet-brand-line);
  }
  .auto-pairs .field-label{font-size:11px;line-height:18px;min-height:36px;display:flex;align-items:center}
  .auto-field input{padding-inline:10px}
  .auto-field .input-shell>span,.auto-field .input-shell>button{padding-inline:10px;font-size:18px}
}

/* Round figures stay visible beside the actions while bet fields scroll. */
.round-preview,.auto-progress{display:flex;flex-direction:column;gap:8px;padding-bottom:4px;font-variant-numeric:tabular-nums}
.round-preview>div,.auto-progress>div{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:12px;line-height:18px;color:#adb5a8}
.round-preview output,.auto-progress output{color:#f4f3ed;font-size:14px;font-weight:500;white-space:nowrap}
.auto-progress .progress-label{flex-shrink:0}
.auto-progress output{min-width:0;white-space:normal;overflow-wrap:anywhere;text-align:right}
.auto-progress output.positive{color:var(--bet-brand-hi)}
.round-preview .max-win-stat{flex-wrap:wrap;row-gap:4px}
.round-preview .max-win-stat output{margin-left:auto;color:var(--bet-brand-hi)}
.manual-progress{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding:0 0 4px;font-variant-numeric:tabular-nums}
.progress-stat{min-width:0;display:flex;flex-direction:column;gap:7px}
.progress-heading{display:flex;align-items:center;justify-content:flex-start;gap:6px}
.progress-label{font-size:12px;line-height:16px;color:#adb5a8}
.progress-multiplier{font-size:12px;line-height:16px;color:var(--bet-brand-hi);padding:2px 5px;border-radius:4px;background:#f8ff1312;font-variant-numeric:tabular-nums}
.progress-stat output{font-size:17px;line-height:24px;font-weight:500;white-space:nowrap;color:#f4f3ed;letter-spacing:-.3px}
.progress-stat output.negative{color:#ee9988}
.footer-balance{display:flex;flex-direction:column;gap:3px;min-width:0;margin-left:8px;font-variant-numeric:tabular-nums;white-space:nowrap}
.footer-balance>span{color:#a6afa5;font-size:11px;line-height:14px}
.footer-balance output{font-size:16px;line-height:20px;color:#f4f3ed}
.game-footer .secondary-button{flex-shrink:0}
.footer-brand>.footer-logo-short{display:none;width:auto;height:calc(var(--footer-logo-full-width,134px) * 20 / 223);max-width:none}
.history-popover{left:auto;right:16px;width:390px;max-width:calc(100vw - 32px)}
.history-popover .subscreen{font-variant-numeric:tabular-nums}
@media(orientation:landscape) and (max-width:1050px){
  .game-footer .secondary-button{width:auto;padding-inline:12px;font-size:13px}
  .footer-brand,.footer-brand img{width:170px;height:auto}
  .footer-balance{margin-left:0}
  .footer-balance output{font-size:14px}
}
@media(orientation:landscape) and (max-height:640px){
  .control-panel .action-stack{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .manual-progress,.round-preview,.auto-progress{grid-column:1/-1;gap:6px;padding:0}
  .progress-multiplier{padding-block:0}
  .progress-stat{gap:3px}
  .progress-stat output{font-size:15px;line-height:20px}
  .control-panel .primary-action{grid-column:1/-1;height:52px;min-height:52px;font-size:18px}
  .control-panel .action-stack:has(#random:not([hidden])) .primary-action{grid-column:auto;font-size:12px;white-space:normal;line-height:16px}
  .control-panel .random-action{height:52px;min-height:52px;font-size:11px;line-height:16px;gap:5px}
  .control-panel .random-action svg{width:20px;height:20px}
}
@media(orientation:portrait){
  :root{--mobile-edge:12px;--mobile-footer-height:calc(84px + env(safe-area-inset-bottom,0px))}
  .round-preview{display:grid;grid-template-columns:minmax(60px,.8fr) minmax(0,1.45fr) minmax(0,1.6fr);grid-template-rows:auto auto;gap:7px 8px;padding:0}
  .round-preview.auto-preview{grid-template-columns:minmax(60px,.8fr) minmax(0,2fr)}
  .round-preview>div{display:grid;grid-row:span 2;grid-template-rows:subgrid;align-items:start;justify-content:stretch;gap:7px;min-width:0;font-size:12px;line-height:16px}
  .round-preview>div>.progress-heading{min-height:20px}
  .round-preview output{font-size:17px;line-height:24px;font-weight:500;letter-spacing:-.3px;color:#f4f3ed}
  .round-preview .max-win-stat{row-gap:7px}
  .round-preview .max-win-stat .progress-heading{align-content:start;align-items:baseline;flex-wrap:wrap;gap:2px 6px}
  .round-preview .max-win-stat output{margin:0;color:#f4f3ed;white-space:normal;overflow-wrap:anywhere}
  .auto-progress{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:auto auto;gap:4px 8px;padding:0}
  .auto-progress>div{display:grid;grid-row:span 2;grid-template-rows:subgrid;align-items:start;justify-content:stretch;gap:4px;min-width:0;font-size:12px;line-height:16px}
  .auto-progress .progress-label{align-self:end}
  .auto-progress output{font-size:17px;line-height:24px;font-weight:500;letter-spacing:-.3px;text-align:left}
  .manual-progress{gap:16px}
  .game-footer{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:44px 12px;gap:4px;padding:11px var(--mobile-edge) calc(11px + env(safe-area-inset-bottom,0px));min-height:var(--mobile-footer-height)}
  .footer-left,.footer-right{gap:8px}
  .game-footer .secondary-button,.game-footer .history-button{width:44px;height:44px;min-height:44px;padding:0}
  .footer-balance{margin-left:0;gap:1px}
  .footer-balance>span{font-size:10px;line-height:12px}
  .footer-balance output{font-size:13px;line-height:18px;max-width:100%;overflow:hidden;text-overflow:ellipsis}
  .game-footer .history-button span{display:none}
  .game-footer .history-button svg{width:20px;height:20px}
  .footer-brand{grid-row:2;grid-column:1/-1;justify-self:center;width:134px;max-width:100%}
  .footer-brand img{width:134px;height:12px}
  .history-popover{left:0;right:0;width:100%;max-width:100%}
}
@media(orientation:portrait) and (min-width:375px){
  :root{--mobile-footer-height:calc(65px + env(safe-area-inset-bottom,0px))}
  .game-footer{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);grid-template-rows:44px;column-gap:10px;row-gap:0;padding-block:10px calc(10px + env(safe-area-inset-bottom,0px))}
  .footer-brand{--footer-logo-full-width:clamp(92px,25vw,134px);grid-row:1;grid-column:2;width:auto;max-width:none}
  .footer-brand .footer-logo-full{width:var(--footer-logo-full-width);height:auto;max-width:none}
  .footer-brand-compact .footer-logo-full{display:none}
  .footer-brand-compact .footer-logo-short{display:block}
  .footer-left{gap:6px}
  .footer-balance output{font-size:12px}
}
@media(orientation:portrait) and (min-width:440px){
  .footer-left{gap:8px}
  .footer-balance output{font-size:13px}
}

/* Temporary Obby logo proportions for the local obby-coin branch. */
.footer-brand{width:96px}
.footer-brand>.footer-logo-full{width:96px;height:auto}
.footer-brand>.footer-logo-short{width:auto;height:26px}
@media(orientation:portrait) and (max-width:374px){
:root{--mobile-footer-height:calc(96px + env(safe-area-inset-bottom,0px))}
.game-footer{grid-template-rows:44px 24px}
.footer-brand{width:60px}
.footer-brand>.footer-logo-full{width:60px;height:20px}
}
@media(orientation:portrait) and (min-width:375px){
.footer-brand{--footer-logo-full-width:clamp(72px,19.2vw,96px);width:auto}
.footer-brand .footer-logo-full{width:var(--footer-logo-full-width);height:auto}
}
