body::before {
    display: none;
}

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700;800;900&display=swap');

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Outfit', Arial, sans-serif;
    background: transparent;
    color: #eee;
}

body {
    user-select: none;
}

#three-root {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: transparent;
}

#three-root canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.container {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.container > * {
    pointer-events: auto;
}

.board-data-hidden {
    position: absolute;
    left: -99999px;
    top: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

.scores {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 12px;
    font-size: 18px;
}

.score {
    font-weight: bold;
    background: rgba(0, 0, 0, 0.35);
    padding: 8px 14px;
    border-radius: 12px;
    backdrop-filter: blur(3px);
}

.history-container {
    position: fixed;
    left: 24px;
    bottom: 24px;
    width: 360px;
    max-width: 24vw;
    background: rgba(0, 0, 0, 0.68);
    color: #f5f5f5;
    border-radius: 16px;
    padding: 10px 14px;
    box-sizing: border-box;
    font-size: 12px;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(5px);
    z-index: 5;
}

.history-title {
    font-weight: bold;
    margin-bottom: 6px;
    text-align: left;
}

.history-list {
    max-height: 72px;
    overflow-y: auto;
    text-align: left;
    font-family: Consolas, "Courier New", monospace;
    line-height: 1.45;
}

.history-entry {
    margin-bottom: 2px;
}

.status {
    position: fixed;
    left: 50%;
    bottom: 86px;
    transform: translateX(-50%);
    font-size: 17px;
    min-height: 24px;
    text-align: center;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
    background: rgba(0, 0, 0, 0.32);
    padding: 8px 18px;
    border-radius: 12px;
    z-index: 5;
}

.buttons {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    z-index: 5;
}

.btn {
    padding: 9px 20px;
    font-size: 15px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.btn:active {
    transform: scale(0.97);
}

.btn-secondary {
    background: #555;
}

.btn-secondary:hover {
    background: #666;
}

/* Hidden logic-board styles */
.pits-area {
    display: flex;
    flex-direction: column;
    gap: 44px;
}

.row {
    display: grid;
    grid-template-columns: repeat(9, 105px);
    gap: 10px;
}

.pit {
    position: relative;
    width: 105px;
    height: 72px;
    border-radius: 32px;
    border: 2px solid rgba(60, 40, 20, 0.9);
    background: radial-gradient(circle at 30% 20%, #f2c48a, #b4773f);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 8px 10px 4px;
    box-sizing: border-box;
}

.pit-number {
    position: absolute;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.3px;
    color: rgba(245, 220, 180, 0.85);
}

.pit-bottom .pit-number {
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
}

.pit-top .pit-number {
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
}

.stones-container {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    width: 100%;
    flex: 1;
    align-content: center;
    justify-items: center;
}

.stone {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #f7f1d0, #3b2a19);
}

.stone-count {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 2px;
}

.pit.tuz {
    border: 3px solid #ffeb3b;
}

.store {
    width: 130px;
    height: 290px;
    border-radius: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 8px 6px;
    box-sizing: border-box;
}

.store-label {
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 4px;
}

.store-stones {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    width: 100%;
    align-content: flex-start;
    justify-items: center;
}

.store-stones .stone {
    width: 7px;
    height: 7px;
}

.store-count {
    margin-top: 3px;
    font-size: 12px;
    font-weight: bold;
}

/* ===== CINEMATIC INTRO ===== */

.splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, rgba(210, 145, 62, 0.25), transparent 30%),
        radial-gradient(circle at 80% 80%, rgba(95, 45, 14, 0.35), transparent 35%),
        linear-gradient(135deg, #070403 0%, #1b0d05 50%, #030201 100%);
    transition: opacity 0.4s ease;
}

.splash::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
    background-size: 46px 46px;
    opacity: 0.35;
}

.splash::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 72% 48%, rgba(255, 140, 40, 0.11), transparent 30%),
        radial-gradient(circle at 60% 40%, rgba(255, 190, 95, 0.07), transparent 26%);
    filter: blur(40px);
    pointer-events: none;
}

.intro-card {
    position: relative;
    z-index: 2;

    width: min(1180px, 86vw);
    min-height: 520px;

    padding: 54px;

    border-radius: 34px;
    overflow: hidden;

    background: rgba(12, 6, 2, 0.58);

    border: 1px solid rgba(255, 196, 110, 0.18);

    backdrop-filter: blur(18px);

    box-shadow:
        0 40px 120px rgba(0,0,0,0.92),
        inset 0 0 50px rgba(255,190,90,0.05),
        0 0 30px rgba(255,160,60,0.06);
}

