@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@400;500;600;700&family=Nunito+Sans:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap");

:root {
    --bg: #ffffff;
    --text: #111111;
    --muted: #6e6e73;
    --line: #d8d8dc;
    --panel: #f5f5f7;
    --purple: #8a00ff;
    --pink: #ff008a;
    --orange: #ff5a00;
    --header-h: 62px;
    --ad-h: 82px;
    --page-max: 520px;
    --radius: 18px;
}

* { box-sizing: border-box; }

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    min-height: 100dvh;
    overflow: hidden;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.brand-flash {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    background: var(--bg);
    opacity: 1;
    transition: opacity 120ms ease;
}

.brand-flash.is-hidden { opacity: 0; pointer-events: none; }
.brand-flash img { width: min(58vw, 280px); height: auto; }

.app-shell {
    height: 100dvh;
    max-width: var(--page-max);
    margin: 0 auto;
    display: grid;
    grid-template-rows: var(--header-h) minmax(0, 1fr) var(--ad-h);
    background: var(--bg);
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
}

.app-header {
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-bottom: 0;
}

.icon-button {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.icon-button:active { background: var(--panel); }

.header-logo-picture { justify-self: center; display: grid; place-items: center; }
.header-logo {
    width: 112px;
    max-height: 48px;
    object-fit: contain;
}

.landing {
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(190px, 38%) minmax(0, 62%);
}

.discovery {
    min-height: 0;
    padding: 28px 8px 0;
    display: grid;
    align-content: start;
    gap: 18px;
}

.discovery-section { min-width: 0; text-align: center; }

.discovery-title {
    margin: 0 0 2px;
    font-size: clamp(19px, 4.8vw, 22px);
    line-height: 1.05;
    font-weight: 400;
    letter-spacing: -0.02em;
}

.discovery-section[data-section-id="game"] .discovery-title { color: var(--purple); }
.discovery-section[data-section-id="dice"] .discovery-title { color: var(--pink); }
.discovery-section[data-section-id="random"] .discovery-title { color: var(--orange); }

.discovery-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    overflow-x: auto;
    padding: 3px 3px 5px;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
}

.discovery-row::before,
.discovery-row::after {
    flex: 0 0 auto;
    color: var(--text);
    font-size: 17px;
    line-height: 1;
}
.discovery-row::before { content: "‹"; }
.discovery-row::after { content: "›"; }
.discovery-row::-webkit-scrollbar { display: none; }

.discovery-item {
    flex: 0 0 auto;
    border: 0;
    padding: 2px 0;
    background: transparent;
    color: var(--text);
    font-size: clamp(13px, 3.3vw, 15px);
    font-weight: 400;
    white-space: nowrap;
    cursor: pointer;
    scroll-snap-align: center;
}
.discovery-item:active { opacity: 0.55; }

.roll-zone {
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: clamp(42px, 7vh, 72px);
    padding: 0 18px 24px;
}

.die-button {
    --die-size: clamp(150px, 34vw, 184px);
    --die-half: calc(var(--die-size) / 2);
    --die-radius: calc(var(--die-size) * 0.13);
    --die-material-a: #fffefa;
    --die-material-b: #eeeae1;
    --die-edge: rgb(95 87 74 / 0.16);
    --die-pip: #2b2b2d;
    --die-shadow-color: rgb(0 0 0 / 0.18);

    width: clamp(170px, 38vw, 205px);
    aspect-ratio: 1;
    position: relative;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    perspective: 760px;
}

.die-shadow {
    position: absolute;
    left: 50%;
    bottom: 5%;
    width: 70%;
    height: 16%;
    border-radius: 50%;
    background: var(--die-shadow-color);
    filter: blur(13px);
    transform: translateX(-50%);
    opacity: 0.58;
    transition: transform 180ms ease, opacity 180ms ease, filter 180ms ease;
}

.die-tilt {
    width: var(--die-size);
    height: var(--die-size);
    position: relative;
    display: block;
    transform-style: preserve-3d;
    transform: rotateX(-12deg) rotateY(-14deg);
    transform-origin: 50% 58%;
    will-change: transform;
}

.die-cube {
    position: absolute;
    inset: 0;
    display: block;
    transform-style: preserve-3d;
    transition: transform 250ms cubic-bezier(0.22, 0.72, 0.2, 1);
    will-change: transform;
}

.die-side {
    position: absolute;
    inset: 0;
    display: block;
    border: 1px solid var(--die-edge);
    border-radius: var(--die-radius);
    background:
        radial-gradient(circle at 28% 20%, rgb(255 255 255 / 0.96), transparent 34%),
        linear-gradient(145deg, var(--die-material-a), var(--die-material-b));
    box-shadow:
        inset 8px 9px 13px rgb(255 255 255 / 0.58),
        inset -9px -10px 14px rgb(118 104 85 / 0.10);
    backface-visibility: hidden;
    overflow: hidden;
}

.die-side::before {
    content: "";
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    pointer-events: none;
}

.die-side[data-face="1"]::before {
    background-image: var(--pip);
    background-position: 50% 50%;
}

.die-side[data-face="2"]::before {
    background-image: var(--pip), var(--pip);
    background-position: 29% 29%, 71% 71%;
}

.die-side[data-face="3"]::before {
    background-image: var(--pip), var(--pip), var(--pip);
    background-position: 28% 28%, 50% 50%, 72% 72%;
}

.die-side[data-face="4"]::before {
    background-image: var(--pip), var(--pip), var(--pip), var(--pip);
    background-position: 29% 29%, 71% 29%, 29% 71%, 71% 71%;
}

.die-side[data-face="5"]::before {
    background-image: var(--pip), var(--pip), var(--pip), var(--pip), var(--pip);
    background-position: 29% 29%, 71% 29%, 50% 50%, 29% 71%, 71% 71%;
}

.die-side[data-face="6"]::before {
    background-image: var(--pip), var(--pip), var(--pip), var(--pip), var(--pip), var(--pip);
    background-position: 29% 25%, 71% 25%, 29% 50%, 71% 50%, 29% 75%, 71% 75%;
}

.die-side {
    --pip: radial-gradient(circle at 42% 35%, #4b4b4e 0 16%, var(--die-pip) 30% 60%, #18181a 72% 100%);
    background-size: auto;
}

.die-side::before {
    background-size: 18% 18%;
}

.die-side-front  { transform: rotateY(0deg) translateZ(var(--die-half)); }
.die-side-back   { transform: rotateY(180deg) translateZ(var(--die-half)); }
.die-side-right  { transform: rotateY(90deg) translateZ(var(--die-half)); }
.die-side-left   { transform: rotateY(-90deg) translateZ(var(--die-half)); }
.die-side-top    { transform: rotateX(90deg) translateZ(var(--die-half)); }
.die-side-bottom { transform: rotateX(-90deg) translateZ(var(--die-half)); }

/* Standard D6: opposite pairs 1–6, 2–5, 3–4. Rotating one physical cube keeps visible neighbours real. */
.die-cube[data-value="1"] { transform: rotateX(-90deg); }
.die-cube[data-value="2"] { transform: rotateY(0deg); }
.die-cube[data-value="3"] { transform: rotateY(-90deg); }
.die-cube[data-value="4"] { transform: rotateY(90deg); }
.die-cube[data-value="5"] { transform: rotateY(180deg); }
.die-cube[data-value="6"] { transform: rotateX(90deg); }

.die-button:active .die-tilt {
    transform: rotateX(-12deg) rotateY(-14deg) scale(0.94);
}

.die-button.is-rolling .die-tilt {
    animation: cubiri-dice-roll 430ms cubic-bezier(0.22, 0.72, 0.2, 1);
}

.die-button.is-rolling .die-shadow {
    animation: cubiri-dice-shadow 430ms cubic-bezier(0.22, 0.72, 0.2, 1);
}

@keyframes cubiri-dice-roll {
    0%   { transform: rotateX(-12deg) rotateY(-14deg) scale(1) translateY(0); }
    28%  { transform: rotateX(-18deg) rotateY(-22deg) scale(0.94) translateY(0); }
    67%  { transform: rotateX(2deg) rotateY(18deg) scale(1.035) translateY(-10px); }
    84%  { transform: rotateX(-14deg) rotateY(-8deg) scale(0.99) translateY(2px); }
    100% { transform: rotateX(-12deg) rotateY(-14deg) scale(1) translateY(0); }
}

@keyframes cubiri-dice-shadow {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.58; filter: blur(13px); }
    28% { transform: translateX(-50%) scale(0.88); opacity: 0.46; filter: blur(11px); }
    67% { transform: translateX(-50%) scale(1.16); opacity: 0.30; filter: blur(17px); }
    84% { transform: translateX(-50%) scale(0.94); opacity: 0.54; filter: blur(12px); }
}

:root[data-theme="dark"] .die-button { --die-shadow-color: rgb(0 0 0 / 0.48); }

.roll-label {
    margin: 0 0 4px;
    border: 0;
    padding: 8px 18px;
    background: linear-gradient(90deg, var(--purple) 0 47%, var(--pink) 58%, var(--orange) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: clamp(23px, 6vw, 29px);
    line-height: 1;
    font-weight: 400;
    letter-spacing: -0.03em;
    cursor: pointer;
}

.bottom-zone {
    display: grid;
    place-items: center;
    border: 1px solid var(--orange);
    background: var(--bg);
    color: var(--orange);
    font-size: clamp(26px, 7vw, 34px);
    font-weight: 300;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgb(0 0 0 / 0.22);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}
.drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }

.drawer {
    position: absolute;
    inset: 0 auto 0 0;
    width: min(86vw, 390px);
    padding: 18px 20px 28px;
    background: var(--bg);
    transform: translateX(-102%);
    transition: transform 210ms ease;
    overflow-y: auto;
    box-shadow: 16px 0 48px rgb(0 0 0 / 0.12);
}
.drawer-backdrop.is-open .drawer { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.drawer-title { margin: 0; font-size: 23px; }
.drawer-section { margin: 20px 0; }
.drawer-section h3 { margin: 0 0 8px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.drawer-list { display: grid; }
.drawer-item { display: block; width: 100%; padding: 11px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer; }

.status-toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--ad-h) + 20px);
    z-index: 200;
    max-width: calc(100vw - 40px);
    padding: 10px 14px;
    border-radius: 999px;
    background: rgb(17 17 17 / 0.9);
    color: white;
    font-size: 13px;
    transform: translate(-50%, 14px);
    opacity: 0;
    pointer-events: none;
    transition: 160ms ease;
}
.status-toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

