/* A fresh glass-panel layout for GreekDice. The existing page background stays intact. */
:root {
  --glass-panel: rgba(10, 16, 29, .78);
  --glass-panel-strong: rgba(9, 14, 26, .9);
  --glass-border: rgba(207, 222, 255, .24);
  --glass-gold: #ffd21a;
  --glass-cyan: #62d9ef;
}

.page-shell { max-width: 1480px; padding-top: 14px; }
.topbar { height: auto; min-height: 42px; }
.site-banner { width: min(100%, 1040px); margin: 8px auto 0; }
.site-banner img { display: block; width: 100%; height: auto; }

.game-layout {
  width: min(100%, 1120px);
  max-width: 1120px;
  grid-template-columns: minmax(190px, 245px) minmax(390px, 1fr) minmax(190px, 245px);
  gap: clamp(10px, 1.5vw, 20px);
  align-items: stretch;
  margin-top: clamp(18px, 3vh, 32px);
}

.vip-panel, .roller-card, .history-section, .vip-login-section {
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  background: var(--glass-panel);
  box-shadow: 0 18px 48px rgba(0,0,0,.32), inset 0 1px rgba(255,255,255,.08);
  -webkit-backdrop-filter: blur(12px) saturate(125%);
  backdrop-filter: blur(12px) saturate(125%);
}

.vip-panel {
  min-height: 0;
  padding: 18px 14px;
  align-self: start;
  margin-top: 8px;
}
.vip-panel h2 { font-size: 18px; }
.vip-caption { color: rgba(240,245,255,.72); }
.vip-card { background: rgba(255,255,255,.09); border-color: rgba(230,239,255,.25); }
.vip-card:hover { transform: translateY(-2px); border-color: var(--glass-cyan); background: rgba(255,255,255,.14); }
.vip-card.is-active { box-shadow: 0 0 0 1px rgba(255,48,79,.5), 0 8px 26px rgba(255,48,79,.2)!important; }