.intro-left {
    position: relative;
    z-index: 2;
    max-width: 500px;
    text-align: left;
}

.intro-topline {
    margin-bottom: 16px;
    color: #d8a85c;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 5px;
    text-transform: uppercase;
}

.intro-title {
    margin: 0;
    font-size: clamp(54px, 6.5vw, 96px);

    filter: drop-shadow(0 0 18px rgba(255, 210, 120, 0.18));

    line-height: 0.9;
    font-weight: 800;
    letter-spacing: -4px;
    color: #f7d48a;
    text-transform: uppercase;
    text-shadow:
        0 0 24px rgba(255, 215, 120, 0.22),
        0 0 58px rgba(255, 180, 70, 0.08);
}

.intro-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 20px 0 24px;
    color: #d8a85c;
}

.intro-divider span {
    width: 78px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #c4873e);
}

.intro-divider span:last-child {
    background: linear-gradient(90deg, #c4873e, transparent);
}

.intro-divider p {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.intro-tagline {
    max-width: 430px;
    margin: 0 0 30px;
    font-size: 18px;
    line-height: 1.55;
    color: #ccb089;
    font-weight: 400;
}

.intro-start-btn {
    padding: 15px 38px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    color: #241204;
    font-size: 16px;
    letter-spacing: 0.5px;
    font-weight: 900;
    background: linear-gradient(135deg, #ffd47e, #c47a24);
    box-shadow:
        0 18px 40px rgba(196, 122, 36, 0.42),
        inset 0 1px 0 rgba(255,255,255,0.45);
    transition: 0.25s ease;
}

.intro-start-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 22px 48px rgba(196, 122, 36, 0.55),
        inset 0 1px 0 rgba(255,255,255,0.55);
}

.intro-right {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 34px;
    overflow: hidden;
    pointer-events: none;
}

.board-hero-bg {
    background:
        linear-gradient(
            90deg,
            rgba(8, 4, 2, 0.98) 0%,
            rgba(8, 4, 2, 0.88) 31%,
            rgba(8, 4, 2, 0.38) 58%,
            rgba(8, 4, 2, 0.78) 100%
        ),
        url("images/cinematic-board.png");
    background-size: cover;
    background-position: 82% center;
    background-repeat: no-repeat;
    filter: brightness(0.92) contrast(1.05);
}

/* SETTINGS */
.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: opacity 0.3s ease;
}

.settings-panel {
    background: #222;
    border-radius: 16px;
    width: min(480px, 90%);
    max-height: 80vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #444;
}

.settings-header h2 {
    margin: 0;
    font-size: 18px;
}

.settings-close {
    background: none;
    border: none;
    color: #eee;
    font-size: 20px;
    cursor: pointer;
    padding: 2px 6px;
}

.settings-body {
    padding: 10px 16px 14px;
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 12px;
}

.settings-section h3 {
    margin: 2px 0 4px;
    font-size: 15px;
}

.rules-text {
    font-size: 13px;
    line-height: 1.4;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
}

.toggle input {
    width: 18px;
    height: 18px;
}

/* 3D labels */
.three-label-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 4;
}

.pit-number-label,
.pit-count-label,
.store-count-label {
    position: fixed;
    transform: translate(-50%, -50%);
    pointer-events: none;
    font-weight: bold;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
    white-space: nowrap;
}

.pit-number-label {
    font-size: 11px;
    color: #d9b36c;
    letter-spacing: 0.4px;
}

.pit-count-label {
    font-size: 15px;
    color: #fff4dc;
}

.store-count-label {
    font-size: 18px;
    color: #fff4dc;
    background: rgba(0, 0, 0, 0.35);
    padding: 3px 9px;
    border-radius: 8px;
}

/* RESPONSIVE */
@media (max-width: 1100px) {
    .history-container {
        width: 320px;
        max-width: 30vw;
    }

    .intro-card {
        width: min(1050px, 88vw);
        min-height: 500px;
        padding: 44px;
    }

    .intro-title {
        font-size: clamp(48px, 6vw, 88px);
    }
}