@media (min-width: 700px) {
    body { background: #f5f5f7; }
    .app-shell { box-shadow: 5px 5px 0 rgb(0 0 0 / 0.18); }
}

@media (max-height: 620px) {
    :root { --header-h: 56px; --ad-h: 72px; }
    .landing { grid-template-rows: minmax(175px, 43%) minmax(0, 57%); }
    .discovery { padding-top: 18px; gap: 13px; }
    .die-button { width: 145px; }
    .roll-label { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

:root[data-theme="light"] {
    --bg: #fafaf7;
    --text: #1c1c1e;
    --text-2: #636366;
    --text-3: #8e8e93;
    --muted: #636366;
    --line: #d8d8dc;
    --panel: #f5f5f2;
}

:root[data-theme="dark"] {
    --bg: #000000;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --line: #2c2c2e;
    --panel: #1c1c1e;
}

:root[data-theme="dark"] body { background: #000000; }
:root[data-theme="dark"] .bottom-zone { background: #000000; }
:root[data-theme="dark"] .status-toast { background: rgb(245 245 247 / 0.92); color: #111111; }


/* 2026-08-11 visual scale pass: match approved mockup proportions */
:root {
    --header-h: 112px;
}

.app-header {
    grid-template-columns: 88px 1fr 88px;
    padding: 10px 20px;
}

.icon-button {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    font-size: 48px;
}

.header-logo {
    max-width: 276px;
    max-height: 84px;
}

.discovery {
    padding-top: 22px;
    gap: 24px;
}

.discovery-title {
    font-size: 40px;
}

.discovery-item,
.discovery-edge {
    font-size: 30px;
}

.roll-label {
    font-size: 32px;
}

.bottom-zone {
    font-size: 52px;
}

.drawer,
.drawer button,
.drawer a,
.drawer-title,
.drawer-section-title {
    font-size: 28px;
}

@media (max-width: 430px) {
    :root {
        --header-h: 100px;
    }

    .app-header {
        grid-template-columns: 72px 1fr 72px;
        padding: 8px 12px;
    }

    .icon-button {
        width: 68px;
        height: 68px;
        font-size: 42px;
    }

    .header-logo {
        max-width: 230px;
        max-height: 74px;
    }

    .discovery-title {
        font-size: 36px;
    }

    .discovery-item,
    .discovery-edge {
        font-size: 26px;
    }

    .roll-label {
        font-size: 30px;
    }

    .bottom-zone {
        font-size: 44px;
    }
}


/* 2026-08-15 restore approved landing branding */
.header-logo {
    width: 224px;
    max-width: 224px;
    max-height: 96px;
}

.discovery-section[data-section-id="game"] .discovery-title { color: var(--purple); }
.discovery-section[data-section-id="dice"] .discovery-title { color: var(--pink); }
.discovery-section[data-section-id="random"] .discovery-title { color: var(--orange); }

@media (max-width: 430px) {
    .header-logo {
        width: 224px;
        max-width: 224px;
        max-height: 92px;
    }
}

/* 2026-08-15 header icon tuning only: keep approved logo untouched */
.app-header {
    position: relative;
}

.app-header > .icon-button:first-child,
.app-header > .icon-button:last-child {
    position: absolute;
    top: 0;
    width: 88px;
    height: 88px;
    font-size: 56px;
}

.app-header > .icon-button:first-child {
    left: 2px;
}

.app-header > .icon-button:last-child {
    right: 2px;
}

@media (max-width: 430px) {
    .app-header > .icon-button:first-child,
    .app-header > .icon-button:last-child {
        top: 0;
        width: 78px;
        height: 78px;
        font-size: 50px;
    }

    .app-header > .icon-button:first-child { left: 0; }
    .app-header > .icon-button:last-child { right: 0; }
}

/* 2026-08-15 dice polish + header lock. No other layout changes. */
.app-header > .header-logo-picture {
    grid-column: 2;
    justify-self: center;
}

.die-button {
    --die-radius: calc(var(--die-size) * 0.055);
}

.die-side {
    border-color: rgb(95 87 74 / 0.12);
    box-shadow:
        inset 5px 5px 10px rgb(255 255 255 / 0.50),
        inset -7px -8px 12px rgb(118 104 85 / 0.09),
        0 0 1px rgb(95 87 74 / 0.12);
}

.die-side {
    --pip: radial-gradient(
        circle at 42% 35%,
        #55565a 0 13%,
        #36373a 22%,
        var(--die-pip) 42% 56%,
        #151517 64%,
        rgb(0 0 0 / 0.20) 68%,
        transparent 72% 100%
    );
}

.die-cube {
    transition-duration: 460ms;
}

.die-button.is-rolling .die-tilt {
    animation-duration: 800ms;
}

.die-button.is-rolling .die-shadow {
    animation-duration: 800ms;
}


/* 2026-08-15 real Three.js D6 renderer. Other page layout intentionally untouched. */
.app-header > .header-logo-picture { grid-column: 2; justify-self: center; }
.die-button { width: clamp(190px, 42vw, 230px); aspect-ratio: 1; perspective: none; }
.die-stage { display:flex; width:100%; height:100%; position:relative; flex-wrap:wrap; align-items:center; justify-content:center; align-content:center; gap:4px; }
.die-stage canvas { display:block; width:100% !important; height:100% !important; pointer-events:none; }
.die-instance { display:block; position:relative; flex:0 0 100%; aspect-ratio:1; min-width:0; }
.die-stage[data-count="2"] .die-instance, .die-stage[data-count="4"] .die-instance { flex-basis:47%; }
.die-stage[data-count="3"] .die-instance, .die-stage[data-count="5"] .die-instance, .die-stage[data-count="6"] .die-instance { flex-basis:30.5%; }
.die-button .die-shadow, .die-button .die-tilt, .die-button .die-cube, .die-button .die-side { display:none !important; }


/* 2026-08-15 Content Area v1
   Protected zones intentionally untouched: header, roll-zone/die, roll-label, ad-slot. */
.discovery {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 14px 0 12px;
    gap: 18px;
    scroll-snap-type: y proximity;
}

.discovery::-webkit-scrollbar { display: none; }

.discovery-section {
    min-width: 0;
    text-align: left;
    scroll-snap-align: start;
}

.discovery-title {
    margin: 0 18px 8px;
    font-size: clamp(19px, 4.6vw, 23px);
    line-height: 1.1;
    font-weight: 650;
    letter-spacing: -0.025em;
    color: var(--text) !important;
}

.discovery-row {
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 18px 8px;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 18px;
}

.discovery-row::-webkit-scrollbar { display: none; }
.discovery-row::before,
.discovery-row::after { content: none !important; display: none !important; }

.discovery-item {
    --card-a: #f4efff;
    --card-b: #e7dcff;
    flex: 0 0 clamp(116px, 31vw, 142px);
    min-height: 88px;
    border: 1px solid rgb(92 75 130 / 0.10);
    border-radius: 20px;
    padding: 12px 12px 11px;
    background:
        radial-gradient(circle at 20% 12%, rgb(255 255 255 / 0.82), transparent 38%),
        linear-gradient(145deg, var(--card-a), var(--card-b));
    color: var(--text);
    box-shadow:
        0 7px 18px rgb(31 20 56 / 0.07),
        inset 0 1px 0 rgb(255 255 255 / 0.70);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 9px;
    text-align: left;
    cursor: pointer;
    scroll-snap-align: start;
    transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.discovery-item[data-source="games"]:nth-child(3n + 2) {
    --card-a: #fff2f7;
    --card-b: #ffe0ec;
}

.discovery-item[data-source="games"]:nth-child(3n + 3) {
    --card-a: #fff5e8;
    --card-b: #ffe6c6;
}

.discovery-item[data-source="dice"] {
    --card-a: #eef8ff;
    --card-b: #dceeff;
}

.discovery-item[data-source="dice"]:nth-child(3n + 2) {
    --card-a: #f2efff;
    --card-b: #e3dcff;
}

.discovery-item[data-source="random"] {
    --card-a: #fff4e9;
    --card-b: #ffe1c3;
}

.discovery-item[data-source="random"]:nth-child(3n + 2) {
    --card-a: #eefaff;
    --card-b: #d9f2ff;
}

.discovery-item[data-source="random"]:nth-child(3n + 3) {
    --card-a: #f5efff;
    --card-b: #e6dcff;
}

.discovery-item:active {
    opacity: 0.86;
    transform: scale(0.975);
    box-shadow:
        0 3px 10px rgb(31 20 56 / 0.07),
        inset 0 1px 0 rgb(255 255 255 / 0.65);
}

.discovery-item-icon {
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    font-size: 27px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.05em;
}

.discovery-item-label {
    display: block;
    width: 100%;
    font-size: clamp(15px, 3.8vw, 18px);
    line-height: 1.06;
    font-weight: 650;
    letter-spacing: -0.025em;
}

:root[data-theme="dark"] .discovery-item {
    border-color: rgb(255 255 255 / 0.08);
    filter: brightness(0.68) saturate(0.82);
    box-shadow:
        0 8px 20px rgb(0 0 0 / 0.26),
        inset 0 1px 0 rgb(255 255 255 / 0.10);
}

:root[data-theme="dark"] .discovery-item-icon,
:root[data-theme="dark"] .discovery-item-label {
    filter: brightness(1.46) saturate(1.12);
}

@media (max-width: 430px) {
    .discovery {
        padding-top: 10px;
        gap: 15px;
    }

    .discovery-title {
        margin-inline: 16px;
        margin-bottom: 7px;
        font-size: 20px;
    }

    .discovery-row {
        padding-inline: 16px;
        scroll-padding-inline: 16px;
    }

    .discovery-item {
        flex-basis: 112px;
        min-height: 82px;
        border-radius: 18px;
        padding: 11px;
    }

    .discovery-item-icon {
        min-width: 31px;
        height: 31px;
        font-size: 25px;
    }

    .discovery-item-label {
        font-size: 15px;
    }
}

/* 2026-08-15 Typography Lab. Blind variants intentionally affect only Content Area and Tap to Roll. */
@font-face {
    font-family: "Cubiri Geist";
    src: url("https://unpkg.com/geist@1.7.1/dist/fonts/geist-sans/Geist-Variable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root[data-typography-variant="A"] { --cubiri-test-font: "Manrope", sans-serif; }
:root[data-typography-variant="B"] { --cubiri-test-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", sans-serif; }
:root[data-typography-variant="C"] { --cubiri-test-font: "Inter", sans-serif; }
:root[data-typography-variant="D"] { --cubiri-test-font: "Nunito Sans", sans-serif; }
:root[data-typography-variant="E"] { --cubiri-test-font: "Cubiri Geist", "Inter", sans-serif; }
:root[data-typography-variant="F"] { --cubiri-test-font: "Plus Jakarta Sans", sans-serif; }

.discovery,
.discovery-title,
.discovery-item,
.discovery-item-label,
.roll-label {
    font-family: var(--cubiri-test-font, -apple-system, BlinkMacSystemFont, sans-serif);
}

/* Desktop grab-to-scroll stays part of the Content Area experiment. */
@media (hover: hover) and (pointer: fine) {
    .discovery-row {
        cursor: grab;
        user-select: none;
        -webkit-user-select: none;
    }
    .discovery-row.is-grabbing {
        cursor: grabbing;
        scroll-snap-type: none;
    }
    .discovery-row.is-grabbing .discovery-item { pointer-events: none; }
}

.typography-lab-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgb(0 0 0 / 0.24);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
}
.typography-lab-backdrop.is-open { opacity: 1; pointer-events: auto; }
.typography-lab {
    width: min(360px, 100%);
    border: 1px solid rgb(127 127 127 / 0.18);
    border-radius: 24px;
    padding: 18px;
    background: color-mix(in srgb, var(--surface, #fff) 94%, transparent);
    color: var(--text);
    box-shadow: 0 24px 70px rgb(0 0 0 / 0.22);
    transform: translateY(8px) scale(0.985);
    transition: transform 150ms ease;
}
.typography-lab-backdrop.is-open .typography-lab { transform: translateY(0) scale(1); }
.typography-lab-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.typography-lab-head h2 { margin:0; font: 650 20px/1.1 -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing:-0.02em; }
.typography-lab-close {
    width:34px; height:34px; border:0; border-radius:50%; background:rgb(127 127 127 / 0.12);
    color:var(--text); font:400 25px/1 -apple-system, BlinkMacSystemFont, sans-serif; cursor:pointer;
}
.typography-lab-note { margin:12px 0 16px; color:var(--muted); font:400 13px/1.35 -apple-system, BlinkMacSystemFont, sans-serif; }
.typography-lab-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; }
.typography-variant {
    min-height:54px; border:1px solid var(--line); border-radius:16px; background:rgb(127 127 127 / 0.07);
    color:var(--text); font:650 18px/1 -apple-system, BlinkMacSystemFont, sans-serif; cursor:pointer;
    transition:transform 100ms ease, background 100ms ease, border-color 100ms ease;
}
.typography-variant:active { transform:scale(0.97); }
.typography-variant.is-active { background:rgb(112 76 255 / 0.15); border-color:rgb(112 76 255 / 0.42); }


/* 2026-08-15 Settings appearance toggle. */
.settings-section-title {
    margin: 18px 0 8px;
    color: var(--text);
    font: 650 14px/1.2 -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.01em;
}

.theme-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 4px;
    border-radius: 16px;
    background: rgb(127 127 127 / 0.10);
}

.theme-option {
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font: 650 15px/1 -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
    transition: transform 100ms ease, background 120ms ease, box-shadow 120ms ease;
}

.theme-option:active { transform: scale(0.98); }

.theme-option.is-active {
    background: var(--bg);
    box-shadow:
        0 1px 4px rgb(0 0 0 / 0.10),
        inset 0 0 0 1px rgb(127 127 127 / 0.12);
}

:root[data-theme="dark"] .theme-option.is-active {
    background: #2c2c2e;
    box-shadow:
        0 1px 5px rgb(0 0 0 / 0.42),
        inset 0 0 0 1px rgb(255 255 255 / 0.08);
}


/* 2026-08-15 Cubiri Dark Mode 1.0
   Night atmosphere: dark space, colored glass cards, brighter card content,
   and a subtle Cubiri aura behind the primary die. */
:root[data-theme="dark"] {
    --bg: #111318;
    --text: #f7f7fa;
    --muted: rgb(247 247 250 / 0.70);
    --line: rgb(255 255 255 / 0.09);
    --panel: #181b22;
}

:root[data-theme="dark"] body,
:root[data-theme="dark"] .app-shell,
:root[data-theme="dark"] main,
:root[data-theme="dark"] .discovery,
:root[data-theme="dark"] .roll-zone,
:root[data-theme="dark"] .bottom-zone {
    background: var(--bg);
}

/* Dark cards are their own palette, not dimmed light cards. */
:root[data-theme="dark"] .discovery-item {
    --card-a: #2d2840;
    --card-b: #201d31;
    color: rgb(255 255 255 / 0.95);
    border-color: rgb(255 255 255 / 0.10);
    filter: none;
    background:
        radial-gradient(circle at 18% 10%, rgb(255 255 255 / 0.10), transparent 40%),
        linear-gradient(145deg, var(--card-a), var(--card-b));
    box-shadow:
        0 7px 18px rgb(0 0 0 / 0.26),
        inset 0 1px 0 rgb(255 255 255 / 0.08);
}

:root[data-theme="dark"] .discovery-item[data-source="games"]:nth-child(3n + 2) {
    --card-a: #412634;
    --card-b: #2c1d27;
}

:root[data-theme="dark"] .discovery-item[data-source="games"]:nth-child(3n + 3) {
    --card-a: #41301f;
    --card-b: #2b2319;
}

:root[data-theme="dark"] .discovery-item[data-source="dice"] {
    --card-a: #243744;
    --card-b: #1b2933;
}

:root[data-theme="dark"] .discovery-item[data-source="dice"]:nth-child(3n + 2) {
    --card-a: #302a46;
    --card-b: #242036;
}

:root[data-theme="dark"] .discovery-item[data-source="random"] {
    --card-a: #44301f;
    --card-b: #2f241b;
}

:root[data-theme="dark"] .discovery-item[data-source="random"]:nth-child(3n + 2) {
    --card-a: #203b47;
    --card-b: #192c35;
}

:root[data-theme="dark"] .discovery-item[data-source="random"]:nth-child(3n + 3) {
    --card-a: #342646;
    --card-b: #261d35;
}

:root[data-theme="dark"] .discovery-item-icon,
:root[data-theme="dark"] .discovery-item-label {
    color: rgb(255 255 255 / 0.95);
    filter: none;
    opacity: 1;
}

:root[data-theme="dark"] .discovery-title {
    color: rgb(255 255 255 / 0.96) !important;
}

/* Subtle Cubiri-colored atmosphere behind the die. */
:root[data-theme="dark"] .roll-zone {
    position: relative;
    isolation: isolate;
}

:root[data-theme="dark"] .roll-zone::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 47%;
    width: clamp(320px, 68vw, 410px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background:
        radial-gradient(circle at 36% 42%, rgb(126 54 255 / 0.30), transparent 38%),
        radial-gradient(circle at 60% 48%, rgb(255 40 125 / 0.20), transparent 42%),
        radial-gradient(circle at 57% 64%, rgb(255 92 0 / 0.14), transparent 46%);
    filter: blur(28px);
    pointer-events: none;
    z-index: -1;
}

:root[data-theme="dark"] .die-button {
    --die-shadow-color: rgb(0 0 0 / 0.36);
}

:root[data-theme="dark"] .roll-label {
    position: relative;
    z-index: 1;
}


/* 2026-08-15 Light typography palette */
:root[data-theme="light"] .roll-label,
:root[data-theme="light"] .discovery-title,
:root[data-theme="light"] .discovery-item-label {
    color: var(--text);
}

:root[data-theme="light"] .status-toast,
:root[data-theme="light"] .typography-lab-note {
    color: var(--text-2);
}




/* 2026-08-15 Settings dark-mode cleanup */
:root[data-theme="dark"] .typography-lab-backdrop {
    background: rgb(4 6 10 / 0.58);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

:root[data-theme="dark"] .typography-lab {
    background: rgb(24 27 34 / 0.96);
    color: #f7f7fa;
    border-color: rgb(255 255 255 / 0.10);
    box-shadow:
        0 26px 80px rgb(0 0 0 / 0.46),
        inset 0 1px 0 rgb(255 255 255 / 0.04);
}

:root[data-theme="dark"] .typography-lab-head h2,
:root[data-theme="dark"] .settings-section-title {
    color: #f7f7fa;
}

:root[data-theme="dark"] .typography-lab-note {
    color: rgb(247 247 250 / 0.62);
}

:root[data-theme="dark"] .typography-lab-close {
    background: rgb(255 255 255 / 0.08);
    color: rgb(255 255 255 / 0.88);
}

:root[data-theme="dark"] .theme-toggle {
    background: #111318;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.05);
}

:root[data-theme="dark"] .theme-option {
    color: rgb(247 247 250 / 0.70);
}

:root[data-theme="dark"] .theme-option.is-active {
    background: #30333b;
    color: #ffffff;
    box-shadow:
        0 2px 7px rgb(0 0 0 / 0.40),
        inset 0 0 0 1px rgb(255 255 255 / 0.07);
}

:root[data-theme="dark"] .typography-variant {
    background: #252830;
    border-color: rgb(255 255 255 / 0.07);
    color: rgb(247 247 250 / 0.72);
}

:root[data-theme="dark"] .typography-variant.is-active {
    background: rgb(116 72 255 / 0.24);
    border-color: rgb(137 101 255 / 0.72);
    color: #ffffff;
}


/* 2026-08-15 Light Atmosphere A+C v3
   Restores the stronger asymmetric composition; overflow is deliberately visible
   so the atmosphere softly bleeds upward beneath the lower Content Area. */
:root[data-theme="light"] .roll-zone {
    position: relative;
    isolation: isolate;
    overflow: visible;
    background: transparent;
}

:root[data-theme="light"] .roll-zone::before {
    content: "";
    position: absolute;
    left: 39%;
    top: 26%;
    width: clamp(700px, 120vw, 940px);
    height: clamp(470px, 80vw, 640px);
    transform: translate(-50%, -50%) rotate(-13deg);
    border-radius: 50%;
    background: radial-gradient(
        ellipse at 24% 22%,
        rgb(255 188 88 / 0.16) 0%,
        rgb(255 205 132 / 0.095) 30%,
        rgb(255 225 184 / 0.045) 49%,
        transparent 76%
    );
    filter: blur(78px);
    pointer-events: none;
    z-index: -2;
}

:root[data-theme="light"] .roll-zone::after {
    content: "";
    position: absolute;
    inset: -34% -22% -2% -22%;
    background:
        radial-gradient(ellipse 36% 46% at 24% 52%,
            rgb(116 72 255 / 0.13) 0%,
            rgb(116 72 255 / 0.060) 42%,
            transparent 80%),
        radial-gradient(ellipse 37% 42% at 74% 55%,
            rgb(255 52 132 / 0.115) 0%,
            rgb(255 52 132 / 0.050) 43%,
            transparent 80%),
        radial-gradient(ellipse 42% 36% at 63% 26%,
            rgb(255 126 45 / 0.105) 0%,
            rgb(255 126 45 / 0.043) 45%,
            transparent 82%);
    filter: blur(60px);
    pointer-events: none;
    z-index: -1;
}

:root[data-theme="light"] .die-button {
    --die-shadow-color: rgb(72 62 58 / 0.15);
}



/* 2026-08-15 Light cards: porcelain pass v2 */
:root[data-theme="light"] .discovery-item {
    border-color: rgb(74 72 80 / 0.085);
    background:
        radial-gradient(
            ellipse at 12% 8%,
            rgb(255 255 255 / 0.98) 0%,
            rgb(255 255 255 / 0.78) 20%,
            rgb(255 255 255 / 0.26) 42%,
            transparent 58%
        ),
        linear-gradient(
            150deg,
            color-mix(in srgb, var(--card-a) 72%, white 28%) 0%,
            color-mix(in srgb, var(--card-a) 78%, white 22%) 44%,
            color-mix(in srgb, var(--card-b) 86%, white 14%) 100%
        );
    box-shadow:
        0 2px 4px rgb(34 30 42 / 0.055),
        0 5px 11px rgb(34 30 42 / 0.045),
        inset 0 1px 0 rgb(255 255 255 / 0.96),
        inset 0 -1px 0 rgb(80 72 96 / 0.030);
}

:root[data-theme="light"] .discovery-item:active {
    box-shadow:
        0 1px 3px rgb(34 30 42 / 0.05),
        inset 0 1px 0 rgb(255 255 255 / 0.92);
}

/* 2026-08-15 Light tiles: Cubiri Liquid Glass v1 */
:root[data-theme="light"] .discovery-item{
 position:relative; overflow:hidden;
 border:1px solid rgb(255 255 255 / .82);
 background:
  linear-gradient(135deg,rgb(255 255 255 / .54),rgb(255 255 255 / .14) 46%,rgb(255 255 255 / .30)),
  linear-gradient(145deg,color-mix(in srgb,var(--card-a) 38%,transparent),color-mix(in srgb,var(--card-b) 48%,transparent));
 -webkit-backdrop-filter:blur(24px) saturate(1.55) brightness(1.06);
 backdrop-filter:blur(24px) saturate(1.55) brightness(1.06);
 box-shadow:
  0 10px 24px rgb(37 31 52 / .10),
  inset 1px 1px 0 rgb(255 255 255 / .98),
  inset -1px -1px 0 rgb(64 55 80 / .09);
}
:root[data-theme="light"] .discovery-item::before{
 content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
 background:
  radial-gradient(ellipse at 20% 5%,rgb(255 255 255 / .95),transparent 38%),
  linear-gradient(115deg,transparent 22%,rgb(255 255 255 / .42) 43%,transparent 61%);
 opacity:.72;
}
:root[data-theme="light"] .discovery-item::after{
 content:""; position:absolute; inset:1px; border-radius:inherit; pointer-events:none;
 box-shadow:
  inset 0 1px 1px rgb(255 255 255 / .90),
  inset 0 -1px 1px rgb(46 37 62 / .10),
  inset 1px 0 1px rgb(255 255 255 / .50);
}
:root[data-theme="light"] .discovery-item-icon,
:root[data-theme="light"] .discovery-item-label{position:relative;z-index:2;}

/* 2026-08-15 Light tiles: Liquid Glass color boost v1 */
:root[data-theme="light"] .discovery-item[data-source="games"] {
    --glass-tint-a: rgb(120 86 255 / 0.30);
    --glass-tint-b: rgb(175 128 255 / 0.16);
}
:root[data-theme="light"] .discovery-item[data-source="games"]:nth-child(3n + 2) {
    --glass-tint-a: rgb(255 72 142 / 0.30);
    --glass-tint-b: rgb(255 150 186 / 0.16);
}
:root[data-theme="light"] .discovery-item[data-source="games"]:nth-child(3n + 3) {
    --glass-tint-a: rgb(255 154 46 / 0.31);
    --glass-tint-b: rgb(255 205 112 / 0.17);
}
:root[data-theme="light"] .discovery-item[data-source="dice"] {
    --glass-tint-a: rgb(80 170 255 / 0.29);
    --glass-tint-b: rgb(145 205 255 / 0.16);
}
:root[data-theme="light"] .discovery-item[data-source="dice"]:nth-child(3n + 2) {
    --glass-tint-a: rgb(136 96 255 / 0.29);
    --glass-tint-b: rgb(188 160 255 / 0.16);
}
:root[data-theme="light"] .discovery-item[data-source="random"] {
    --glass-tint-a: rgb(255 147 58 / 0.29);
    --glass-tint-b: rgb(255 196 118 / 0.16);
}
:root[data-theme="light"] .discovery-item[data-source="random"]:nth-child(3n + 2) {
    --glass-tint-a: rgb(53 190 220 / 0.29);
    --glass-tint-b: rgb(133 225 240 / 0.16);
}
:root[data-theme="light"] .discovery-item[data-source="random"]:nth-child(3n + 3) {
    --glass-tint-a: rgb(166 92 255 / 0.29);
    --glass-tint-b: rgb(207 157 255 / 0.16);
}

:root[data-theme="light"] .discovery-item {
    background:
        linear-gradient(
            135deg,
            rgb(255 255 255 / 0.34) 0%,
            rgb(255 255 255 / 0.07) 42%,
            rgb(255 255 255 / 0.13) 100%
        ),
        radial-gradient(
            ellipse at 76% 88%,
            var(--glass-tint-a, rgb(120 86 255 / 0.28)) 0%,
            var(--glass-tint-b, rgb(175 128 255 / 0.15)) 54%,
            transparent 82%
        ),
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--card-a) 26%, transparent),
            color-mix(in srgb, var(--card-b) 34%, transparent)
        );
    -webkit-backdrop-filter: blur(24px) saturate(1.85) brightness(1.03);
    backdrop-filter: blur(24px) saturate(1.85) brightness(1.03);
}

:root[data-theme="light"] .discovery-item::before { opacity: 0.54; }

/* 2026-08-15 Restore Cubiri gradient to Tap to Roll */
:root[data-theme="light"] .roll-label {
    background: linear-gradient(
        90deg,
        rgb(120 86 255) 0%,
        rgb(120 86 255) 28%,
        rgb(255 72 142) 58%,
        rgb(255 154 46) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}


/* Game Page v1 */
.discovery.is-game-view { padding:0 8px; display:grid; grid-template-rows:auto minmax(0,1fr); gap:0; overflow:hidden; align-content:stretch; }
.game-tabs-bar { min-width:0; display:grid; grid-template-columns:minmax(0,1fr) 44px; align-items:stretch; border-bottom:1px solid var(--line); background:var(--bg); }
.game-tabs-scroll { min-width:0; display:flex; align-items:stretch; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; overscroll-behavior-x:contain; }
.game-tabs-scroll::-webkit-scrollbar { display:none; }
.game-tab { flex:0 0 auto; min-height:44px; border:0; border-bottom:2px solid transparent; padding:0 14px; background:transparent; color:var(--muted); font-size:14px; font-weight:600; white-space:nowrap; cursor:pointer; }
.game-tab.is-active { color:var(--text); border-bottom-color:var(--purple); }
.game-back-button { width:44px; min-height:44px; border:0; border-left:1px solid var(--line); background:var(--bg); color:var(--text); font-size:24px; line-height:1; cursor:pointer; }
.game-back-button:active { background:var(--panel); }
.game-tab-content { min-height:0; overflow-y:auto; overflow-x:hidden; overscroll-behavior-y:contain; padding:18px 10px 28px; text-align:left; }
.game-richtext-h1 { margin:0 0 18px; font-size:clamp(27px,7vw,34px); line-height:1.05; font-weight:600; letter-spacing:-0.035em; }
.game-richtext-h2 { margin:22px 0 8px; font-size:clamp(18px,4.6vw,22px); line-height:1.15; font-weight:600; }
.game-richtext-h3 { margin:18px 0 7px; font-size:16px; line-height:1.2; font-weight:600; }
.game-richtext-p, .game-richtext-list, .game-richtext-callout { font-size:15px; line-height:1.48; }
.game-richtext-p { margin:0 0 12px; }
.game-richtext-list { margin:0 0 14px; padding-left:22px; }
.game-richtext-list li { margin:0 0 6px; }
.game-richtext-callout { margin:16px 0; padding:12px 14px; border:1px solid var(--line); border-radius:14px; background:var(--panel); }
.rt-bold { font-weight:700; }
.rt-italic { font-style:italic; }
.affiliate-card { display:grid; gap:10px; padding:14px; margin:0 0 12px; border:1px solid var(--line); border-radius:14px; }
.affiliate-merchant { font-weight:600; }
.affiliate-link { color:var(--purple); font-weight:600; text-decoration:none; }


/* Yahtzee Auto Scoring v2 - responsive tile scorecard */
.die-instance {
    transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}
.die-instance.is-held {
    transform: translateY(-6px) scale(1.03);
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--purple) 70%, transparent));
}
.die-instance.is-held::after {
    content: "";
    position: absolute;
    inset: 3px;
    border: 2px solid var(--purple);
    border-radius: 16px;
    pointer-events: none;
    opacity: .9;
}

.game-tab-content[data-game-component="autoscoring"] {
    padding-top: clamp(6px, 1.4vw, 10px);
}

.game-tab-content[data-game-component="autoscoring"] > * {
    width: 100%;
    max-width: 560px;
    margin-inline: auto;
}

.yahtzee-info-grid,
.yahtzee-score-grid {
    width: 100%;
    display: grid;
    gap: clamp(5px, 1.35vw, 8px);
}

.yahtzee-info-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: clamp(8px, 2vw, 12px);
}

.yahtzee-score-group {
    margin: 0 0 clamp(8px, 2vw, 12px);
}

.yahtzee-score-heading {
    margin: 0 0 clamp(4px, 1vw, 6px);
    color: var(--muted);
    font-size: clamp(10px, 2.3vw, 12px);
    font-weight: 700;
    letter-spacing: .05em;
    text-align: center;
    text-transform: uppercase;
}

.yahtzee-score-grid-upper {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.yahtzee-score-grid-lower {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.yahtzee-tile {
    --card-a: #f4efff;
    --card-b: #e7dcff;
    position: relative;
    overflow: hidden;
    min-width: 0;
    min-height: clamp(50px, 11.5vw, 64px);
    border: 1px solid rgb(92 75 130 / 0.10);
    border-radius: clamp(12px, 3vw, 17px);
    padding: clamp(5px, 1.25vw, 8px);
    background:
        radial-gradient(circle at 20% 12%, rgb(255 255 255 / 0.82), transparent 38%),
        linear-gradient(145deg, var(--card-a), var(--card-b));
    box-shadow:
        0 5px 14px rgb(31 20 56 / 0.065),
        inset 0 1px 0 rgb(255 255 255 / 0.70);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(2px, .7vw, 4px);
    text-align: center;
}

button.yahtzee-tile {
    font: inherit;
}

.yahtzee-score-tile {
    cursor: default;
    transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease, filter 120ms ease;
}

.yahtzee-score-tile.is-available {
    --card-a: #eef8ff;
    --card-b: #dceeff;
    cursor: pointer;
    border-color: color-mix(in srgb, var(--purple) 28%, transparent);
    box-shadow:
        0 6px 16px rgb(31 20 56 / 0.075),
        0 0 0 1px color-mix(in srgb, var(--purple) 10%, transparent),
        inset 0 1px 0 rgb(255 255 255 / 0.78);
}

.yahtzee-score-tile.is-available:active {
    transform: scale(.965);
}

.yahtzee-score-tile.is-scored {
    --card-a: #f2efff;
    --card-b: #e3dcff;
    opacity: .62;
}

.yahtzee-score-tile.is-yahtzee {
    grid-column: span 2;
    --card-a: #fff2f7;
    --card-b: #ffe0ec;
}

.yahtzee-score-tile.is-yahtzee.is-available {
    --card-a: #fff0f7;
    --card-b: #ffd8e9;
}

.yahtzee-info-tile {
    --card-a: #fff4e9;
    --card-b: #ffe1c3;
}

.yahtzee-info-grid .yahtzee-info-tile:nth-child(2) {
    --card-a: #eef8ff;
    --card-b: #dceeff;
}

.yahtzee-info-grid .yahtzee-info-tile:nth-child(3) {
    --card-a: #f2efff;
    --card-b: #e3dcff;
}

.yahtzee-info-grid .yahtzee-info-total {
    --card-a: #fff2f7;
    --card-b: #ffe0ec;
}

.yahtzee-tile-label {
    width: 100%;
    min-width: 0;
    color: var(--muted);
    font-size: clamp(9px, 2vw, 11px);
    line-height: 1.05;
    font-weight: 650;
    letter-spacing: -0.01em;
    text-align: center;
    overflow-wrap: anywhere;
}

.yahtzee-score-grid-upper .yahtzee-tile-label {
    color: var(--text);
    font-size: clamp(15px, 4vw, 21px);
    line-height: 1;
    font-weight: 700;
}

.yahtzee-tile-value {
    width: 100%;
    color: var(--text);
    font-size: clamp(14px, 3.5vw, 18px);
    line-height: 1;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.yahtzee-score-tile:not(.is-available):not(.is-scored) .yahtzee-tile-value {
    color: var(--muted);
}

.yahtzee-score-tile.is-available .yahtzee-tile-value {
    color: var(--purple);
}

.yahtzee-score-tile.is-scored .yahtzee-tile-value {
    color: var(--text);
}

:root[data-theme="light"] .yahtzee-tile {
    border-color: rgb(255 255 255 / .82);
    background:
        linear-gradient(135deg, rgb(255 255 255 / .42), rgb(255 255 255 / .10) 46%, rgb(255 255 255 / .22)),
        linear-gradient(145deg, color-mix(in srgb, var(--card-a) 70%, white 30%), color-mix(in srgb, var(--card-b) 82%, white 18%));
    -webkit-backdrop-filter: blur(18px) saturate(1.5) brightness(1.04);
    backdrop-filter: blur(18px) saturate(1.5) brightness(1.04);
    box-shadow:
        0 6px 16px rgb(37 31 52 / .08),
        inset 1px 1px 0 rgb(255 255 255 / .94),
        inset -1px -1px 0 rgb(64 55 80 / .07);
}

:root[data-theme="dark"] .yahtzee-tile {
    --card-a: #2d2840;
    --card-b: #201d31;
    color: rgb(255 255 255 / .95);
    border-color: rgb(255 255 255 / .10);
    background:
        radial-gradient(circle at 18% 10%, rgb(255 255 255 / .10), transparent 40%),
        linear-gradient(145deg, var(--card-a), var(--card-b));
    box-shadow:
        0 6px 16px rgb(0 0 0 / .24),
        inset 0 1px 0 rgb(255 255 255 / .08);
}

:root[data-theme="dark"] .yahtzee-score-tile.is-available {
    --card-a: #243744;
    --card-b: #1b2933;
    border-color: rgb(150 125 255 / .34);
}

:root[data-theme="dark"] .yahtzee-score-tile.is-scored {
    --card-a: #302a46;
    --card-b: #242036;
}

:root[data-theme="dark"] .yahtzee-score-tile.is-yahtzee {
    --card-a: #412634;
    --card-b: #2c1d27;
}

:root[data-theme="dark"] .yahtzee-info-tile {
    --card-a: #44301f;
    --card-b: #2f241b;
}

:root[data-theme="dark"] .yahtzee-info-grid .yahtzee-info-tile:nth-child(2) {
    --card-a: #243744;
    --card-b: #1b2933;
}

:root[data-theme="dark"] .yahtzee-info-grid .yahtzee-info-tile:nth-child(3) {
    --card-a: #302a46;
    --card-b: #242036;
}

:root[data-theme="dark"] .yahtzee-info-grid .yahtzee-info-total {
    --card-a: #412634;
    --card-b: #2c1d27;
}

:root[data-theme="dark"] .yahtzee-tile-label {
    color: rgb(255 255 255 / .64);
}

:root[data-theme="dark"] .yahtzee-score-grid-upper .yahtzee-tile-label,
:root[data-theme="dark"] .yahtzee-tile-value {
    color: rgb(255 255 255 / .95);
}

:root[data-theme="dark"] .yahtzee-score-tile.is-available .yahtzee-tile-value {
    color: rgb(190 172 255 / 1);
}

@media (max-width: 390px) {
    .yahtzee-info-grid,
    .yahtzee-score-grid {
        gap: 4px;
    }

    .yahtzee-tile {
        min-height: 46px;
        border-radius: 11px;
        padding: 4px 3px;
    }

    .yahtzee-tile-label {
        font-size: 8.5px;
    }

    .yahtzee-score-grid-upper .yahtzee-tile-label {
        font-size: 15px;
    }

    .yahtzee-tile-value {
        font-size: 14px;
    }
}

/* 2026-08-16 Game Page design pass v1 */
.landing:has(.discovery.is-game-view){grid-template-rows:minmax(250px,53.5%) minmax(0,46.5%)}
.landing:has(.discovery.is-game-view) .roll-zone{gap:clamp(12px,2.2vh,22px);padding-bottom:14px}
.die-button:has(.die-stage[data-count="2"]){width:clamp(300px,72vw,360px)}
.die-button:has(.die-stage[data-count="5"]){width:clamp(330px,82vw,410px)}
.die-stage[data-count="2"]{gap:clamp(6px,1.6vw,10px)} .die-stage[data-count="2"] .die-instance{flex-basis:45%}
.die-stage[data-count="5"]{gap:clamp(5px,1.2vw,8px)} .die-stage[data-count="5"] .die-instance{flex-basis:30.5%}
.game-tab-content[data-game-component="autoscoring"]{padding:clamp(5px,1vw,8px) 8px 10px}
.yahtzee-info-grid,.yahtzee-score-grid{gap:clamp(4px,1vw,6px)} .yahtzee-info-grid{margin-bottom:clamp(5px,1.2vw,8px)} .yahtzee-score-group{margin-bottom:clamp(5px,1.2vw,8px)} .yahtzee-score-heading{margin-bottom:3px;font-size:clamp(9px,2vw,11px)}
.yahtzee-tile{min-height:clamp(46px,9.8vw,55px);border-radius:clamp(11px,2.5vw,15px);padding:clamp(4px,1vw,6px)} .yahtzee-tile-value{font-size:clamp(14px,3.2vw,17px)}
.yahtzee-score-grid-upper .yahtzee-tile-label.yahtzee-die-face{width:clamp(25px,6.2vw,32px);height:clamp(25px,6.2vw,32px);display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);padding:3px;border:1px solid color-mix(in srgb,currentColor 22%,transparent);border-radius:7px;background:rgb(255 255 255/.40)}
.yahtzee-pip{width:clamp(3px,.9vw,4px);height:clamp(3px,.9vw,4px);align-self:center;justify-self:center;border-radius:50%;background:currentColor}.yahtzee-pip[data-cell="1"]{grid-area:1/1}.yahtzee-pip[data-cell="3"]{grid-area:1/3}.yahtzee-pip[data-cell="4"]{grid-area:2/1}.yahtzee-pip[data-cell="5"]{grid-area:2/2}.yahtzee-pip[data-cell="6"]{grid-area:2/3}.yahtzee-pip[data-cell="7"]{grid-area:3/1}.yahtzee-pip[data-cell="9"]{grid-area:3/3}
:root[data-theme="dark"] .yahtzee-score-grid-upper .yahtzee-die-face{background:rgb(255 255 255/.07)}
.yahtzee-complete-backdrop{position:fixed;inset:0;z-index:1500;display:grid;place-items:center;padding:20px;background:rgb(0 0 0/.32);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}
.yahtzee-complete-modal{width:min(360px,100%);padding:22px;border:1px solid rgb(255 255 255/.22);border-radius:26px;background:color-mix(in srgb,var(--bg) 92%,transparent);color:var(--text);box-shadow:0 24px 70px rgb(0 0 0/.28);text-align:center}.yahtzee-complete-title{font-size:20px;font-weight:700}.yahtzee-complete-label{margin-top:14px;color:var(--muted);font-size:13px;font-weight:600;text-transform:uppercase;letter-spacing:.05em}.yahtzee-complete-score{display:block;margin:4px 0 20px;font-size:clamp(52px,15vw,72px);line-height:1;letter-spacing:-.04em}.yahtzee-complete-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px}.yahtzee-complete-button{min-height:46px;border:1px solid var(--line);border-radius:15px;background:var(--panel);color:var(--text);font-weight:650;cursor:pointer}.yahtzee-complete-button.is-primary{border-color:transparent;background:linear-gradient(100deg,var(--purple),var(--pink));color:white}
@media(max-height:720px){.landing:has(.discovery.is-game-view){grid-template-rows:minmax(230px,55%) minmax(0,45%)}.yahtzee-tile{min-height:43px}}


/* 2026-08-16 iPhone responsive pass v2
   Goal: keep scorecard and multi-dice physically separate, reclaim ad height,
   and use the Dice Area instead of letting square stages overflow upward. */

/* Supported Cubiri ad slots:
   mobile: 320x50
   wider shell/tablet: 468x60
   The app shell is currently max 520px, so a 728x90 leaderboard is intentionally
   not enabled until the page architecture itself becomes wider. */
:root {
    --ad-h: 50px;
}

.bottom-zone {
    min-height: var(--ad-h);
    font-size: clamp(24px, 8vw, 34px);
    line-height: 1;
}

@media (min-width: 500px) {
    :root {
        --ad-h: 60px;
    }
}

/* Override the old short-screen ad height. */
@media (max-height: 620px) {
    :root {
        --ad-h: 50px;
    }
}

/* Multi-dice stages must not be square. The old square button created a huge
   invisible vertical box and forced the top dice row into Content Area. */
.die-button:has(.die-stage[data-count="2"]) {
    width: clamp(300px, 72vw, 360px);
    height: clamp(150px, 20vh, 190px);
    aspect-ratio: auto;
}

.die-button:has(.die-stage[data-count="5"]) {
    width: clamp(330px, 82vw, 410px);
    height: clamp(235px, 29vh, 285px);
    aspect-ratio: auto;
}

/* Let the cluster occupy the useful middle of Dice Area.
   The smaller real stage height moves it down naturally while keeping
   Tap to Roll close below it. */
.landing:has(.discovery.is-game-view) .roll-zone {
    justify-content: flex-end;
    gap: clamp(8px, 1.25vh, 13px);
    padding: 0 14px clamp(10px, 1.5vh, 16px);
}

/* A little extra safety on short physical screens such as iPhone landscape-ish
   browser chrome states. Do not shrink the dice themselves; shrink dead space. */
@media (max-height: 760px) {
    .landing:has(.discovery.is-game-view) .roll-zone {
        gap: 7px;
        padding-bottom: 8px;
    }

    .die-button:has(.die-stage[data-count="5"]) {
        height: clamp(220px, 28vh, 255px);
    }
}


/* 2026-08-16 dual thumb roll controls experiment v1 */
.roll-zone {
    position: relative;
}

.roll-label {
    visibility: hidden;
    pointer-events: none;
    user-select: none;
}

.roll-side-control {
    position: absolute;
    z-index: 12;
    bottom: clamp(38px, 4.4vh, 52px);
    width: clamp(72px, 18vw, 92px);
    min-height: clamp(64px, 8vh, 78px);
    border: 0;
    padding: 8px 5px;
    background: transparent;
    color: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    font: inherit;
    font-size: clamp(14px, 3.6vw, 18px);
    line-height: 1.05;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.roll-side-control::before {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 20px;
    border: 1px solid transparent;
    background: linear-gradient(90deg, var(--purple), var(--pink), var(--orange)) border-box;
    -webkit-mask:
        linear-gradient(#000 0 0) padding-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: .26;
    transition: opacity 120ms ease, transform 120ms ease;
}

.roll-side-control > span {
    position: relative;
    z-index: 1;
    background: linear-gradient(90deg, var(--purple) 0 42%, var(--pink) 58%, var(--orange) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.roll-side-control.is-left {
    left: clamp(9px, 2.4vw, 16px);
}

.roll-side-control.is-right {
    right: clamp(9px, 2.4vw, 16px);
}

.roll-side-control:active::before {
    opacity: .68;
    transform: scale(.94);
}

.roll-side-control:focus-visible {
    outline: 2px solid var(--purple);
    outline-offset: 2px;
    border-radius: 20px;
}

/* For 5d6, place the thumb controls alongside the lower pair rather than
   underneath the cluster. This keeps them away from AdSpace and away from dice. */
.roll-zone:has(.die-stage[data-count="5"]) .roll-side-control {
    bottom: clamp(48px, 5.7vh, 66px);
}

/* 2d6 has more side room, so the targets can sit a touch higher. */
.roll-zone:has(.die-stage[data-count="2"]) .roll-side-control {
    bottom: clamp(46px, 5.4vh, 62px);
}

/* Preserve a non-interactive buffer above the ad even on short Safari viewports. */
@media (max-height: 760px) {
    .roll-side-control,
    .roll-zone:has(.die-stage[data-count="2"]) .roll-side-control,
    .roll-zone:has(.die-stage[data-count="5"]) .roll-side-control {
        bottom: 42px;
        min-height: 60px;
    }
}


/* 2026-08-16 dual thumb roll controls v2 */
.roll-side-control {
    bottom: clamp(36px, 4.2vh, 50px);
    width: clamp(108px, 27vw, 138px);
    min-height: clamp(96px, 12vh, 116px);
    padding: 12px 10px;
    overflow: visible;
    isolation: isolate;
    border-radius: 0;
}
.roll-side-control.is-left {
    left: 0;
    align-items: flex-start;
    padding-left: clamp(18px, 4vw, 24px);
}
.roll-side-control.is-right {
    right: 0;
    align-items: flex-end;
    padding-right: clamp(18px, 4vw, 24px);
}
.roll-side-control::before {
    inset: 0;
    border: 0;
    border-radius: 0;
    -webkit-mask: none;
    mask: none;
    opacity: .42;
    filter: blur(14px);
    transform: scale(1.08);
    pointer-events: none;
}
.roll-side-control.is-left::before {
    background: radial-gradient(ellipse at left center,
        color-mix(in srgb, var(--purple) 25%, transparent) 0%,
        color-mix(in srgb, var(--pink) 10%, transparent) 48%,
        transparent 76%);
}
.roll-side-control.is-right::before {
    background: radial-gradient(ellipse at right center,
        color-mix(in srgb, var(--orange) 22%, transparent) 0%,
        color-mix(in srgb, var(--pink) 10%, transparent) 48%,
        transparent 76%);
}
.roll-side-control > span {
    font-size: clamp(18px, 4.5vw, 23px);
    line-height: 1.02;
}
.roll-side-control.is-left > span { text-align: left; }
.roll-side-control.is-right > span { text-align: right; }

.roll-zone:has(.die-stage[data-count="5"]) .roll-side-control {
    bottom: clamp(50px, 5.8vh, 68px);
}
.roll-zone:has(.die-stage[data-count="2"]) .roll-side-control {
    bottom: clamp(48px, 5.5vh, 64px);
}
@media (max-height: 760px) {
    .roll-side-control,
    .roll-zone:has(.die-stage[data-count="2"]) .roll-side-control,
    .roll-zone:has(.die-stage[data-count="5"]) .roll-side-control {
        bottom: 44px;
        min-height: 90px;
    }
}


/* Monopoly Roll component v1 */
.game-tab-content[data-game-component="monopoly-roll"] {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(14px, 3vw, 22px);
}

.monopoly-roll-grid {
    width: 100%;
    max-width: 520px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(7px, 1.7vw, 10px);
}

.monopoly-roll-tile {
    --card-a: #eef8ff;
    --card-b: #dceeff;
    min-width: 0;
    min-height: clamp(118px, 28vw, 150px);
    border: 1px solid rgb(92 75 130 / .10);
    border-radius: clamp(17px, 4vw, 22px);
    padding: clamp(10px, 2.5vw, 15px);
    background:
        radial-gradient(circle at 20% 12%, rgb(255 255 255 / .82), transparent 38%),
        linear-gradient(145deg, var(--card-a), var(--card-b));
    box-shadow:
        0 7px 20px rgb(31 20 56 / .08),
        inset 0 1px 0 rgb(255 255 255 / .72);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-align: center;
}

.monopoly-roll-tile:nth-child(2) {
    --card-a: #f2efff;
    --card-b: #e3dcff;
}

.monopoly-roll-tile.is-total {
    --card-a: #fff4e9;
    --card-b: #ffe1c3;
}

.monopoly-roll-tile.is-doubles {
    --card-a: #fff2f7;
    --card-b: #ffdce9;
    animation: monopoly-result-pulse 620ms ease-out 1;
}

.monopoly-roll-tile.is-jail {
    --card-a: #ffe9ec;
    --card-b: #ffcfd7;
    animation: monopoly-result-pulse 720ms ease-out 1;
}

.monopoly-roll-label {
    color: var(--muted);
    font-size: clamp(10px, 2.5vw, 13px);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.monopoly-roll-value {
    color: var(--text);
    font-size: clamp(30px, 8vw, 46px);
    line-height: 1;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.monopoly-roll-hint {
    color: var(--purple);
    font-size: clamp(9px, 2.2vw, 12px);
    line-height: 1.05;
    font-weight: 700;
    text-transform: uppercase;
}

.monopoly-die-face {
    width: clamp(46px, 11vw, 60px);
    height: clamp(46px, 11vw, 60px);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: clamp(5px, 1.3vw, 7px);
    border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
    border-radius: 13px;
    background: rgb(255 255 255 / .42);
    box-shadow:
        0 3px 9px rgb(30 20 50 / .08),
        inset 0 1px 1px rgb(255 255 255 / .62);
}

.monopoly-die-pip {
    width: clamp(5px, 1.35vw, 7px);
    height: clamp(5px, 1.35vw, 7px);
    align-self: center;
    justify-self: center;
    border-radius: 50%;
    background: currentColor;
}

.monopoly-die-pip[data-cell="1"] { grid-column: 1; grid-row: 1; }
.monopoly-die-pip[data-cell="3"] { grid-column: 3; grid-row: 1; }
.monopoly-die-pip[data-cell="4"] { grid-column: 1; grid-row: 2; }
.monopoly-die-pip[data-cell="5"] { grid-column: 2; grid-row: 2; }
.monopoly-die-pip[data-cell="6"] { grid-column: 3; grid-row: 2; }
.monopoly-die-pip[data-cell="7"] { grid-column: 1; grid-row: 3; }
.monopoly-die-pip[data-cell="9"] { grid-column: 3; grid-row: 3; }

:root[data-theme="dark"] .monopoly-roll-tile {
    --card-a: #243744;
    --card-b: #1b2933;
    border-color: rgb(255 255 255 / .10);
    box-shadow:
        0 7px 20px rgb(0 0 0 / .24),
        inset 0 1px 0 rgb(255 255 255 / .08);
}

:root[data-theme="dark"] .monopoly-roll-tile:nth-child(2) {
    --card-a: #302a46;
    --card-b: #242036;
}

:root[data-theme="dark"] .monopoly-roll-tile.is-total {
    --card-a: #44301f;
    --card-b: #2f241b;
}

:root[data-theme="dark"] .monopoly-roll-tile.is-doubles {
    --card-a: #412634;
    --card-b: #2c1d27;
}

:root[data-theme="dark"] .monopoly-roll-tile.is-jail {
    --card-a: #48252b;
    --card-b: #301c20;
}

:root[data-theme="dark"] .monopoly-die-face {
    background: rgb(255 255 255 / .07);
}

@keyframes monopoly-result-pulse {
    0% { transform: scale(.97); filter: brightness(1); }
    45% { transform: scale(1.025); filter: brightness(1.10); }
    100% { transform: scale(1); filter: brightness(1); }
}

@media (max-width: 390px) {
    .monopoly-roll-grid { gap: 5px; }
    .monopoly-roll-tile {
        min-height: 108px;
        border-radius: 15px;
        padding: 8px 5px;
    }
    .monopoly-roll-label { font-size: 9px; }
    .monopoly-roll-hint { font-size: 8.5px; }
}


/* Generic rich-text rule cards v1 */
.game-tab-content:has(.game-rule-card) {
    padding: clamp(8px, 1.8vw, 12px);
}

.game-rule-card {
    --rule-accent: var(--purple);
    width: 100%;
    margin: 0 0 clamp(6px, 1.4vw, 9px);
    border: 1px solid color-mix(in srgb, var(--rule-accent) 22%, var(--line));
    border-radius: clamp(15px, 3.6vw, 20px);
    background:
        radial-gradient(circle at 9% 0%, color-mix(in srgb, var(--rule-accent) 9%, transparent), transparent 40%),
        color-mix(in srgb, var(--panel) 94%, transparent);
    box-shadow:
        0 5px 16px rgb(0 0 0 / .07),
        inset 0 1px 0 rgb(255 255 255 / .05);
    overflow: hidden;
}

.game-rule-card[data-accent="pink"] { --rule-accent: var(--pink); }
.game-rule-card[data-accent="orange"] { --rule-accent: var(--orange); }
.game-rule-card[data-accent="blue"] { --rule-accent: #50a8d8; }

.game-rule-card-header {
    width: 100%;
    min-height: clamp(46px, 10.5vw, 54px);
    border: 0;
    padding: clamp(9px, 2vw, 12px) clamp(12px, 2.8vw, 16px);
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.game-rule-card-title-wrap {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
}

.game-rule-card-icon {
    width: 26px;
    flex: 0 0 26px;
    font-size: 18px;
    line-height: 1;
    text-align: center;
}

.game-rule-card-title {
    min-width: 0;
    font-size: clamp(13px, 3vw, 15px);
    line-height: 1.15;
    font-weight: 720;
}

.game-rule-card-marker {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-right: 2px solid color-mix(in srgb, var(--rule-accent) 80%, white 20%);
    border-bottom: 2px solid color-mix(in srgb, var(--rule-accent) 80%, white 20%);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 150ms ease;
}

.game-rule-card.is-open .game-rule-card-marker {
    transform: rotate(225deg) translate(-1px, -1px);
}

.game-rule-card-body {
    display: none;
    padding: 0 clamp(13px, 3vw, 17px) clamp(12px, 2.8vw, 16px);
}

.game-rule-card.is-open .game-rule-card-body {
    display: block;
}

.game-rule-card-body .game-richtext-p,
.game-rule-card-body .game-richtext-list,
.game-rule-card-body .game-richtext-callout {
    margin-top: 7px;
    margin-bottom: 0;
}

.game-rule-card-body .game-richtext-p {
    font-size: clamp(12px, 2.65vw, 14px);
    line-height: 1.42;
}

.game-rule-card-body .game-richtext-list {
    padding-left: 19px;
    font-size: clamp(12px, 2.65vw, 14px);
    line-height: 1.4;
}

.game-rule-card-body .game-richtext-callout {
    border-left-color: var(--rule-accent);
}

@media (max-height: 760px) {
    .game-rule-card-header {
        min-height: 43px;
        padding-block: 8px;
    }

    .game-rule-card {
        margin-bottom: 5px;
    }
}


/* Dice Tool V1 */
.discovery.is-dice-tool-view {
    overflow: hidden;
}

.dice-tool-bar {
    grid-template-columns: minmax(0, 1fr) 44px;
}

.dice-tool-title {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    color: var(--pink);
    font-size: clamp(15px, 3.8vw, 19px);
    font-weight: 760;
}

.dice-tool-content {
    min-height: 0;
    overflow-y: auto;
    padding: clamp(9px, 2vw, 13px);
    scrollbar-width: none;
}

.dice-tool-content::-webkit-scrollbar {
    display: none;
}

.dice-tool-presets {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: clamp(4px, 1vw, 7px);
    margin-bottom: clamp(8px, 1.7vw, 11px);
}

.dice-tool-preset {
    min-width: 0;
    min-height: 38px;
    border: 1px solid color-mix(in srgb, var(--pink) 18%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--panel) 92%, transparent);
    color: var(--muted);
    font: inherit;
    font-size: clamp(10px, 2.4vw, 12px);
    font-weight: 740;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.dice-tool-preset.is-active {
    color: var(--text);
    border-color: color-mix(in srgb, var(--pink) 48%, var(--line));
    background:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--pink) 18%, transparent), transparent 72%),
        color-mix(in srgb, var(--panel) 95%, transparent);
}

.dice-tool-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(7px, 1.6vw, 10px);
    margin-bottom: clamp(9px, 2vw, 13px);
}

.dice-tool-stepper {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 8px 9px 9px;
    background: var(--panel);
    text-align: center;
}

.dice-tool-stepper-label {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: clamp(10px, 2.4vw, 12px);
    font-weight: 680;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.dice-tool-stepper-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 4px;
}

.dice-tool-stepper-button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: color-mix(in srgb, var(--pink) 11%, var(--bg));
    color: var(--text);
    font: inherit;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
}

.dice-tool-stepper-value {
    color: var(--text);
    font-size: clamp(21px, 5vw, 27px);
    font-weight: 760;
    font-variant-numeric: tabular-nums;
}

.dice-tool-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dice-tool-results-empty {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: clamp(12px, 2.8vw, 14px);
}

.dice-result-grid {
    display: grid;
    grid-template-columns: repeat(var(--result-columns, 3), minmax(0, 1fr));
    gap: clamp(5px, 1.2vw, 8px);
}

.dice-result-grid[data-count="1"] { --result-columns: 1; }
.dice-result-grid[data-count="2"] { --result-columns: 2; }
.dice-result-grid[data-count="3"] { --result-columns: 3; }
.dice-result-grid[data-count="4"] { --result-columns: 4; }
.dice-result-grid[data-count="5"],
.dice-result-grid[data-count="6"] { --result-columns: 3; }

.dice-result-tile {
    min-width: 0;
    min-height: clamp(70px, 17vw, 90px);
    border: 1px solid color-mix(in srgb, var(--pink) 13%, var(--line));
    border-radius: 15px;
    background:
        radial-gradient(circle at 25% 10%, rgb(255 255 255 / .45), transparent 42%),
        color-mix(in srgb, var(--panel) 95%, var(--pink) 5%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center;
}

.dice-result-label {
    color: var(--muted);
    font-size: clamp(9px, 2.1vw, 11px);
    font-weight: 700;
    text-transform: uppercase;
}

.dice-result-value {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

.dice-result-number {
    font-size: clamp(30px, 7vw, 42px);
    line-height: 1;
    font-weight: 780;
    font-variant-numeric: tabular-nums;
}

.dice-result-tile .monopoly-die-face {
    width: clamp(38px, 9vw, 50px);
    height: clamp(38px, 9vw, 50px);
}

.dice-result-total {
    min-height: 48px;
    border-radius: 15px;
    padding: 7px 14px;
    background:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--orange) 14%, transparent), transparent 72%),
        color-mix(in srgb, var(--panel) 95%, transparent);
    border: 1px solid color-mix(in srgb, var(--orange) 17%, var(--line));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dice-result-total span {
    color: var(--muted);
    font-size: clamp(10px, 2.4vw, 12px);
    font-weight: 720;
    text-transform: uppercase;
}

.dice-result-total strong {
    color: var(--text);
    font-size: clamp(23px, 5.8vw, 31px);
    line-height: 1;
    font-weight: 780;
}

/* 6 dice: clean 3 + 3 physical layout. */
.die-button:has(.die-stage[data-count="6"]) {
    width: clamp(330px, 82vw, 410px);
    height: clamp(235px, 29vh, 285px);
    aspect-ratio: auto;
}

.die-stage[data-count="6"] {
    gap: clamp(5px, 1.2vw, 8px);
}

.die-stage[data-count="6"] .die-instance {
    flex-basis: 30.5%;
}

/* Thumb roll controls align with the lower row for 6dX as with 5d6. */
.roll-zone:has(.die-stage[data-count="6"]) .roll-side-control {
    bottom: clamp(50px, 5.8vh, 68px);
}

@media (max-height: 760px) {
    .die-button:has(.die-stage[data-count="6"]) {
        height: clamp(220px, 28vh, 255px);
    }

    .roll-zone:has(.die-stage[data-count="6"]) .roll-side-control {
        bottom: 44px;
    }
}

@media (max-width: 390px) {
    .dice-tool-presets {
        gap: 3px;
    }

    .dice-tool-preset {
        min-height: 34px;
        border-radius: 10px;
        font-size: 9px;
    }

    .dice-result-grid[data-count="4"] {
        --result-columns: 2;
    }
}


/* Cubiri custom catalog icon: Dice Tool */
.discovery-item-icon.is-custom-svg {
    width: 52px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.cubiri-dice-tool-icon {
    width: 52px;
    height: 36px;
    overflow: visible;
}

.cubiri-dice-tool-d6 rect {
    fill: color-mix(in srgb, var(--text) 8%, var(--panel));
    stroke: color-mix(in srgb, var(--text) 72%, transparent);
    stroke-width: 1.6;
}

.cubiri-dice-tool-d6 circle {
    fill: var(--text);
}

.cubiri-dice-tool-d6-back {
    opacity: .58;
}

.cubiri-dice-tool-d6-front {
    opacity: .94;
}

.cubiri-dice-tool-d20 > path:first-child {
    fill: color-mix(in srgb, var(--purple) 13%, var(--panel));
    stroke: color-mix(in srgb, var(--pink) 78%, var(--text) 22%);
    stroke-width: 1.45;
    stroke-linejoin: round;
}

.cubiri-dice-tool-d20 > path:not(:first-child) {
    fill: none;
    stroke: color-mix(in srgb, var(--pink) 56%, var(--text) 44%);
    stroke-width: 1.05;
    stroke-linejoin: round;
    opacity: .82;
}

:root[data-theme="dark"] .cubiri-dice-tool-d6 rect {
    fill: color-mix(in srgb, var(--text) 6%, #202127);
}

:root[data-theme="dark"] .cubiri-dice-tool-d20 > path:first-child {
    fill: color-mix(in srgb, var(--purple) 16%, #1a1922);
}


/* Cubiri game icon set v1 */
.discovery-item-icon.is-custom-svg {
    width: 54px;
    height: 38px;
}

.cubiri-catalog-icon {
    width: 54px;
    height: 38px;
    overflow: visible;
}

/* Monopoly: top hat + moustache */
.cubiri-monopoly-icon .monopoly-hat > path,
.cubiri-monopoly-icon .monopoly-hat > rect:not(.hat-band) {
    fill: color-mix(in srgb, var(--text) 90%, #101116 10%);
    stroke: color-mix(in srgb, var(--text) 65%, transparent);
    stroke-width: 1.15;
    stroke-linejoin: round;
}

.cubiri-monopoly-icon .hat-band {
    fill: var(--orange);
    opacity: .88;
}

.cubiri-monopoly-icon .monopoly-moustache path {
    fill: color-mix(in srgb, var(--text) 92%, #141414 8%);
    stroke: color-mix(in srgb, var(--text) 55%, transparent);
    stroke-width: .8;
}

/* Ludo: standing red pawn + toppled green pawn */
.cubiri-ludo-icon .ludo-pawn {
    stroke-width: 1.1;
    stroke-linejoin: round;
}

.cubiri-ludo-icon .ludo-pawn-red > * {
    fill: #ef4055;
    stroke: color-mix(in srgb, #ef4055 72%, var(--text) 28%);
}

.cubiri-ludo-icon .ludo-pawn-green > * {
    fill: #4dbd68;
    stroke: color-mix(in srgb, #4dbd68 72%, var(--text) 28%);
}

.cubiri-ludo-icon .ludo-pawn-red circle,
.cubiri-ludo-icon .ludo-pawn-green circle {
    filter: drop-shadow(0 1px 1px rgb(0 0 0 / .16));
}

/* Yahtzee: exactly five D6 in a compact 3 + 2 arrangement */
.cubiri-yahtzee-icon .mini-die rect {
    fill: color-mix(in srgb, var(--text) 6%, var(--panel));
    stroke: color-mix(in srgb, var(--text) 68%, transparent);
    stroke-width: 1;
}

.cubiri-yahtzee-icon .mini-die circle {
    fill: var(--text);
}

.cubiri-yahtzee-icon .die-a { opacity: .82; }
.cubiri-yahtzee-icon .die-b { opacity: .96; }
.cubiri-yahtzee-icon .die-c { opacity: .84; }
.cubiri-yahtzee-icon .die-d { opacity: .90; }
.cubiri-yahtzee-icon .die-e { opacity: 1; }

:root[data-theme="dark"] .cubiri-yahtzee-icon .mini-die rect {
    fill: color-mix(in srgb, var(--text) 5%, #202127);
}


/* Farkle / 6D6 mobile spacing fix */
.roll-zone:has(.die-stage[data-count="6"]) .die-button {
    translate: 0 clamp(-46px, -5vh, -30px);
}

@media (max-height: 760px) {
    .roll-zone:has(.die-stage[data-count="6"]) .die-button {
        translate: 0 -34px;
    }
}


/* Game Rules/Tips viewport isolation v1 */
.discovery.is-game-view[data-game-tab="rules"],
.discovery.is-game-view[data-game-tab="tips"] {
    overflow: hidden;
}

.discovery.is-game-view[data-game-tab="rules"] .game-tab-content,
.discovery.is-game-view[data-game-tab="tips"] .game-tab-content {
    max-height: clamp(250px, 38vh, 390px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.landing:has(.discovery[data-game-tab="rules"]) .roll-zone .die-button:has(.die-stage[data-count="6"]),
.landing:has(.discovery[data-game-tab="tips"]) .roll-zone .die-button:has(.die-stage[data-count="6"]) {
    width: clamp(292px, 70vw, 350px);
    height: clamp(198px, 24vh, 238px);
    translate: 0 clamp(4px, 1vh, 12px);
}

.landing:has(.discovery[data-game-tab="rules"]) .roll-zone .roll-side-control,
.landing:has(.discovery[data-game-tab="tips"]) .roll-zone .roll-side-control {
    bottom: clamp(34px, 4.5vh, 52px);
}

@media (max-height: 780px) {
    .discovery.is-game-view[data-game-tab="rules"] .game-tab-content,
    .discovery.is-game-view[data-game-tab="tips"] .game-tab-content {
        max-height: clamp(220px, 34vh, 310px);
    }

    .landing:has(.discovery[data-game-tab="rules"]) .roll-zone .die-button:has(.die-stage[data-count="6"]),
    .landing:has(.discovery[data-game-tab="tips"]) .roll-zone .die-button:has(.die-stage[data-count="6"]) {
        width: clamp(276px, 68vw, 326px);
        height: clamp(184px, 22vh, 214px);
        translate: 0 8px;
    }
}

@media (max-height: 700px) {
    .discovery.is-game-view[data-game-tab="rules"] .game-tab-content,
    .discovery.is-game-view[data-game-tab="tips"] .game-tab-content {
        max-height: clamp(190px, 30vh, 250px);
    }

    .landing:has(.discovery[data-game-tab="rules"]) .roll-zone .die-button:has(.die-stage[data-count="6"]),
    .landing:has(.discovery[data-game-tab="tips"]) .roll-zone .die-button:has(.die-stage[data-count="6"]) {
        width: clamp(260px, 64vw, 300px);
        height: clamp(170px, 20vh, 196px);
    }
}


/* Farkle / Kockový poker V1 */
.game-tab-content[data-game-component="farkle-scoring"] {
    padding: clamp(9px, 2vw, 13px);
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.8vw, 11px);
}

.farkle-info-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(5px, 1.2vw, 8px);
}

.farkle-info-tile {
    min-width: 0;
    min-height: clamp(68px, 15vw, 86px);
    padding: 8px 5px;
    border: 1px solid color-mix(in srgb, var(--purple) 13%, var(--line));
    border-radius: 15px;
    background:
        radial-gradient(circle at 30% 0%, color-mix(in srgb, var(--purple) 9%, transparent), transparent 58%),
        var(--panel);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center;
}

.farkle-info-tile.is-total {
    background:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--orange) 13%, transparent), transparent 62%),
        var(--panel);
}

.farkle-info-tile.is-bust,
.farkle-info-tile.is-invalid {
    border-color: color-mix(in srgb, #ef4055 45%, var(--line));
}

.farkle-info-label {
    color: var(--muted);
    font-size: clamp(8.5px, 2vw, 11px);
    line-height: 1.05;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .025em;
}

.farkle-info-value {
    color: var(--text);
    font-size: clamp(22px, 5.2vw, 31px);
    line-height: 1;
    font-weight: 780;
    font-variant-numeric: tabular-nums;
}

.farkle-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 1.35fr .65fr;
    gap: 8px;
}

.farkle-bank-button,
.farkle-new-game-button {
    min-height: 44px;
    border-radius: 14px;
    font: inherit;
    font-size: clamp(12px, 2.8vw, 14px);
    font-weight: 760;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.farkle-bank-button {
    border: 1px solid color-mix(in srgb, var(--pink) 30%, var(--line));
    background:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--pink) 18%, transparent), transparent 75%),
        var(--panel);
    color: var(--text);
}

.farkle-bank-button:disabled {
    opacity: .36;
    cursor: default;
}

.farkle-new-game-button {
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--muted);
}

.farkle-status {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    color: var(--muted);
    font-size: clamp(11px, 2.6vw, 13px);
    font-weight: 680;
    text-align: center;
}

.farkle-status.is-bust {
    color: #ef4055;
    font-weight: 800;
}

.farkle-status.is-hot-dice {
    color: var(--orange);
    font-weight: 800;
}

.die-instance.is-locked-held {
    filter: saturate(.72);
}

.die-instance.is-locked-held::after {
    opacity: .58;
}

@media (max-width: 390px) {
    .farkle-info-grid {
        gap: 4px;
    }

    .farkle-info-tile {
        min-height: 62px;
        border-radius: 13px;
        padding-inline: 3px;
    }

    .farkle-info-label {
        font-size: 8px;
    }
}


/* Cubiri back icon v1 */
.game-back-button {
    display: grid;
    place-items: center;
}

.game-back-icon {
    width: 28px;
    height: 22px;
    overflow: visible;
}

.game-back-icon rect {
    fill: color-mix(in srgb, var(--text) 14%, transparent);
    stroke: color-mix(in srgb, var(--text) 38%, transparent);
    stroke-width: 1;
}

.game-back-icon path {
    fill: none;
    stroke: var(--text);
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* Yahtzee scoring tile typography v1 */
.yahtzee-score-grid .yahtzee-score-label {
    font-size: clamp(13px, 3.2vw, 15px);
    line-height: 1.08;
}
.yahtzee-upper-grid .yahtzee-score-label {
    font-size: clamp(11px, 2.8vw, 13px);
}
.yahtzee-lower-grid .yahtzee-score-label {
    font-size: clamp(14px, 3.55vw, 15.5px);
    line-height: 1.05;
    white-space: normal;
    text-wrap: balance;
    max-width: 100%;
}
@media (max-width: 390px) {
    .yahtzee-lower-grid .yahtzee-score-label {
        font-size: 13.5px;
        line-height: 1.04;
    }
}


/* Yahtzee scoring tile typography v2 - actual DOM selectors */
.yahtzee-info-grid .yahtzee-tile-label {
    font-size: clamp(11.5px, 2.8vw, 13.5px);
    line-height: 1.08;
}

.yahtzee-score-grid-lower .yahtzee-tile-label {
    font-size: clamp(13px, 3.25vw, 15px);
    line-height: 1.08;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    text-wrap: balance;
}

@media (max-width: 390px) {
    .yahtzee-info-grid .yahtzee-tile-label {
        font-size: 11.5px;
    }

    .yahtzee-score-grid-lower .yahtzee-tile-label {
        font-size: 13px;
        line-height: 1.06;
    }
}


/* Cubiri backgammon icon v1 */
.cubiri-backgammon-icon .backgammon-point path {
    fill: color-mix(in srgb, var(--orange) 62%, var(--panel));
    stroke: color-mix(in srgb, var(--orange) 72%, var(--text) 28%);
    stroke-width: 1.1;
    stroke-linejoin: round;
}

.cubiri-backgammon-icon .backgammon-checker > circle:first-child {
    fill: color-mix(in srgb, var(--purple) 20%, var(--panel));
    stroke: color-mix(in srgb, var(--purple) 56%, var(--text) 24%);
    stroke-width: 1.15;
}

.cubiri-backgammon-icon .backgammon-checker > circle:last-child {
    fill: none;
    stroke: color-mix(in srgb, var(--purple) 46%, var(--text) 34%);
    stroke-width: 1;
}

.cubiri-backgammon-icon .checker-back {
    opacity: .78;
}

.cubiri-backgammon-icon .backgammon-die rect {
    fill: color-mix(in srgb, var(--text) 7%, var(--panel));
    stroke: color-mix(in srgb, var(--text) 65%, transparent);
    stroke-width: 1;
}

.cubiri-backgammon-icon .backgammon-die circle {
    fill: var(--text);
}


/* Backgammon roll tiles v1 */
.backgammon-roll-grid {
    grid-template-columns: .72fr .72fr 1.56fr;
}

.backgammon-roll-tile.is-doubles {
    border-color: color-mix(in srgb, var(--orange) 45%, var(--line));
    background:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--orange) 15%, transparent), transparent 72%),
        var(--panel);
}

.backgammon-roll-value {
    white-space: nowrap;
}

.backgammon-roll-tile.is-total .backgammon-roll-value {
    font-size: clamp(20px, 4.7vw, 29px);
}


/* Jamb Classic V1 */
.jamb-info {
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:8px;
    margin-bottom:10px;
}
.jamb-info > div {
    min-height:52px;
    border:1px solid color-mix(in srgb,var(--text) 12%,transparent);
    border-radius:14px;
    background:color-mix(in srgb,var(--text) 4%,transparent);
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    gap:2px;
}
.jamb-info span { font-size:10px; opacity:.62; text-transform:uppercase; letter-spacing:.06em; }
.jamb-info strong { font-size:18px; }
.jamb-score-wrap { overflow:auto; -webkit-overflow-scrolling:touch; border-radius:14px; }
.jamb-score-table { min-width:330px; display:grid; gap:3px; }
.jamb-row {
    display:grid;
    grid-template-columns:minmax(82px,1.4fr) repeat(4,minmax(48px,1fr));
    gap:3px;
}
.jamb-row > div,.jamb-cell {
    min-height:34px;
    border:0;
    border-radius:9px;
    display:grid;
    place-items:center;
    background:color-mix(in srgb,var(--text) 5%,transparent);
    color:var(--text);
    font:inherit;
}
.jamb-row-label { justify-items:start!important; padding:0 8px; font-size:11px; font-weight:700; }
.jamb-head > div { min-height:30px; font-size:11px; font-weight:800; background:color-mix(in srgb,var(--accent) 12%,transparent); }
.jamb-computed > div { min-height:27px; font-size:10px; opacity:.78; }
.jamb-cell { font-size:12px; font-weight:800; cursor:default; }
.jamb-cell.is-playable,.jamb-cell.is-announceable {
    cursor:pointer;
    background:color-mix(in srgb,var(--accent) 18%,transparent);
    box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 42%,transparent);
}
.jamb-cell.is-announceable { background:color-mix(in srgb,#f2b84b 17%,transparent); }
.jamb-cell.is-announced { box-shadow:inset 0 0 0 2px var(--accent); }
.jamb-cell.is-filled { background:color-mix(in srgb,var(--text) 9%,transparent); }
.cubiri-jamb-icon .jamb-sheet rect,.cubiri-jamb-icon .jamb-die rect { fill:none; stroke:currentColor; stroke-width:2; }
.cubiri-jamb-icon .jamb-sheet path,.cubiri-jamb-icon .jamb-check path { fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.cubiri-jamb-icon .jamb-die circle { fill:currentColor; }
@media (max-height:760px) {
    .jamb-info > div { min-height:44px; }
    .jamb-row > div,.jamb-cell { min-height:30px; }
}


/* Jamb mobile game-sheet polish v2 */
.jamb-info {
    gap: 6px;
    margin-bottom: 7px;
}
.jamb-info > div {
    min-height: 46px;
    border-radius: 12px;
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--text) 5%, transparent),
            color-mix(in srgb, var(--text) 2%, transparent));
}
.jamb-info span {
    font-size: 9px;
    opacity: .58;
}
.jamb-info strong {
    font-size: 17px;
}

.jamb-open-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin: 0 0 7px;
    padding: 4px;
    border-radius: 11px;
    background: color-mix(in srgb, var(--text) 3%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 7%, transparent);
}
.jamb-open-strip span {
    min-height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .01em;
    background: color-mix(in srgb, var(--text) 3%, transparent);
    color: color-mix(in srgb, var(--text) 76%, transparent);
}
.jamb-open-strip b {
    color: var(--accent);
    font-size: 12px;
}

.jamb-score-wrap {
    position: relative;
    overflow: auto;
    border-radius: 14px;
    background: color-mix(in srgb, var(--text) 1.5%, transparent);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--text) 7%, transparent),
        0 10px 30px rgba(0,0,0,.08);
    scrollbar-width: thin;
}
.jamb-score-table {
    gap: 1px;
    padding: 3px;
    background: color-mix(in srgb, var(--text) 4%, transparent);
}
.jamb-row {
    gap: 1px;
}
.jamb-row > div,
.jamb-cell {
    min-height: 31px;
    border-radius: 5px;
    background: color-mix(in srgb, #101319 94%, var(--text) 6%);
}
.jamb-head {
    position: sticky;
    top: 0;
    z-index: 5;
}
.jamb-head > div {
    min-height: 32px;
    border-radius: 6px;
    background: color-mix(in srgb, #171421 82%, var(--accent) 18%);
    box-shadow: 0 3px 10px rgba(0,0,0,.18);
    color: color-mix(in srgb, var(--text) 92%, transparent);
    font-size: 12px;
}
.jamb-head > div:first-child {
    position: sticky;
    left: 0;
    z-index: 7;
}
.jamb-row-label {
    position: sticky;
    left: 0;
    z-index: 3;
    padding: 0 8px !important;
    font-size: 11px;
    letter-spacing: .015em;
    background: #12151b !important;
    box-shadow: 4px 0 8px rgba(0,0,0,.12);
}
.jamb-computed {
    margin: 2px 0;
}
.jamb-computed > div {
    min-height: 25px;
    border-radius: 4px;
    background: color-mix(in srgb, #15141b 86%, var(--accent) 14%);
    color: color-mix(in srgb, var(--text) 74%, transparent);
    font-size: 9px;
    font-weight: 700;
}
.jamb-computed > div:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: color-mix(in srgb, #15141b 86%, var(--accent) 14%);
}
.jamb-cell {
    font-size: 12px;
    color: color-mix(in srgb, var(--text) 32%, transparent);
    transition: background .14s ease, box-shadow .14s ease, transform .14s ease, color .14s ease;
}
.jamb-cell:disabled {
    opacity: .42;
}
.jamb-cell.is-filled {
    opacity: 1;
    color: color-mix(in srgb, var(--text) 78%, transparent);
    background: color-mix(in srgb, #151820 88%, var(--text) 12%);
}
.jamb-cell.is-playable,
.jamb-cell.is-announceable {
    opacity: 1;
    color: var(--text);
    background:
        radial-gradient(circle at 50% 40%,
            color-mix(in srgb, var(--accent) 28%, transparent),
            color-mix(in srgb, var(--accent) 10%, #15131c) 72%);
    box-shadow:
        inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 70%, transparent),
        0 0 14px color-mix(in srgb, var(--accent) 16%, transparent);
    cursor: pointer;
}
.jamb-cell.is-playable:active,
.jamb-cell.is-announceable:active {
    transform: scale(.96);
}
.jamb-cell.is-announceable {
    background:
        radial-gradient(circle at 50% 40%,
            rgba(255,135,42,.25),
            rgba(255,135,42,.07) 72%);
    box-shadow:
        inset 0 0 0 1.5px rgba(255,135,42,.68),
        0 0 14px rgba(255,135,42,.13);
}
.jamb-cell.is-announced {
    box-shadow:
        inset 0 0 0 2px var(--accent),
        0 0 16px color-mix(in srgb, var(--accent) 22%, transparent);
}

@media (max-width: 430px) {
    .jamb-score-table {
        min-width: 100%;
    }
    .jamb-row {
        grid-template-columns: minmax(86px, 1.45fr) repeat(4, minmax(45px, 1fr));
    }
}
@media (max-height: 760px) {
    .jamb-open-strip span { min-height: 22px; }
    .jamb-row > div,
    .jamb-cell { min-height: 28px; }
}


/* Catan companion v1 */
.cubiri-catan-icon .catan-hex path {
    fill: color-mix(in srgb, var(--orange) 14%, var(--panel));
    stroke: color-mix(in srgb, var(--orange) 60%, var(--text) 20%);
    stroke-width: 1.2;
    stroke-linejoin: round;
}
.cubiri-catan-icon .catan-hex path:last-child {
    fill: color-mix(in srgb, var(--purple) 14%, var(--panel));
    stroke: color-mix(in srgb, var(--purple) 58%, var(--text) 20%);
}
.cubiri-catan-icon .catan-die rect {
    fill: color-mix(in srgb, var(--text) 7%, var(--panel));
    stroke: color-mix(in srgb, var(--text) 65%, transparent);
    stroke-width: 1;
}
.cubiri-catan-icon .catan-die circle {
    fill: var(--text);
}

.game-tab-content[data-game-component="roll"] .catan-roll-grid {
    width: 100%;
    max-width: 560px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(6px, 1.5vw, 9px);
}

.catan-roll-tile {
    min-height: clamp(104px, 24vw, 132px);
    padding: clamp(8px, 2vw, 13px);
}

.catan-roll-tile.is-event {
    --card-a: #eef7f0;
    --card-b: #dcecdf;
}

.catan-roll-tile.is-production {
    border-color: color-mix(in srgb, #74c67a 30%, var(--line));
}

.catan-roll-tile.is-robber {
    --card-a: #fff0f1;
    --card-b: #ffdadd;
    border-color: color-mix(in srgb, #ff4f5e 38%, var(--line));
    animation: monopoly-result-pulse 680ms ease-out 1;
}

.catan-roll-value {
    font-size: clamp(25px, 6.2vw, 38px);
}

.catan-roll-tile.is-event .catan-roll-value {
    font-size: clamp(15px, 3.7vw, 22px);
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.catan-roll-hint {
    text-align: center;
    font-size: clamp(9px, 2vw, 11px);
    line-height: 1.15;
}

@media (max-width: 430px) {
    .game-tab-content[data-game-component="roll"] .catan-roll-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .catan-roll-tile {
        min-height: 96px;
    }
}


/* Catan event full-width row */
.game-tab-content[data-game-component="roll"] .catan-roll-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.game-tab-content[data-game-component="roll"] .catan-roll-tile.is-event {
    grid-column: 1 / -1;
    min-height: 84px;
}

.game-tab-content[data-game-component="roll"] .catan-roll-tile.is-event .catan-roll-value {
    font-size: clamp(28px, 7vw, 42px);
    line-height: 1;
}

.game-tab-content[data-game-component="roll"] .catan-roll-tile.is-event .catan-roll-hint {
    font-size: clamp(10px, 2.2vw, 12px);
}

@media (max-width: 430px) {
    .game-tab-content[data-game-component="roll"] .catan-roll-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .game-tab-content[data-game-component="roll"] .catan-roll-tile.is-event {
        grid-column: 1 / -1;
    }
}


/* Coin Quick Tool v1 */
.cubiri-coin-tool-icon { width: 58px; height: 40px; overflow: visible; }
.cubiri-coin-tool-icon ellipse { fill: none; stroke: currentColor; stroke-width: 1.8; }
.cubiri-coin-tool-icon .coin-tool-back { opacity: .46; }
.cubiri-coin-tool-icon .coin-tool-front path,
.cubiri-coin-tool-icon .coin-tool-spark { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

.coin-tool-bar { align-items: center; }
.coin-tool-title {
    min-width: 0;
    flex: 1 1 auto;
    padding-left: 3px;
    font-size: clamp(18px, 4.5vw, 24px);
    font-weight: 760;
    letter-spacing: -.035em;
}
.coin-tool-content {
    min-height: 0;
    overflow-y: auto;
    padding: 12px 14px 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-content: start;
}
.coin-tool-meta,
.coin-tool-stats,
.coin-result-card {
    border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
    border-radius: 15px;
    background: color-mix(in srgb, var(--text) 4%, transparent);
}
.coin-tool-meta,
.coin-tool-stats {
    min-height: 52px;
    padding: 9px 11px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}
.coin-tool-meta span,
.coin-tool-stats span,
.coin-result-label {
    color: var(--muted);
    font-size: 9px;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: .07em;
}
.coin-tool-meta strong,
.coin-tool-stats strong { font-size: 17px; line-height: 1.05; }
.coin-result-card {
    grid-column: 1 / -1;
    min-height: 74px;
    padding: 10px 13px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 4px 12px;
}
.coin-result-value {
    font-size: clamp(25px, 6vw, 37px);
    line-height: 1;
    letter-spacing: -.035em;
}
.coin-result-card.is-edge {
    background: color-mix(in srgb, #f5b544 12%, transparent);
    border-color: color-mix(in srgb, #f5b544 38%, transparent);
}
.coin-edge-explain {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    font-size: 11px;
    line-height: 1.3;
    color: var(--muted);
}
.coin-tool-hint {
    grid-column: 1 / -1;
    margin: 1px 3px 0;
    text-align: center;
    font-size: 11px;
    line-height: 1.3;
    color: var(--muted);
}

.discovery.is-coin-tool-view + .roll-zone .roll-side-control { display: none !important; }
.discovery.is-coin-tool-view + .roll-zone { gap: clamp(10px, 1.8vh, 16px); }
.coin-flip-button {
    width: clamp(235px, 58vw, 310px) !important;
    aspect-ratio: 1 !important;
    overflow: visible !important;
    cursor: default;
}
.coin-flip-button:active { transform: none !important; }
.die-stage.coin-stage {
    width: 100%;
    height: 100%;
    overflow: visible;
    display: grid;
    place-items: center;
    perspective: 900px;
    touch-action: none;
}
.coin-arena {
    position: relative;
    width: clamp(132px, 35vw, 178px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    overflow: visible;
    perspective: 850px;
    user-select: none;
    -webkit-user-select: none;
}
.coin-object {
    --coin-silver-a: #f7f7f0;
    --coin-silver-b: #aeb5b8;
    --coin-gold-a: #f7d878;
    --coin-gold-b: #b48024;
    position: relative;
    width: 84%;
    aspect-ratio: 1;
    border-radius: 50%;
    transform-style: preserve-3d;
    will-change: transform;
    cursor: grab;
    filter: drop-shadow(0 6px 8px rgb(0 0 0 / .16));
}
.coin-object.is-dragging { cursor: grabbing; }
.coin-rim-layer,
.coin-face {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}
.coin-rim-layer {
    background: linear-gradient(90deg, #777, #d6d6d0 24%, #8b8b88 55%, #ece9da 78%, #777);
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / .16);
}
.coin-face {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    border: 2px solid rgb(89 80 52 / .32);
    box-shadow:
        inset 0 0 0 4px rgb(255 255 255 / .20),
        inset 0 0 0 7px rgb(56 45 17 / .08),
        inset -8px -10px 18px rgb(0 0 0 / .14),
        inset 8px 8px 18px rgb(255 255 255 / .40);
    overflow: hidden;
}
.coin-front { transform: translateZ(5px); }
.coin-back { transform: rotateX(180deg) translateZ(5px); }
.coin-object[data-coin-style="silver"] .coin-face {
    background: radial-gradient(circle at 32% 28%, #fff 0 8%, var(--coin-silver-a) 30%, #d4d8d9 56%, var(--coin-silver-b) 100%);
}
.coin-object[data-coin-style="gold"] .coin-face {
    background: radial-gradient(circle at 32% 28%, #fff1b4 0 8%, var(--coin-gold-a) 31%, #d5aa45 60%, var(--coin-gold-b) 100%);
}
.coin-object[data-coin-style="bimetal"] .coin-face,
.coin-object[data-coin-style="euro"] .coin-face {
    background:
        radial-gradient(circle, #e7e9e7 0 54%, transparent 55%),
        radial-gradient(circle at 32% 28%, #fff1a8 0 8%, #ebcc70 33%, #c69937 69%, #8e671f 100%);
}
.coin-face strong {
    position: relative;
    z-index: 2;
    font-family: var(--cubiri-test-font, -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: clamp(27px, 7.2vw, 40px);
    line-height: 1;
    font-weight: 820;
    letter-spacing: -.06em;
    color: rgb(66 60 42 / .82);
    text-shadow: 0 1px 0 rgb(255 255 255 / .45);
}
.coin-face small {
    position: relative;
    z-index: 2;
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .12em;
    color: rgb(66 60 42 / .62);
}
.coin-stars {
    position: absolute;
    inset: 9%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    color: rgb(71 63 41 / .38);
    font-size: 10px;
    letter-spacing: .08em;
    transform: rotate(-12deg);
}
.coin-shadow {
    position: absolute;
    width: 72%;
    height: 18%;
    bottom: 3%;
    border-radius: 50%;
    background: rgb(0 0 0 / .34);
    filter: blur(7px);
    opacity: .30;
    will-change: transform, opacity, filter;
}
.coin-object.is-edge-rest {
    filter: drop-shadow(0 3px 4px rgb(0 0 0 / .22));
}
:root[data-theme="dark"] .coin-face { filter: brightness(.87) contrast(1.05); }

@media (max-height: 760px) {
    .coin-tool-content { padding-top: 8px; }
    .coin-result-card { min-height: 62px; }
    .coin-flip-button { width: clamp(205px, 50vw, 260px) !important; }
}


/* Coin Quick Tool v2 - realistic faces + statistics */
.coin-face {
    border-width: 1px;
    border-color: rgb(72 60 30 / .30);
    box-shadow:
        inset 0 0 0 2px rgb(255 255 255 / .18),
        inset 0 0 0 5px rgb(79 59 17 / .08),
        inset -9px -12px 18px rgb(0 0 0 / .17),
        inset 8px 8px 16px rgb(255 255 255 / .42),
        0 0 0 1px rgb(59 48 22 / .20);
}
.coin-object[data-coin-style="euro"] .coin-face,
.coin-object[data-coin-style="bimetal"] .coin-face {
    background:
        radial-gradient(circle at 50% 50%, #e4e6e2 0 52%, transparent 53% 100%),
        radial-gradient(circle at 31% 27%, #fff0a9 0 7%, #e6c662 27%, #c99a34 61%, #876019 100%);
}
.coin-value-side::after,
.coin-national-side::after {
    content: "";
    position: absolute;
    inset: 8%;
    border: 1px solid rgb(74 58 26 / .17);
    border-radius: 50%;
    box-shadow: inset 0 0 8px rgb(255 255 255 / .18);
}
.coin-value-side strong {
    font-size: clamp(31px, 8.2vw, 45px);
    color: rgb(63 58 45 / .88);
    text-shadow:
        0 1px 0 rgb(255 255 255 / .50),
        0 -1px 0 rgb(0 0 0 / .12);
}
.coin-value-side small {
    margin-top: 1px;
    font-size: 8px;
    letter-spacing: .13em;
    opacity: .55;
}
.coin-national-side {
    gap: 1px;
}
.coin-national-caption {
    position: relative;
    z-index: 3;
    margin-top: 4px;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .18em;
    color: rgb(62 55 36 / .70);
    text-shadow: 0 1px 0 rgb(255 255 255 / .42);
}
.coin-emblem {
    position: relative;
    z-index: 3;
    width: 54%;
    height: 48%;
    display: grid;
    place-items: center;
    font-size: clamp(31px, 8vw, 43px);
    line-height: 1;
    color: rgb(69 60 36 / .74);
    text-shadow:
        0 1px 0 rgb(255 255 255 / .54),
        0 -1px 0 rgb(0 0 0 / .18);
}
.coin-emblem-sk {
    width: 56%;
    height: 51%;
}
.coin-sk-cross {
    position: absolute;
    left: 50%;
    width: 7%;
    background: rgb(70 60 35 / .70);
    border-radius: 2px;
    transform: translateX(-50%);
    box-shadow: 0 1px 0 rgb(255 255 255 / .28);
}
.coin-sk-cross-long {
    top: 7%;
    height: 62%;
}
.coin-sk-cross-short {
    top: 28%;
    width: 43%;
    height: 8%;
}
.coin-sk-cross-long::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 17%;
    width: 620%;
    height: 13%;
    border-radius: 2px;
    background: rgb(70 60 35 / .70);
    transform: translateX(-50%);
}
.coin-sk-hill {
    position: absolute;
    bottom: 3%;
    width: 39%;
    height: 28%;
    border-radius: 55% 55% 36% 36%;
    background: rgb(82 72 43 / .46);
    box-shadow: inset 0 2px 2px rgb(255 255 255 / .16);
}
.coin-sk-hill-a { left: 4%; }
.coin-sk-hill-b { left: 31%; z-index: 2; }
.coin-sk-hill-c { right: 4%; }
.coin-emblem-portrait i {
    display: block;
    width: 48%;
    height: 74%;
    border-radius: 48% 48% 43% 43%;
    background:
        radial-gradient(circle at 50% 28%, rgb(74 65 43 / .68) 0 23%, transparent 24%),
        linear-gradient(90deg, transparent 15%, rgb(74 65 43 / .62) 16% 84%, transparent 85%);
    filter: drop-shadow(0 1px 0 rgb(255 255 255 / .35));
}
.coin-emblem-eagle,
.coin-emblem-leaf {
    transform: rotate(-18deg) scaleX(1.35);
}
.coin-emblem-shield {
    font-size: clamp(36px, 9vw, 48px);
}
.coin-emblem-cubiri {
    border: 2px solid currentColor;
    border-radius: 50%;
    width: 48%;
    height: 75%;
    font-size: 26px;
    font-weight: 900;
}

.coin-distribution {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.coin-distribution-item {
    min-height: 58px;
    padding: 9px 11px;
    border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
    border-radius: 15px;
    background: color-mix(in srgb, var(--text) 4%, transparent);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
}
.coin-distribution-item span {
    color: var(--muted);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .07em;
}
.coin-distribution-item strong {
    grid-row: 1 / 3;
    grid-column: 2;
    font-size: clamp(20px, 5vw, 28px);
    letter-spacing: -.035em;
}
.coin-distribution-item small {
    font-size: 10px;
    color: var(--muted);
}
.coin-reset-button {
    grid-column: 1 / -1;
    justify-self: end;
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 4px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.coin-reset-button:hover {
    color: var(--text);
}


/* Coin Quick Tool v4 - Three.js renderer */
.die-stage.coin-stage {
    width: 100%;
    height: 100%;
    min-height: 250px;
    display: grid;
    place-items: center;
    perspective: none;
    touch-action: none;
}
.coin-flip-button {
    width: clamp(270px, 68vw, 360px) !important;
    height: clamp(270px, 68vw, 360px) !important;
    aspect-ratio: 1 !important;
    overflow: visible !important;
}
.coin-webgl-canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    cursor: grab;
    touch-action: none;
    outline: none;
}
.coin-webgl-canvas.is-grabbed { cursor: grabbing; }
.discovery.is-coin-tool-view + .roll-zone .die-stage::before,
.discovery.is-coin-tool-view + .roll-zone .die-stage::after { content: none !important; }
@media (max-height: 760px) {
    .coin-flip-button {
        width: clamp(235px, 56vw, 300px) !important;
        height: clamp(235px, 56vw, 300px) !important;
    }
}


/* Coin Quick Tool v5 - realistic scale and bounded toss */
.coin-flip-button {
    width: clamp(220px, 54vw, 285px) !important;
    height: clamp(220px, 54vw, 285px) !important;
}
.die-stage.coin-stage {
    min-height: 215px;
    overflow: visible;
}
@media (max-height: 760px) {
    .coin-flip-button {
        width: clamp(195px, 48vw, 245px) !important;
        height: clamp(195px, 48vw, 245px) !important;
    }
}


/* Coin Quick Tool v6 - database catalog picker */
.coin-picker-trigger {
    position: relative;
    appearance: none;
    width: 100%;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    padding-right: 34px;
}
.coin-picker-trigger:hover,
.coin-picker-trigger:focus-visible {
    border-color: color-mix(in srgb, var(--text) 24%, transparent);
}
.coin-picker-denom-row {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}
.coin-local-badge {
    display: inline-flex;
    align-items: center;
    min-height: 17px;
    padding: 1px 6px;
    border-radius: 999px;
    background: color-mix(in srgb, #a600ff 14%, transparent);
    color: color-mix(in srgb, #c06bff 88%, var(--text));
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.coin-picker-chevron {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
}
.coin-picker-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
    background: rgb(0 0 0 / .58);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
.coin-picker-sheet {
    width: min(520px, 100%);
    max-height: min(72vh, 620px);
    display: flex;
    flex-direction: column;
    border: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
    border-radius: 22px;
    background: #171a20;
    box-shadow: 0 24px 70px rgb(0 0 0 / .42);
    overflow: hidden;
}
.coin-picker-head {
    min-height: 58px;
    padding: 12px 14px 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
}
.coin-picker-head strong { font-size: 18px; }
.coin-picker-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: color-mix(in srgb, var(--text) 8%, transparent);
    color: var(--text);
    font: inherit;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.coin-picker-list {
    min-height: 0;
    overflow-y: auto;
    padding: 7px;
}
.coin-picker-option {
    appearance: none;
    width: 100%;
    min-height: 58px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: var(--text);
    font: inherit;
    display: grid;
    grid-template-columns: 34px 1fr 28px;
    gap: 10px;
    align-items: center;
    text-align: left;
    padding: 7px 10px;
    cursor: pointer;
}
.coin-picker-option:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.coin-picker-option.is-selected {
    background: color-mix(in srgb, #a600ff 9%, transparent);
    border-color: color-mix(in srgb, #a600ff 30%, transparent);
}
.coin-picker-flag {
    font-size: 24px;
    line-height: 1;
    text-align: center;
}
.coin-picker-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.coin-picker-option-text strong {
    font-size: 14px;
    line-height: 1.15;
}
.coin-picker-option-text small {
    color: var(--muted);
    font-size: 10px;
}
.coin-picker-check {
    text-align: center;
    font-size: 18px;
    color: #b833ff;
    font-weight: 900;
}

/* 2026-08-17 unified roll interaction v1
   One clear roll action. Normal dice games may also roll by tapping empty
   Dice Area; hold/select games reserve die taps for HOLD/UNHOLD. */
.roll-side-control {
    display: none !important;
}

.roll-label {
    visibility: visible !important;
    pointer-events: auto !important;
    user-select: none;
    width: min(100%, 440px);
    min-height: 52px;
    margin: 0;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 16px;
    background:
        linear-gradient(var(--panel), var(--panel)) padding-box,
        linear-gradient(90deg, var(--purple), var(--pink), var(--orange)) border-box;
    color: var(--text);
    -webkit-background-clip: padding-box, border-box;
    background-clip: padding-box, border-box;
    font-size: clamp(16px, 4vw, 19px);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 120ms ease, filter 120ms ease, opacity 120ms ease;
}

.roll-label:active {
    transform: scale(.985);
    filter: brightness(1.08);
}

.roll-label:focus-visible {
    outline: 2px solid var(--purple);
    outline-offset: 3px;
}

/* Keep the rapid-action control clearly separated from advertising. */
.landing:has(.discovery.is-game-view) .roll-zone {
    padding-bottom: clamp(24px, 3vh, 32px);
}

.landing:has(.discovery.is-game-view) .roll-zone::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 10px;
    height: 1px;
    background: var(--line);
    opacity: .55;
    pointer-events: none;
}

@media (max-height: 760px) {
    .landing:has(.discovery.is-game-view) .roll-zone {
        padding-bottom: 24px;
    }
}