.roller-card {
  width: 100%;
  min-height: 0;
  padding: clamp(20px, 3vw, 32px) clamp(16px, 3vw, 30px) 24px;
  background: var(--glass-panel-strong);
  border-color: rgba(214,229,255,.34);
  box-shadow: 0 24px 65px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.11);
}
.game-title { margin-bottom: 18px; }
.game-title h1 { text-shadow: 0 3px 18px rgba(0,0,0,.6); }
.dice-stage { min-height: 138px; margin: 8px 0 12px; border-radius: 16px; background: rgba(255,255,255,.045); }
.roll-summary { color: rgba(248,250,255,.88); }
.verify-id-strip { border: 1px solid rgba(255,255,255,.15); border-radius: 12px; background: rgba(255,255,255,.075); }
.dice-toolbar {
  position: relative; z-index: 2; display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap; margin: 0 auto 8px; padding: 7px;
  border: 1px solid rgba(207,222,255,.16); border-radius: 15px; background: rgba(3,8,18,.58);
}
.toolbar-count, .toolbar-theme select, .toolbar-mode, .toolbar-settings summary, .toolbar-verify {
  min-height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(207,222,255,.18); border-radius: 11px; background: rgba(2,8,20,.9);
  color: #f6f8ff; font: 800 11px 'Nunito Sans',sans-serif;
}
.toolbar-count { gap: 5px; padding: 0 10px; }
.toolbar-count select, .toolbar-theme select { border: 0; outline: 0; color: inherit; background: transparent; font: inherit; cursor: pointer; }
.toolbar-count select { width: 38px; padding-right: 11px; appearance: none; text-align: left; background-image: linear-gradient(45deg,transparent 50%,#bdc9df 50%),linear-gradient(135deg,#bdc9df 50%,transparent 50%); background-position: calc(100% - 5px) 16px,calc(100% - 1px) 16px; background-size: 4px 4px,4px 4px; background-repeat: no-repeat; }
.toolbar-mode select { max-width: 132px; padding: 0 20px 0 10px; border: 0; outline: 0; appearance: none; color: inherit; background-color: transparent; background-image: linear-gradient(45deg,transparent 50%,#bdc9df 50%),linear-gradient(135deg,#bdc9df 50%,transparent 50%); background-position: calc(100% - 8px) 17px,calc(100% - 4px) 17px; background-size: 4px 4px,4px 4px; background-repeat: no-repeat; font: inherit; cursor: pointer; }
.toolbar-count option, .toolbar-theme option { color: #172033; }
.toolbar-mode option { color: #172033; }
.toolbar-mode { padding: 0 12px; color: #c9d6ef; font-weight: 700; }
.toolbar-theme select { max-width: 108px; padding: 0 10px; }
.toolbar-settings { position: relative; }
.toolbar-settings summary { width: 40px; list-style: none; cursor: pointer; font-size: 18px; }
.toolbar-settings summary::-webkit-details-marker { display: none; }
.toolbar-settings[open] summary, .toolbar-settings summary:hover, .toolbar-verify:hover { border-color: rgba(98,217,239,.65); color: #fff; }
.toolbar-settings-popover {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  width: max-content; max-width: min(300px, calc(100vw - 44px)); padding: 12px;
  border: 1px solid var(--glass-border); border-radius: 13px; background: rgba(8,13,25,.97); box-shadow: 0 14px 32px #0009;
}
.toolbar-settings-title { margin-right: 2px; color: #e6ebf8; font-size: 11px; font-weight: 900; }
.toolbar-settings-popover .sound-toggle, .toolbar-settings-popover .dice-blur-switch { margin: 0; }
.toolbar-verify { padding: 0 12px; text-decoration: none; }
.dice-counter-controls button { border-radius: 10px; }
.roller-card[data-accent="crimson"] { --glass-gold: #ff586e; --glass-cyan: #ffa3b0; }
.roller-card[data-accent="aegean"] { --glass-gold: #54d8e8; --glass-cyan: #9af2fa; }
.roller-card[data-accent="silver"], .roller-card[data-accent="dark"], .roller-card[data-accent="navy"] { --glass-gold: #c4d5f0; --glass-cyan: #92b7e3; }
.roller-card[data-accent="forest"] { --glass-gold: #63d49a; --glass-cyan: #a4e4bd; }
.roller-card[data-accent="farlands"] { --glass-gold: #ffae69; --glass-cyan: #ffd292; }
.roller-card[data-accent="ocean"] { --glass-gold: #45c7e8; --glass-cyan: #a4ebff; }
.roller-card[data-accent="halloween"] { --glass-gold: #ff9b38; --glass-cyan: #c78aff; }
.roller-card[data-accent="bloodmoon"] { --glass-gold: #ef5365; --glass-cyan: #ff99a4; }
.roll-button#roll-button {
  border: 1px solid color-mix(in srgb, var(--glass-gold), white 35%);
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--glass-gold), white 25%), var(--glass-gold));
  box-shadow: 0 7px 0 color-mix(in srgb, var(--glass-gold), black 42%), 0 12px 28px color-mix(in srgb, var(--glass-gold), transparent 80%);
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}
.roll-button#roll-button:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 9px 0 color-mix(in srgb, var(--glass-gold), black 42%), 0 16px 32px color-mix(in srgb, var(--glass-gold), transparent 72%); }
.roll-button#roll-button:active { transform: translateY(2px); box-shadow: 0 4px 0 color-mix(in srgb, var(--glass-gold), black 42%); }
.dice-counter-controls button, .dice-counter-controls output { border-color: rgba(220,232,255,.22); background-color: rgba(255,255,255,.1); }
.dice-counter-controls output { border-radius: 10px; }

.history-section {
  width: min(100%, 590px)!important;
  max-width: 590px!important;
  margin: 18px auto 0;
  padding: 16px 18px;
}
.history-heading h2 { font-size: clamp(19px, 2vw, 25px); }
.history-item { border-color: rgba(225,235,255,.2); }
.stat-chip { border-radius: 8px; }
.history-pagination { border-color: rgba(225,235,255,.2); }
.history-pagination button { border-radius: 9px; }
.theme-status { margin: 0 auto 8px; color: #bcd3ef; font-size: 11px; text-align: center; }
.coin-face {
  display: grid; place-items: center; flex: 0 0 auto;
  width: clamp(54px,8vw,76px); aspect-ratio: 1; border: 5px solid #ffe07b; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,#fff1a9,#d79818 68%,#795300);
  color: #302000; font: 900 11px 'Nunito Sans',sans-serif; text-transform: uppercase;
  box-shadow: inset 0 0 0 3px #fff6,0 5px 0 #775616,0 10px 20px #0007;
}
.coin-face.rolling { animation: coin-toss .22s linear infinite alternate; }
.coin-face.landing { animation: coin-land .28s ease-out both; }
.wheel-face {
  position: relative; display: block; flex: 0 0 auto; width: clamp(110px,22vw,180px); aspect-ratio: 1;
  border: 7px solid #fff; border-radius: 50%;
  background: conic-gradient(#d94f50 0 60deg,#df842c 60deg 120deg,#ffff00 120deg 180deg,#389268 180deg 240deg,#3e78ba 240deg 300deg,#8000ff 300deg 360deg);
  box-shadow: inset 0 0 0 3px #fff8,0 7px 0 #677080,0 13px 24px #0008;
}
.wheel-face::before { position:absolute; top:-16px; left:50%; width:0;height:0; border-left:10px solid transparent;border-right:10px solid transparent;border-top:19px solid #ffe04b;content:"";transform:translateX(-50%);filter:drop-shadow(0 2px 2px #0008); }
.wheel-face::after { position:absolute; inset:36%; border:4px solid #fff; border-radius:50%; background:var(--wheel-result,#162238); content:""; box-shadow:0 2px 8px #0007; }
.wheel-face.rolling { animation: wheel-spin 1.45s cubic-bezier(.14,.66,.24,1) both; }
.wheel-face.landing { transform:rotate(0); }
@keyframes coin-toss { from{transform:rotateY(0) scaleX(1)} to{transform:rotateY(80deg) scaleX(.35)} }
@keyframes coin-land { 0%{transform:translateY(-12px) rotate(20deg)} 65%{transform:translateY(2px) rotate(-8deg)} 100%{transform:none} }
@keyframes wheel-spin { to{transform:rotate(1440deg)} }
html[data-dice-theme="silver"] .voxel-sky { background:radial-gradient(ellipse at 50% 25%,#697481,#262e39 56%,#0b1018); }
html[data-dice-theme="dark"] .voxel-sky { background:radial-gradient(ellipse at 50% 35%,#30333a,#111319 65%,#050609); }
html[data-dice-theme="navy"] .voxel-sky { background:radial-gradient(ellipse at 50% 20%,#174578,#0b1b35 56%,#050914); }
html[data-dice-theme="forest"] .voxel-sky { background:radial-gradient(ellipse at 50% 22%,#31664a,#132d24 56%,#07120e); }
html[data-dice-theme="crimson"] .voxel-sky { background:radial-gradient(ellipse at 50% 22%,#8e283c,#3a111f 58%,#10070d); }
html[data-dice-theme="farlands"] .voxel-sky { background:radial-gradient(ellipse at 50% 20%,#b87949,#573728 55%,#1a1314); }
html[data-dice-theme="ocean"] .voxel-sky { background:radial-gradient(ellipse at 50% 18%,#247899,#104157 56%,#07151d); }
html[data-dice-theme="halloween"] .voxel-sky { background:radial-gradient(ellipse at 50% 20%,#713898,#29153e 56%,#0d0714); }
html[data-dice-theme="bloodmoon"] .voxel-sky { background:radial-gradient(ellipse at 50% 18%,#83242c,#321018 54%,#090609); }

.custom-background-image { display:none; }
.file-picker-input { position:fixed; left:-10000px; top:0; width:1px; height:1px; opacity:0; overflow:hidden; }
.voxel-sky[data-custom-background="true"] .custom-background-image { position:absolute; z-index:0; inset:0; display:block; width:100%; height:100%; object-fit:cover; object-position:center; }
.voxel-sky[data-custom-background="true"]::before { display:none; }
.voxel-sky[data-custom-background="true"]::after { position:absolute; z-index:1; inset:0; height:auto; border:0; background:rgba(4,8,18,.12); opacity:1; content:""; }
.voxel-sky[data-custom-background="true"] > :not(.custom-background-image) { display:none; }

@media (max-width: 980px) {
  .game-layout { width: min(100%, 760px); grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
  .roller-card { grid-column: 1/-1; grid-row: 1; width: min(100%, 560px); max-width: 560px; justify-self: center; }
  .vip-panel { min-height: 0; margin-top: 0; }
  .history-section { width: min(100%, 560px)!important; max-width: 560px!important; }
}
@media (max-width: 640px) {
  .page-shell { padding: 10px 12px 30px; }
  .site-banner { margin-top: 5px; }
  .game-layout { width: min(100%, 470px); grid-template-columns: minmax(0,1fr); gap: 10px; margin-top: 16px; }
  .roller-card { grid-column: 1; grid-row: 1; width: 100%; max-width: none; padding: 18px 13px 20px; }
  .dice-toolbar { gap: 5px; padding: 6px; }
  .toolbar-count, .toolbar-theme select, .toolbar-mode, .toolbar-settings summary, .toolbar-verify { min-height: 36px; border-radius: 10px; font-size: 10px; }
  .toolbar-count, .toolbar-verify { padding-inline: 8px; }
  .toolbar-theme select { max-width: 88px; padding-inline: 7px; }
  .toolbar-mode { padding-inline: 9px; }
  .toolbar-settings summary { width: 36px; }
  .vip-panel { width: 100%; padding: 14px 12px; }
  .vip-list { display: grid; grid-template-columns: 1fr; }
  .dice-stage { min-height: 112px; }
  .history-section { width: 100%!important; max-width: 470px!important; margin-top: 12px; padding: 13px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .roll-button#roll-button, .vip-card { transition: none; }
}

/* Full-page composition: centered play column with compact supporting sections. */
.page-shell { max-width: 1380px; padding: 14px clamp(14px,3vw,38px) 40px; }
.topbar { max-width: 1160px; margin: 0 auto; }
.site-banner { width: min(100%, 790px); margin: 8px auto 0; }
.site-announcement { width: min(100%, 760px); margin: 12px auto 0; }
.game-layout {
  display: grid;
  width: min(100%, 650px);
  max-width: 650px;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  align-items: start;
  gap: 12px;
  margin: 18px auto 0;
}
.roller-card {
  grid-column: 1/-1;
  grid-row: 1;
  width: 100%;
  max-width: none;
  min-height: 0;
  padding: clamp(20px,4vw,32px) clamp(16px,4vw,30px) 20px;
  border-radius: 22px;
  background: linear-gradient(155deg,rgba(15,24,42,.96),rgba(7,13,26,.93));
  box-shadow: 0 24px 70px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.12);
}
.game-title { margin-bottom: 16px; }
.game-title p { color: #ffdc32; }
.game-title h1 { font-size: clamp(30px,5vw,42px); }
.game-title span { font-size: 16px; }
.dice-toolbar { margin: 0 auto 12px; padding: 7px; border: 0; background: transparent; }
.toolbar-count, .toolbar-theme select, .toolbar-mode, .toolbar-settings summary, .toolbar-verify {
  min-height: 40px;
  border: 1px solid rgba(148,177,228,.22);
  border-radius: 12px;
  background: rgba(2,8,20,.92);
  box-shadow: 0 5px 14px rgba(0,0,0,.2);
}
.toolbar-count select { width: 34px; }
.toolbar-mode { color: #ecf2ff; }
.toolbar-verify { color: #edf3ff; }
.dice-stage {
  min-height: 138px;
  margin: 8px 0 0;
  padding: 18px 8px;
  border: 1px solid rgba(211,225,255,.04);
  border-radius: 17px;
  background: rgba(255,255,255,.045);
}
.roll-summary { min-height: 34px; padding: 11px 0 0; border-top: 1px dashed rgba(224,233,250,.24); font-weight: 800; }
.verify-id-strip {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto auto;
  align-items: center;
  gap: 8px 14px;
  width: 100%;
  margin: 8px auto 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.065);
}
.verify-id-strip>span { grid-column: 1/-1; justify-content: center; }
.verify-id-strip .copy-room, .verify-id-strip>a { justify-self: center; }
.verify-id-strip .copy-room, .verify-id-strip>a, .toolbar-verify { color: #ffe04b; }
.roll-button#roll-button { width: 100%; height: 54px; min-width: 0; margin-top: 14px; font-size: 21px; }
.dice-counter { margin: 10px auto 0; }
.dice-counter-controls { width: min(100%, 290px); }
.keyboard-hint { margin-top: 11px; }
.vip-panel {
  grid-row: 2;
  align-self: start;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 13px 11px;
  border-radius: 15px;
  background: rgba(11,18,31,.82);
}
.vip-panel h2 { font-size: 15px; }
.vip-caption { margin-bottom: 8px; font-size: 9px; }
.vip-card { min-height: 56px; }
.history-section {
  width: min(100%,650px)!important;
  max-width: 650px!important;
  margin: 14px auto 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(8,14,26,.82);
}
.history-heading { gap: 8px; }
.history-heading h2 { color: #fff; font-size: clamp(18px,3vw,24px); }
.history-count, .stat-chip, .longest-streak>span { border-radius: 8px; }
.stats-panel { border-color: rgba(221,231,255,.18); border-radius: 13px; background: rgba(255,255,255,.09); }
.history-item { border-color: rgba(221,231,255,.2); }
.history-item:nth-child(even) { background: rgba(255,255,255,.025); }
.history-pagination { border-color: rgba(221,231,255,.2); }
.history-pagination button { border-radius: 9px; }
.vip-login-section, .search-info {
  width: min(100%,650px);
  margin: 14px auto 0;
  padding: 17px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: rgba(8,14,26,.78);
  color: #f4f6fb;
  box-shadow: 0 14px 38px rgba(0,0,0,.22);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.vip-login-section p, .search-info h2 { color: #ffdc32; }
.vip-login-button { border-radius: 10px; }
.color-key {
  width: min(100%,650px);
  max-width: 650px;
  margin: 14px auto 0;
  padding: 13px 16px;
  border: 1px solid rgba(221,231,255,.15);
  border-radius: 15px;
  background: rgba(8,14,26,.72);
}
.color-key>.section-label { color: rgba(240,245,255,.68); }
.color-list { gap: clamp(10px,3vw,20px); margin-top: 9px; }
.color-list span { color: #f3f5fc; }
.search-info p { color: rgba(239,244,255,.8); }
footer { color: rgba(239,244,255,.62); margin-top: 20px; }

@media (max-width: 980px) {
  .game-layout { width: min(100%,650px); max-width: 650px; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .roller-card { grid-column: 1/-1; grid-row: 1; width: 100%; max-width: none; }
  .vip-panel { min-height: 0; grid-row: 2; }
  .history-section { width: min(100%,650px)!important; max-width: 650px!important; }
}
@media (max-width: 640px) {
  .page-shell { padding: 10px 12px 28px; }
  .site-banner { width: min(100%,600px); }
  .game-layout { width: min(100%,500px); max-width: 500px; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 9px; margin-top: 12px; }
  .roller-card { grid-column: 1/-1; grid-row: 1; padding: 18px 13px; }
  .dice-toolbar { gap: 5px; padding: 4px 0 8px; }
  .toolbar-count, .toolbar-theme select, .toolbar-mode, .toolbar-settings summary, .toolbar-verify { min-height: 36px; font-size: 10px; }
  .toolbar-count { padding-inline: 8px; }
  .toolbar-count select { width: 36px; }
  .toolbar-mode { padding-inline: 8px; }
  .toolbar-theme select { max-width: 82px; padding-inline: 6px; }
  .toolbar-settings summary { width: 36px; }
  .toolbar-verify { padding-inline: 8px; }
  .dice-stage { min-height: 106px; padding: 13px 3px; }
  .vip-panel { grid-row: 2; padding: 11px 8px; }
  .vip-panel h2 { font-size: 13px; }
  .vip-caption { font-size: 8px; letter-spacing: .5px; }
  .vip-card { gap: 5px; padding: 5px; }
  .vip-avatar { width: 30px; height: 30px; }
  .vip-profile-link { margin-left: 35px; }
  .history-section, .vip-login-section, .search-info, .color-key { width: min(100%,500px)!important; max-width: 500px!important; }
  .history-section { padding: 13px 10px; }
  .verify-id-strip { gap: 8px; }
}
@media (max-width: 390px) {
  .dice-toolbar { gap: 4px; }
  .toolbar-mode { padding-inline: 6px; }
  .toolbar-theme select { max-width: 72px; }
  .toolbar-verify { padding-inline: 6px; font-size: 9px; }
  .toolbar-count, .toolbar-theme select, .toolbar-mode, .toolbar-settings summary { min-height: 34px; font-size: 9px; }
  .toolbar-settings summary { width: 32px; }
  .vip-copy strong { font-size: 11px; }
  .vip-copy small { font-size: 8px; }
}

/* The toolbar menus use a shared dark popover instead of browser-native lists. */
.game-layout { width: min(100%,720px); max-width: 720px; }
.history-section { width: min(100%,720px)!important; max-width: 720px!important; }
.toolbar-count, .toolbar-mode, .toolbar-theme { position: relative; display: block; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.menu-select { position: relative; display: block; }
.menu-select-source { position: absolute!important; width: 1px!important; height: 1px!important; margin: -1px!important; overflow: hidden!important; clip: rect(0 0 0 0)!important; clip-path: inset(50%)!important; white-space: nowrap!important; }
.menu-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-width: 120px; min-height: 40px; padding: 0 12px;
  border: 1px solid rgba(148,177,228,.22); border-radius: 12px;
  background: rgba(2,8,20,.96); color: #f5f7ff;
  box-shadow: 0 5px 14px rgba(0,0,0,.24);
  font: 800 12px 'Nunito Sans',sans-serif; text-align: left; cursor: pointer;
}
.menu-select-trigger:hover, .menu-select-trigger[aria-expanded="true"] { border-color: rgba(139,185,243,.65); background: #0e1930; }
.menu-select-trigger:focus-visible, .menu-select-option:focus-visible { outline: 2px solid #8bc4ff; outline-offset: 2px; }
.toolbar-mode .menu-select-trigger { min-width: 145px; }
.toolbar-theme .menu-select-trigger { min-width: 166px; }
.menu-select-chevron { width: 8px; height: 8px; flex: 0 0 8px; border-right: 1.5px solid #b8c6dc; border-bottom: 1.5px solid #b8c6dc; transform: translateY(-2px) rotate(45deg); transition: transform .15s ease; }
.menu-select-trigger[aria-expanded="true"] .menu-select-chevron { transform: translateY(2px) rotate(225deg); }
.menu-select-list {
  position: absolute; top: calc(100% + 5px); left: 0; z-index: 100;
  width: 128px; max-height: min(360px,65vh); overflow-y: auto; padding: 5px;
  border: 1px solid rgba(151,178,224,.2); border-radius: 12px;
  background: #101a2e; color: #f2f5fb;
  box-shadow: 0 16px 38px rgba(0,0,0,.56),inset 0 1px rgba(255,255,255,.035);
  scrollbar-color: #43536f #101a2e; scrollbar-width: thin;
}
.menu-select-list[hidden] { display: none!important; }
.toolbar-mode .menu-select-list { width: 160px; }
.toolbar-theme .menu-select-list { width: 198px; }
.menu-select-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 32px; padding: 6px 9px; border-radius: 8px;
  color: #e8edf7; font: 600 13px 'Nunito Sans',sans-serif; cursor: pointer;
}
.menu-select-option:hover, .menu-select-option:focus { outline: 0; background: #1b2a45; color: #fff; }
.menu-select-option.is-selected { color: #fff; }
.menu-select-check { color: #dce9ff; font-size: 15px; line-height: 1; opacity: 0; }
.menu-select-option.is-selected .menu-select-check { opacity: 1; }
.roller-card { overflow: visible; }
.dice-toolbar { z-index: 10; }
@media(max-width:980px) {
  .game-layout { width: min(100%,720px); max-width: 720px; }
  .history-section { width: min(100%,720px)!important; max-width: 720px!important; }
}
@media(max-width:640px) {
  .game-layout { width: min(100%,500px); max-width: 500px; }
  .history-section { width: min(100%,500px)!important; max-width: 500px!important; }
  .menu-select-trigger { min-width: 106px; min-height: 37px; padding-inline: 9px; font-size: 11px; }
  .toolbar-mode .menu-select-trigger { min-width: 128px; }
  .toolbar-theme .menu-select-trigger { min-width: 145px; }
  .menu-select-list { max-height: min(330px,60vh); }
}
@media(max-width:390px) {
  .menu-select-trigger { min-width: 98px; min-height: 35px; gap: 8px; padding-inline: 8px; font-size: 10px; }
  .toolbar-mode .menu-select-trigger { min-width: 112px; }
  .toolbar-theme .menu-select-trigger { min-width: 126px; }
  .toolbar-mode .menu-select-list { width: 150px; }
  .toolbar-theme .menu-select-list { width: 186px; }
}

.public-roll-notice { margin: -2px 0 8px; color: rgba(223,233,248,.72); text-align: center; font-size: 11px; }

/* Account shortcuts in the top right. */
.topbar {
  display: flex;
  width: min(100%, 1160px);
  margin: 0 auto;
  gap: 16px;
}
.topbar-actions {
  position: fixed; z-index: 100; top: 14px; right: 16px;
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
}
.vip-login-button, .topbar-link {
  min-height: 38px; padding: 0 15px; border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px; color: #f7f8fc; text-decoration: none; font-family: inherit; font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  background: rgba(20,27,41,.72); cursor: pointer; backdrop-filter: blur(10px);
}
.vip-login-button { background: #ffc900; border-color: #ffd83c; color: #171717; }
.vip-login-button:hover, .topbar-link:hover { filter: brightness(1.12); transform: translateY(-1px); }
.vip-login-button:disabled { opacity: .7; cursor: wait; }
@media(max-width:560px) {
  .topbar { align-items: flex-start; }
  .topbar-actions { top: 10px; right: 10px; gap: 5px; }
  .vip-login-button, .topbar-link { min-height: 34px; padding: 0 10px; font-size: 10px; }
}
@media(max-width:390px) {
  .brand { gap: 6px; font-size: 15px; }
  .brand-mark { width: 26px; height: 26px; }
  .topbar-actions { gap: 4px; }
  .vip-login-button, .topbar-link { min-height: 31px; padding: 0 7px; font-size: 9px; }
}

/* Compact, centered dice interface inspired by the supplied reference. */
[hidden] { display: none!important; }
.topbar { display: flex; }
.site-banner { width: min(100%, 740px); margin: 8px auto 0; }
.page-shell { max-width: 1000px; }
.game-layout { display: block; width: min(100%, 720px); max-width: 720px; margin: 10px auto 0; }
.vip-panel, .vip-login-section { display: none!important; }
.roller-card {
  width: 100%; max-width: none; padding: 20px clamp(15px,4vw,30px) 22px;
  border-radius: 20px; background: rgba(11,18,32,.82);
  -webkit-backdrop-filter: blur(13px) saturate(125%); backdrop-filter: blur(13px) saturate(125%);
}
.game-title { margin-bottom: 12px; }
.game-title p { margin-bottom: 3px; }
.game-title h1 { font-size: clamp(29px,5vw,40px); }
.game-title span { font-size: 15px; }
.dice-toolbar { gap: 8px; margin-bottom: 12px; padding: 0; }
.menu-select-trigger { min-height: 39px; }
.toolbar-count .menu-select-trigger { min-width: 122px; }
.toolbar-mode .menu-select-trigger { min-width: 145px; }
.toolbar-theme .menu-select-trigger { min-width: 150px; }
.dice-output-panel {
  overflow: hidden; min-height: 196px; padding: 20px 22px 10px; border: 1px solid rgba(220,232,255,.16);
  border-radius: 17px; background: rgba(255,255,255,.085);
}
.dice-stage { min-height: 132px; margin: 0; padding: 8px 0 13px; border: 0; border-radius: 0; background: transparent; gap: clamp(10px,1.5vw,18px); justify-content: center; }
.die { width: clamp(58px,7.2vw,90px); height: clamp(58px,7.2vw,90px); border-radius: 16px; }
.roll-summary { display: none; }
.verify-id-strip {
  display: flex; width: 100%; min-height: 30px; justify-content: center; gap: 10px;
  margin: 0; padding: 9px 0 2px; border: 0; border-top: 1px solid rgba(220,232,255,.13); border-radius: 0; background: transparent;
  font-size: 10px;
}
.verify-id-strip>span { display: flex; grid-column: auto; align-items: center; gap: 8px; }
.verify-id-strip .section-label { font-size: 9px; }
.verify-id-strip code { color: #f3f6ff; }
.verify-id-strip .copy-room { padding: 3px 8px; border: 0; background: transparent; color: #ffd21a; font-size: 9px; }
.roll-button#roll-button { height: 66px; margin-top: 13px; border-radius: 15px; font-size: 23px; }
.dice-quick-actions { display: flex; width: min(100%, 610px); align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 13px auto 0; }
.dice-quick-actions .toolbar-verify { min-height: 38px; padding: 0 14px; border: 0; border-radius: 999px; background: #158b57; color: #fff; font-size: 11px; text-decoration: none; }
.dice-quick-actions .toolbar-verify:last-child { background: linear-gradient(180deg,#ffdf55,#ffc107); color: #17130a; box-shadow: 0 4px 12px rgba(255,193,7,.2); }
.dice-quick-actions .sound-toggle, .dice-quick-actions .dice-blur-switch {
  min-height: 38px; margin: 0; padding: 0 13px; border: 1px solid rgba(220,232,255,.12);
  border-radius: 999px; background: rgba(11,18,32,.82); color: #f5f7ff;
}
.dice-quick-actions .sound-toggle { display: inline-flex; width: auto!important; min-width: 88px; flex: 0 0 auto; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; font-size: 10px; }
.dice-quick-actions .dice-blur-switch { display: inline-flex; align-items: center; gap: 9px; }
.dice-counter { width: 100%; margin: 12px auto 0; padding: 12px clamp(12px,3vw,30px); border: 1px solid rgba(220,232,255,.12); border-radius: 16px; background: rgba(11,18,32,.78); }
.dice-counter-controls { display: grid; width: 100%; grid-template-columns: 1fr minmax(72px,auto) 1fr; align-items: center; gap: 10px; }
.counter-side { display: flex; flex-direction: column; gap: 4px; }
.counter-side:last-child { align-items: flex-end; }
.dice-counter-controls button { min-width: 45px; padding: 4px 9px; border: 0; border-radius: 9px; background: transparent; color: #30df93; font-size: 15px; font-weight: 900; }
.counter-side:first-child button { color: #ff6474; }
.dice-counter-controls output { min-width: 72px; padding: 1px 12px; border: 0; border-radius: 12px; background: rgba(2,8,20,.7); color: #fff; font-size: 34px; font-weight: 900; }
.keyboard-hint { display: none; }
.history-section, .color-key {
  width: min(100%,720px)!important; max-width: 720px!important; margin: 12px auto 0; padding: 0;
  overflow: hidden; border: 1px solid rgba(207,222,255,.15); border-radius: 16px;
  background: rgba(11,18,32,.78); box-shadow: 0 14px 34px rgba(0,0,0,.28);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.game-disclosure-heading { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 14px; padding: 0 16px; color: #fff; font-size: 14px; font-weight: 900; cursor: pointer; list-style: none; }
.game-disclosure-heading::-webkit-details-marker { display: none; }
.game-disclosure-heading::after { width: 8px; height: 8px; flex: 0 0 8px; border-right: 2px solid #eaf0fb; border-bottom: 2px solid #eaf0fb; content: ""; transform: translateY(-2px) rotate(45deg); transition: transform .15s ease; }
.game-disclosure[open]>.game-disclosure-heading::after { transform: translateY(2px) rotate(225deg); }
.history-count { margin-left: auto; padding: 4px 8px; border-radius: 999px; background: rgba(64,150,230,.2); color: #9bd5ff; font-size: 10px; }
.game-disclosure-content { padding: 0 14px 14px; }
.history-section .stats-panel { margin-bottom: 12px; }
.history-section .history-empty { color: rgba(239,244,255,.7); }
.history-section .history-heading { display: none; }
.color-key { padding: 0; }
.color-key .color-list { justify-content: flex-start; padding: 0 16px 16px; }
.color-key .color-list span { color: #f3f5fc; }
.search-info { margin-top: 14px; }
.page-shell { padding-bottom: 92px; }
.pinned-color-legend {
  position: fixed; z-index: 10000; right: 0; bottom: 0; left: 0;
  display: flex; min-height: 54px; align-items: center; justify-content: center;
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(226,235,255,.18);
  background: rgba(13,22,40,.96); color: #fff;
  box-shadow: 0 -8px 28px rgba(0,0,0,.22);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.pinned-color-list { display: flex; max-width: 100%; align-items: center; justify-content: center; gap: clamp(10px,2vw,22px); overflow-x: auto; }
.pinned-color-list span { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; color: #f2f5ff; font-size: 12px; white-space: nowrap; }
.pinned-color-list .swatch { width: 14px; height: 14px; border-radius: 50%; }
@media(max-width:640px) {
  .page-shell { padding: 8px 12px 26px; }
  .site-banner { width: min(100%,600px); }
  .roller-card { padding: 17px 12px 18px; }
  .game-layout { width: min(100%, 720px); }
  .dice-toolbar { gap: 6px; }
  .menu-select-trigger { min-width: 103px; min-height: 36px; padding-inline: 8px; font-size: 10px; }
  .toolbar-count .menu-select-trigger { min-width: 96px; }
  .toolbar-mode .menu-select-trigger { min-width: 120px; }
  .toolbar-theme .menu-select-trigger { min-width: 112px; }
  .dice-output-panel { min-height: 178px; padding: 16px 8px 8px; }
  .dice-stage { min-height: 112px; padding: 6px 0 10px; gap: clamp(7px,2.4vw,13px); }
  .roll-button#roll-button { height: 58px; font-size: 20px; }
  .dice-quick-actions { width: 100%; justify-content: center; gap: 8px; }
  .dice-quick-actions .toolbar-verify, .dice-quick-actions .sound-toggle, .dice-quick-actions .dice-blur-switch { min-height: 36px; padding-inline: 11px; font-size: 10px; white-space: nowrap; }
  .dice-counter { padding: 9px 10px; }
  .history-section, .color-key { margin-top: 10px; }
  .pinned-color-legend { min-height: 48px; padding-inline: 8px; }
  .pinned-color-list { justify-content: flex-start; gap: 12px; }
  .pinned-color-list span { gap: 4px; font-size: 10px; }
  .pinned-color-list .swatch { width: 11px; height: 11px; }
}

/* Keep the phone layout inside the screen and let the dice scale by count. */
@media(max-width:640px) {
  html, body { max-width: 100%; overflow-x: clip; }
  .page-shell { width: 100%; padding: 8px 10px calc(66px + env(safe-area-inset-bottom)); }
  .topbar { position: relative; min-height: 40px; flex-wrap: wrap; gap: 8px; padding-right: 0; }
  .topbar-actions { position: static; width: 100%; justify-content: center; flex-wrap: wrap; gap: 6px; }
  .vip-login-button, .topbar-link { min-height: 34px; padding-inline: 10px; font-size: 10px; }
  .site-banner { width: min(100%, 520px); }
  .game-layout, .roller-card, .dice-toolbar, .dice-output-panel, .history-section, .color-key { min-width: 0; }
  .game-layout { width: 100%; margin-top: 12px; }
  .roller-card { width: 100%; padding: 16px 10px 18px; }
  .dice-toolbar { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 7px; width: 100%; }
  .toolbar-count, .toolbar-mode, .toolbar-theme { width: 100%; min-width: 0; }
  .toolbar-theme { grid-column: 1 / -1; }
  .dice-toolbar .menu-select-trigger,
  .dice-toolbar .toolbar-count .menu-select-trigger,
  .dice-toolbar .toolbar-mode .menu-select-trigger,
  .dice-toolbar .toolbar-theme .menu-select-trigger {
    width: 100%; min-width: 0; min-height: 38px; gap: 8px; padding-inline: 10px; font-size: 11px;
  }
  .dice-output-panel { container-type: inline-size; min-height: 0; padding: 8px 8px 6px; }
  .dice-stage[data-dice-count] {
    display: grid; min-height: 0; grid-template-columns: repeat(4,minmax(0,1fr));
    align-items: center; justify-items: center; gap: clamp(5px,1.8vw,10px); padding: 8px 0 12px;
  }
  .dice-stage[data-dice-count="1"] { grid-template-columns: minmax(0,1fr); }
  .dice-stage[data-dice-count="2"] { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dice-stage[data-dice-count="3"] { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .dice-stage[data-dice-count="5"], .dice-stage[data-dice-count="6"],
  .dice-stage[data-dice-count="7"], .dice-stage[data-dice-count="8"],
  .dice-stage[data-dice-count="9"], .dice-stage[data-dice-count="10"] {
    grid-template-columns: repeat(5,minmax(0,1fr));
  }
  .dice-stage[data-dice-count] > .die {
    width: min(100%, clamp(54px,24cqw,112px)); height: auto; aspect-ratio: 1;
    border-width: clamp(4px,1.35vw,6px); border-radius: clamp(11px,3.2vw,16px);
  }
  .dice-stage[data-dice-count] > .die::after { width: 22%; height: 22%; max-width: 22px; max-height: 22px; }
  .verify-id-strip { gap: 5px; padding: 8px 0 2px; font-size: 9px; }
  .verify-id-strip>span { gap: 5px; }
  .verify-id-strip code { max-width: 100%; overflow-wrap: anywhere; }
  .dice-quick-actions { gap: 6px; }
  .dice-quick-actions .toolbar-verify,
  .dice-quick-actions .sound-toggle,
  .dice-quick-actions .dice-blur-switch { min-height: 35px; padding-inline: 9px; font-size: 9px; }
}
@media(max-width:360px) {
  .brand { font-size: 14px; }
  .topbar-actions { gap: 5px; }
  .vip-login-button, .topbar-link { min-height: 32px; padding-inline: 8px; font-size: 9px; }
  .roller-card { padding-inline: 8px; }
  .dice-toolbar .menu-select-trigger,
  .dice-toolbar .toolbar-count .menu-select-trigger,
  .dice-toolbar .toolbar-mode .menu-select-trigger,
  .dice-toolbar .toolbar-theme .menu-select-trigger { min-height: 36px; padding-inline: 8px; font-size: 10px; }
  .dice-stage[data-dice-count] > .die { width: min(100%, clamp(50px,23cqw,96px)); }
}