@media (max-width: 900px) {
    h1 {
        font-size: 24px;
    }

    .scores {
        font-size: 15px;
        flex-direction: column;
        align-items: center;
    }

    .status {
        font-size: 15px;
    }

    .history-container {
        left: 50%;
        bottom: 120px;
        transform: translateX(-50%);
        width: min(760px, 84vw);
        max-width: none;
        font-size: 11px;
    }

    .btn {
        font-size: 13px;
        padding: 7px 14px;
    }

    .intro-card {
        width: min(720px, 90vw);
        min-height: auto;
        padding: 34px 24px;
        text-align: center;
    }

    .intro-left {
        text-align: center;
        max-width: none;
    }

    .intro-divider {
        justify-content: center;
    }

    .intro-tagline {
        margin-left: auto;
        margin-right: auto;
    }

    .board-hero-bg {
        background:
            linear-gradient(
                rgba(8, 4, 2, 0.90),
                rgba(8, 4, 2, 0.92)
            ),
            url("images/cinematic-board.png");
        background-size: cover;
        background-position: center;
    }
}

/* ===== FINAL ANIMATED AAA INTRO EFFECTS ===== */

/* slow animated glow */
.splash::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 72% 45%, rgba(255, 145, 40, 0.16), transparent 32%),
        radial-gradient(circle at 30% 25%, rgba(255, 205, 110, 0.08), transparent 28%);
    filter: blur(45px);
    pointer-events: none;
    animation: ambientGlow 6s ease-in-out infinite;
}

/* soft particles */
.splash::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255, 190, 90, 0.18) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
    background-size: 120px 120px, 46px 46px, 46px 46px;
    opacity: 0.45;
    animation: particlesMove 18s linear infinite;
}

/* cinematic board background motion */
.board-hero-bg {
    animation: boardCinematicMove 14s ease-in-out infinite;
}

/* text entrance */
.intro-left {
    animation: introTextIn 0.9s ease-out both;
}

/* button stronger hover */
.intro-start-btn {
    position: relative;
    overflow: hidden;
}

.intro-start-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -80%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.45),
        transparent
    );
    transform: skewX(-20deg);
    transition: 0.45s ease;
}

.intro-start-btn:hover::after {
    left: 130%;
}

.intro-start-btn:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow:
        0 24px 55px rgba(196, 122, 36, 0.68),
        inset 0 1px 0 rgba(255,255,255,0.65);
}

/* animations */
@keyframes ambientGlow {
    0%, 100% {
        opacity: 0.75;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.08);
    }
}

@keyframes particlesMove {
    from {
        background-position: 0 0, 0 0, 0 0;
    }
    to {
        background-position: 160px -120px, 46px 46px, 46px 46px;
    }
}

@keyframes boardCinematicMove {
    0%, 100% {
        background-position: 82% center;
        filter: brightness(0.92) contrast(1.05);
    }
    50% {
        background-position: 78% center;
        filter: brightness(1) contrast(1.08);
    }
}

@keyframes introTextIn {
    from {
        opacity: 0;
        transform: translateX(-22px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== INTRO EXTRA DETAILS ===== */

.intro-features {
    display: none;
}

.intro-symbol {
    position: relative;
    width: 220px;
    height: 42px;

    margin: 0 0 18px 35px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.intro-symbol::before,
.intro-symbol::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 72px;
    height: 1px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 205, 120, 0.9)
    );
}

.intro-symbol::before {
    left: 0;
}

.intro-symbol::after {
    right: 0;
    transform: rotate(180deg);
}

.diamond-grid {
    width: 22px;
    height: 22px;

    transform: rotate(45deg);

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
}

.diamond-grid span {
    background: linear-gradient(
        135deg,
        #ffd47e,
        #b97022
    );

    box-shadow:
        0 0 14px rgba(255, 190, 90, 0.5),
        inset 0 1px 2px rgba(255,255,255,0.35);
}

.intro-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.intro-rules-btn {
    position: relative;
    overflow: hidden;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 15px 30px;

    border-radius: 999px;
    border: 1px solid rgba(255, 212, 126, 0.35);

    background: rgba(255, 212, 126, 0.10);

    color: #f6d18a;

    font-size: 15px;
    font-weight: 850;
    letter-spacing: 0.4px;

    cursor: pointer;

    backdrop-filter: blur(14px);

    box-shadow:
        0 12px 30px rgba(0,0,0,0.38),
        inset 0 1px 0 rgba(255,255,255,0.08);

    transition: 0.28s ease;
}

.intro-rules-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -80%;
    width: 60%;
    height: 100%;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.42),
        transparent
    );

    transform: skewX(-20deg);
    transition: 0.45s ease;
}

.intro-rules-btn:hover::after {
    left: 130%;
}

