.dino-game {
    overflow: hidden;
    border: 1px solid #e7e9ee;
    border-radius: 24px;
    background: #f7f8fa;
}

.dino-game-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
}

.dino-game-eyebrow {
    margin: 0 0 8px;
    color: #00a846;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dino-game-title {
    margin: 0;
    color: #15171c;
    font-size: 22px;
    line-height: 1.25;
}

.dino-game-button {
    min-width: 148px;
    min-height: 48px;
    padding: 12px 20px;
    border: 0;
    border-radius: 14px;
    background: #00dc5a;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 160ms ease, transform 160ms ease;
}

.dino-game-button:hover {
    background: #00c850;
    transform: translateY(-1px);
}

.dino-game-button:focus-visible {
    outline: 3px solid rgb(0 220 90 / 30%);
    outline-offset: 3px;
}

.dino-game-frame-wrap {
    padding: 0 16px 16px;
}

.dino-game-frame-wrap[hidden] {
    display: none;
}

.dino-game-frame-wrap iframe {
    display: block;
    width: 100%;
    aspect-ratio: 1.85 / 1;
    min-height: 360px;
    border: 0;
    border-radius: 16px;
    background: #11161d;
}

.dino-game-reward {
    padding: 16px 0 0;
}

.dino-game-reward-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    border-radius: 18px;
    background: #fff;
    box-shadow: inset 0 0 0 1px #e7e9ee;
}

.dino-game-reward-eyebrow {
    margin: 0 0 4px;
    color: #00a846;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dino-game-reward-bar strong,
.dino-game-reward-copy h3 {
    color: #15171c;
}

.dino-game-reward-bar strong {
    display: block;
    font-size: 18px;
    line-height: 1.3;
}

.dino-game-claim-button,
.dino-game-captcha-form button,
.dino-game-code-result button {
    min-height: 46px;
    padding: 12px 22px;
    border: 0;
    border-radius: 14px;
    background: #00dc5a;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.dino-game-claim-button[hidden] {
    display: none;
}

.dino-game-claim-button:hover,
.dino-game-captcha-form button:hover,
.dino-game-code-result button:hover {
    background: #00c850;
}

.dino-game-claim-button:disabled,
.dino-game-captcha-form button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.dino-game-reward-panel {
    margin-top: 14px;
    padding: 20px;
    border-radius: 18px;
    background: #fff;
    box-shadow: inset 0 0 0 1px #e7e9ee;
}

.dino-game-reward-panel[hidden],
.dino-game-captcha-grid[hidden],
.dino-game-captcha-form[hidden],
.dino-game-code-result[hidden] {
    display: none;
}

.dino-game-reward-copy h3 {
    margin: 0 0 8px;
    font-size: 24px;
    line-height: 1.25;
}

.dino-game-reward-copy p:last-child {
    margin: 0;
    color: #5d6575;
    font-size: 15px;
    line-height: 1.5;
}

.dino-game-captcha-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
    max-width: 520px;
}