.intro-rules-btn:hover {
    transform: translateY(-4px) scale(1.04);

    background: linear-gradient(
        135deg,
        #ffd47e,
        #c47a24
    );

    color: #1b1005;

    box-shadow:
        0 24px 55px rgba(196, 122, 36, 0.68),
        inset 0 1px 0 rgba(255,255,255,0.65);
}

.rules-icon {
    color: inherit;
    font-size: 14px;
}

.rules-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rules-panel {
    width: min(760px, 90vw);
    max-height: 82vh;
    background: linear-gradient(145deg, rgba(22, 12, 5, 0.96), rgba(7, 3, 1, 0.96));
    border: 1px solid rgba(255, 196, 110, 0.24);
    border-radius: 24px;
    box-shadow: 0 30px 90px rgba(0,0,0,0.9);
    overflow: hidden;
}

.rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 196, 110, 0.18);
}

.rules-header h2 {
    margin: 0;
    color: #f7d48a;
    font-size: 24px;
}

.rules-close {
    background: none;
    border: none;
    color: #f7d48a;
    font-size: 30px;
    cursor: pointer;
}

.rules-body {
    padding: 22px 28px 30px;
    overflow-y: auto;
    max-height: 68vh;
}

.rules-body h3 {
    margin: 18px 0 6px;
    color: #ffd47e;
    font-size: 17px;
}

.rules-body p {
    margin: 0;
    color: #e6d4b8;
    font-size: 15px;
    line-height: 1.65;
}

.game-title-wrap{
    position:absolute;
    top:18px;
    left:50%;
    transform:translateX(-50%);
    z-index:100;

    text-align:center;
    pointer-events:none;
}

.game-title{
    font-family:'Cinzel', serif;

    font-size:38px;
    font-weight:700;

    color:#f6e6b3;

    letter-spacing:1px;

    text-shadow:
        0 0 10px rgba(255,215,120,0.25),
        0 0 24px rgba(255,180,50,0.12);

    user-select:none;
}

.title-decoration{
    position: relative;

    width: 320px;
    height: 26px;

    margin: -4px auto 0;

    display: flex;
    align-items: center;
    justify-content: center;

    color:#d7a12f;
}

.title-decoration::before,
.title-decoration::after{
    content:"";

    width:110px;
    height:1px;

    background:linear-gradient(
        90deg,
        transparent,
        rgba(255,205,120,0.9)
    );
}

.title-decoration::after{
    transform:rotate(180deg);
}

.title-decoration span{
    margin:0 12px;

    font-size:18px;

    letter-spacing:4px;

    text-shadow:
        0 0 10px rgba(255,180,40,0.2);
}

body,
button,
.score,
.status,
.history-container {
    font-family: 'Cinzel', serif;
}

/* BUTTON AREA */
.buttons {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 10;
}

/* LUXURY BUTTONS */
.btn {
    position: relative;

    min-width: 190px;
    padding: 18px 34px;

    border-radius: 999px;

    border: 1px solid rgba(255, 210, 120, 0.22);

    background:
        linear-gradient(
            180deg,
            rgba(255,220,140,0.18),
            rgba(40,18,5,0.95)
        );

    color: #f7d48a;

    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;

    cursor: pointer;

    overflow: hidden;

    box-shadow:
        0 10px 35px rgba(0,0,0,0.55),
        inset 0 1px 1px rgba(255,255,255,0.08);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

/* LIGHT SWEEP */
.btn::before {
    content: '';

    position: absolute;
    top: 0;
    left: -120%;

    width: 60%;
    height: 100%;

    background:
        linear-gradient(
            120deg,
            transparent,
            rgba(255,255,255,0.22),
            transparent
        );

    transform: skewX(-20deg);

    transition: 0.55s ease;
}

.btn:hover::before {
    left: 130%;
}

.btn:hover {
    transform: translateY(-4px);

    border-color: rgba(255,220,140,0.55);

    background:
        linear-gradient(
            180deg,
            rgba(255,220,140,0.22),
            rgba(55,28,8,0.96)
        );

    box-shadow:
        0 18px 42px rgba(0,0,0,0.68),
        0 0 24px rgba(255,180,60,0.18);
}

.btn:active {
    transform: scale(0.97);
}

/* SECOND BUTTON */
.btn-secondary {
    background:
        linear-gradient(
            180deg,
            rgba(80,80,80,0.35),
            rgba(20,20,20,0.96)
        );
}

.game-result-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    background:
        radial-gradient(circle at 50% 47%, rgba(255, 178, 48, 0.22), transparent 28%),
        radial-gradient(circle at 50% 50%, rgba(120, 60, 12, 0.25), transparent 46%),
        linear-gradient(180deg, rgba(3, 1, 0, 0.96), rgba(0, 0, 0, 0.98));

    backdrop-filter: blur(18px);
}

.game-result-overlay.hidden {
    display: none;
}

/* soft golden particles only, no circles */
.gold-confetti {
    position: absolute;
    inset: 0;

    background-image:
        radial-gradient(circle, rgba(255, 210, 100, 0.75) 1.6px, transparent 2.5px),
        radial-gradient(circle, rgba(255, 165, 40, 0.45) 1px, transparent 2px),
        radial-gradient(circle, rgba(255, 240, 170, 0.32) 1px, transparent 2px);

    background-size: 160px 160px, 230px 230px, 310px 310px;
    background-position: 20px 30px, 80px 120px, 160px 60px;

    opacity: 0.55;

    animation: confettiMove 9s linear infinite;
}

/* disable old firework/circle elements */
.firework,
.firework-left,
.firework-right {
    display: none !important;
}

.game-result-card {
    position: relative;

    width: min(650px, 86vw);
    padding: 74px 58px 48px;

    text-align: center;

    border-radius: 30px;

    border: 1.5px solid rgba(255, 205, 85, 0.92);

    background:
        radial-gradient(circle at 50% 36%, rgba(255, 190, 70, 0.20), transparent 34%),
        radial-gradient(circle at 50% 72%, rgba(255, 150, 30, 0.12), transparent 36%),
        linear-gradient(145deg, rgba(43, 19, 4, 0.94), rgba(7, 3, 1, 0.97));

    box-shadow:
        0 0 22px rgba(255, 205, 90, 0.38),
        0 0 80px rgba(255, 150, 30, 0.24),
        0 38px 120px rgba(0, 0, 0, 0.95),
        inset 0 0 42px rgba(255, 215, 120, 0.10);

    animation: royalPopup 0.78s cubic-bezier(.16,1.25,.35,1) forwards;
}

/* inner border like the reference */
.game-result-card::before {
    content: "";
    position: absolute;
    inset: 18px;

    border-radius: 22px;

    border: 1px solid rgba(255, 215, 110, 0.32);

    pointer-events: none;
}

/* small corner ornaments */
.game-result-card::after {
    content: "❧        ❧";
    position: absolute;
    top: 22px;
    left: 28px;
    right: 28px;

    display: flex;
    justify-content: space-between;

    color: rgba(255, 205, 90, 0.82);

    font-size: 34px;

    text-shadow:
        0 0 10px rgba(255, 180, 40, 0.45);

    pointer-events: none;
}

.result-crown {
    position: absolute;

    top: -74px;
    left: 50%;
    transform: translateX(-50%);

    font-size: 104px;
    line-height: 1;

    color: #ffd76d;

    text-shadow:
        0 0 16px rgba(255, 230, 140, 0.95),
        0 0 42px rgba(255, 180, 40, 0.85),
        0 8px 18px rgba(0,0,0,0.8);

    animation: crownFloat 1.9s ease-in-out infinite;
}

.game-result-title {
    margin-top: 16px;

    font-family: 'Cinzel', serif;

    font-size: clamp(56px, 6vw, 82px);
    font-weight: 900;

    letter-spacing: 2px;

    color: #ffe29a;

    text-transform: uppercase;

    background: linear-gradient(
        180deg,
        #fff6c8 0%,
        #ffd66f 35%,
        #b8751e 70%,
        #fff0a6 100%
    );

    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;

    text-shadow:
        0 0 14px rgba(255, 210, 90, 0.42),
        0 0 40px rgba(255, 150, 25, 0.32),
        0 7px 16px rgba(0, 0, 0, 0.92);

    animation: titleGlow 1.8s ease-in-out infinite;
}

.result-divider {
    position: relative;

    margin: 20px auto 24px;

    width: 260px;

    color: #e01616;

    font-size: 23px;

    text-shadow:
        0 0 14px rgba(255, 210, 90, 0.9),
        0 0 24px rgba(255, 80, 40, 0.35);
}

.result-divider::before,
.result-divider::after {
    content: "";
    position: absolute;
    top: 50%;

    width: 100px;
    height: 1px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 205, 90, 0.95),
        transparent
    );
}

.result-divider::before {
    right: 55%;
}

.result-divider::after {
    left: 55%;
}