.dino-game-captcha-block {
    position: relative;
    min-height: 54px;
    padding: 12px 12px 12px 46px;
    border: 1px solid #e2e5ea;
    border-radius: 14px;
    background: #f7f8fa;
    color: #5d6575;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

.dino-game-captcha-block::before {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: var(--ore);
    content: "";
    transform: translateY(-50%);
}

.dino-game-captcha-form {
    max-width: 520px;
}

.dino-game-captcha-form label {
    display: block;
    margin-bottom: 8px;
    color: #5d6575;
    font-size: 14px;
    font-weight: 700;
}

.dino-game-captcha-form > div {
    display: flex;
    gap: 10px;
}

.dino-game-captcha-form input {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #d7dbe3;
    border-radius: 14px;
    background: #fff;
    color: #15171c;
    font-size: 18px;
    font-weight: 800;
}

.dino-game-code-result {
    display: grid;
    gap: 10px;
    justify-items: start;
    margin-top: 18px;
}

.dino-game-code-result span,
.dino-game-code-result small {
    color: #5d6575;
    font-size: 13px;
    font-weight: 700;
}

.dino-game-code-result strong {
    padding: 12px 16px;
    border-radius: 14px;
    background: #f1fbf5;
    color: #00a846;
    font-size: clamp(26px, 4vw, 42px);
    font-weight: 900;
    letter-spacing: 0.08em;
}

.dino-game-secondary-button {
    margin-top: 16px;
    min-height: 42px;
    padding: 10px 18px;
    border: 0;
    border-radius: 12px;
    background: #eef0f4;
    color: #5d6575;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.dino-game-rotate {
    display: none;
}

.dino-game-overlay-close {
    display: none;
}

@media (max-width: 768px) {
    .dino-game {
        overflow: visible;
        border-radius: 18px;
    }

    .dino-game.is-open {
        border-bottom-color: transparent;
        border-radius: 18px 18px 0 0;
    }

    .dino-game.is-open .dino-game-intro {
        display: none;
    }

    .dino-game-intro {
        align-items: stretch;
        flex-direction: column;
        gap: 18px;
        padding: 20px;
    }

    .dino-game-title {
        font-size: 20px;
    }

    .dino-game-button {
        width: 100%;
    }

    .dino-game-frame-wrap {
        position: fixed;
        z-index: 100000;
        inset: 0;
        width: 100dvw;
        height: 100dvh;
        margin: 0;
        padding: 0;
        background: #11161d;
    }

    .dino-game-frame-wrap iframe {
        width: 100%;
        height: 100%;
        min-height: 0;
        aspect-ratio: auto;
        border-radius: 0;
    }

    .dino-game-reward {
        position: fixed;
        z-index: 4;
        left: max(10px, env(safe-area-inset-left));
        right: max(10px, env(safe-area-inset-right));
        bottom: max(10px, env(safe-area-inset-bottom));
        padding: 0;
        pointer-events: none;
    }

    .dino-game-reward-bar,
    .dino-game-reward-panel {
        pointer-events: auto;
    }

    .dino-game-reward-bar {
        padding: 12px;
        border-radius: 16px;
        box-shadow: 0 12px 36px rgb(0 0 0 / 24%);
    }

    .dino-game-reward-bar strong {
        font-size: 14px;
    }

    .dino-game-claim-button {
        min-height: 42px;
        padding: 10px 16px;
        white-space: nowrap;
    }

    .dino-game-reward-panel {
        max-height: calc(100dvh - 24px);
        margin-top: 0;
        overflow: auto;
        box-shadow: 0 16px 48px rgb(0 0 0 / 28%);
    }

    .dino-game.is-waiting-rotation .dino-game-frame-wrap {
        height: 100dvh;
        background:
            linear-gradient(45deg, #0d1117 25%, transparent 25%) 0 0 / 24px 24px,
            linear-gradient(-45deg, #0d1117 25%, transparent 25%) 0 12px / 24px 24px,
            #11161d;
    }

    .dino-game.is-waiting-rotation iframe {
        display: none;
    }

    .dino-game.is-waiting-rotation .dino-game-rotate {
        height: 100%;
        padding: 24px;
        color: #f7f4df;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .dino-game-rotate strong {
        font-size: 22px;
    }

    .dino-game-rotate > span:last-child {
        max-width: 300px;
        color: #b8b49e;
        font-size: 14px;
        line-height: 1.4;
    }

    .dino-game-phone {
        position: relative;
        width: 34px;
        height: 56px;
        margin-bottom: 8px;
        border: 3px solid #88c95b;
        border-radius: 7px;
        animation: dino-phone-rotate 1.8s ease-in-out infinite;
    }

    .dino-game-phone::after {
        position: absolute;
        left: 50%;
        bottom: 4px;
        width: 8px;
        height: 2px;
        border-radius: 999px;
        background: #88c95b;
        content: "";
        transform: translateX(-50%);
    }

    .dino-game-overlay-close {
        position: absolute;
        z-index: 3;
        top: max(10px, env(safe-area-inset-top));
        right: max(10px, env(safe-area-inset-right));
        display: grid;
        width: 42px;
        height: 42px;
        padding: 0 0 3px;
        place-items: center;
        border: 1px solid rgb(255 255 255 / 28%);
        border-radius: 50%;
        background: rgb(10 13 18 / 72%);
        color: #fff;
        font-size: 28px;
        line-height: 1;
        cursor: pointer;
        backdrop-filter: blur(8px);
    }

    .dino-game-overlay-close:focus-visible {
        outline: 3px solid #88c95b;
        outline-offset: 2px;
    }

    html.has-dino-game-open,
    html.has-dino-game-open body {
        overflow: hidden;
        overscroll-behavior: none;
    }
}

@media (orientation: landscape) and (max-height: 560px) {
    .dino-game.is-open .dino-game-intro {
        display: none;
    }

    .dino-game-frame-wrap {
        position: fixed;
        z-index: 100000;
        inset: 0;
        width: 100dvw;
        height: 100dvh;
        margin: 0;
        padding: 0;
        background: #11161d;
    }

    .dino-game-frame-wrap iframe {
        display: block;
        width: 100dvw;
        height: 100dvh;
        min-height: 0;
        border-radius: 0;
    }

    .dino-game.is-claiming-code .dino-game-reward-bar {
        display: none;
    }

    .dino-game-overlay-close {
        position: absolute;
        z-index: 3;
        top: max(10px, env(safe-area-inset-top));
        right: max(10px, env(safe-area-inset-right));
        display: grid;
        width: 42px;
        height: 42px;
        padding: 0 0 3px;
        place-items: center;
        border: 1px solid rgb(255 255 255 / 28%);
        border-radius: 50%;
        background: rgb(10 13 18 / 72%);
        color: #fff;
        font-size: 28px;
        line-height: 1;
        cursor: pointer;
        backdrop-filter: blur(8px);
    }

    html.has-dino-game-open,
    html.has-dino-game-open body {
        overflow: hidden;
        overscroll-behavior: none;
    }
}

@keyframes dino-phone-rotate {
    0%,
    15%,
    100% {
        transform: rotate(0deg);
    }

    45%,
    70% {
        transform: rotate(90deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .dino-game-phone {
        animation: none;
        transform: rotate(90deg);
    }
}