.game-result-score {
    display: inline-block;

    padding: 14px 42px;

    margin-bottom: 32px;

    min-width: 360px;

    font-family: 'Cinzel', serif;

    font-size: 27px;
    font-weight: 500;

    color: #fff0c4;

    border: 1px solid rgba(255, 205, 90, 0.58);

    background:
        linear-gradient(
            180deg,
            rgba(255, 210, 90, 0.06),
            rgba(0, 0, 0, 0.38)
        );

    box-shadow:
        inset 0 0 20px rgba(255, 180, 60, 0.14),
        0 0 18px rgba(255, 150, 30, 0.12);
}

.result-btn {
    position: relative;

    overflow: hidden;

    padding: 19px 72px;

    border-radius: 18px;

    border: 1.5px solid rgba(255, 230, 150, 0.98);

    background:
        linear-gradient(
            180deg,
            #fff0b8 0%,
            #ffd06b 42%,
            #d98a24 72%,
            #9c5815 100%
        );

    color: #2a1400;

    font-family: 'Cinzel', serif;

    font-size: 26px;
    font-weight: 900;

    cursor: pointer;

    box-shadow:
        0 0 28px rgba(255,190,60,0.62),
        0 0 70px rgba(255,150,30,0.22),
        inset 0 2px 12px rgba(255,255,255,0.38),
        inset 0 -8px 16px rgba(120, 55, 5, 0.28);

    transition:
        transform 0.25s ease,
        filter 0.25s ease,
        box-shadow 0.25s ease;
}

.result-btn::before {
    content: "";
    position: absolute;
    inset: 5px;

    border-radius: 13px;

    border: 1px solid rgba(255, 255, 220, 0.28);

    pointer-events: none;
}

.result-btn::after {
    content: "";
    position: absolute;

    top: 0;
    left: -90%;

    width: 60%;
    height: 100%;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,0.58),
            transparent
        );

    transform: skewX(-20deg);

    animation: buttonShine 2.4s infinite;
}

.result-btn:hover {
    transform: translateY(-4px) scale(1.035);

    filter: brightness(1.08);

    box-shadow:
        0 0 45px rgba(255,210,100,0.85),
        0 0 100px rgba(255,180,50,0.38),
        inset 0 2px 12px rgba(255,255,255,0.45);
}

/* LOSE VERSION */
.lose-result {
    background:
        radial-gradient(circle at 50% 47%, rgba(200, 28, 28, 0.23), transparent 30%),
        linear-gradient(180deg, rgba(8, 1, 1, 0.97), rgba(0, 0, 0, 0.98));
}

.lose-result .game-result-card {
    border-color: rgba(255, 80, 70, 0.85);

    background:
        radial-gradient(circle at 50% 36%, rgba(255, 60, 50, 0.18), transparent 34%),
        linear-gradient(145deg, rgba(44, 5, 4, 0.96), rgba(5, 1, 1, 0.98));

    box-shadow:
        0 0 30px rgba(255, 55, 45, 0.36),
        0 0 90px rgba(160, 0, 0, 0.35),
        inset 0 0 42px rgba(255, 70, 60, 0.10);
}

.lose-result .result-crown,
.lose-result .game-result-title {
    color: #ff5a4d;

    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;

    text-shadow:
        0 0 22px rgba(255, 70, 70, 0.9),
        0 0 64px rgba(150, 0, 0, 0.7);
}

.lose-result .result-divider {
    color: #ff3b2f;
}

.lose-result .result-btn {
    background:
        linear-gradient(
            180deg,
            #ff9a84 0%,
            #c92218 55%,
            #520502 100%
        );

    color: #ffe1d6;

    border-color: rgba(255, 130, 110, 0.95);
}

@keyframes royalPopup {
    from {
        opacity: 0;
        transform: scale(0.66) translateY(45px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes crownFloat {
    0%, 100% {
        transform: translateX(-50%) translateY(0) scale(1);
    }

    50% {
        transform: translateX(-50%) translateY(-8px) scale(1.06);
    }
}

@keyframes titleGlow {
    0%, 100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.22);
    }
}

@keyframes confettiMove {
    from {
        background-position: 20px 30px, 80px 120px, 160px 60px;
    }

    to {
        background-position: 120px 260px, -160px 220px, 260px 330px;
    }
}

@keyframes buttonShine {
    0% {
        left: -90%;
    }

    45% {
        left: 130%;
    }

    100% {
        left: 130%;
    }
}

/* Remove top YOU / COMPUTER score texts completely */
#scores,
.scores,
.score {
    display: none !important;
}