.rn-game-shell {
    --rn-ink: #fffaf0;
    --rn-panel: rgba(15, 18, 24, 0.68);
    --rn-line: rgba(255, 255, 255, 0.22);
    --rn-cyan: #39d7ff;
    --rn-pink: #ff4f8b;
    --rn-lime: #a6ff4d;
    --rn-gold: #ffd34d;
    box-sizing: border-box;
    display: grid;
    min-height: 100svh;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    place-items: center;
    padding: 14px;
    background:
        radial-gradient(circle at 20% 12%, rgba(255, 211, 77, 0.20), transparent 28%),
        linear-gradient(160deg, #111827 0%, #201f2d 45%, #112826 100%);
    color: var(--rn-ink);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.rn-game-shell *,
.rn-game-shell *::before,
.rn-game-shell *::after {
    box-sizing: inherit;
}

.rn-phone {
    position: relative;
    width: min(calc(100vw - 28px), 430px);
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    background: #0a0f18;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    touch-action: none;
}

.rn-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #0a0f18;
}

.rn-topbar {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: auto 1fr 42px;
    align-items: center;
    gap: 10px;
    padding: max(12px, env(safe-area-inset-top)) 12px 8px;
    pointer-events: none;
}

.rn-title {
    min-width: 0;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.rn-meter {
    position: relative;
    height: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.rn-meter-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--rn-cyan), var(--rn-lime), var(--rn-gold));
}

.rn-meter-text {
    position: absolute;
    inset: -1px 0 auto;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.8);
}

.rn-icon-button,
.rn-primary {
    border: 1px solid rgba(255, 255, 255, 0.36);
    color: #fff;
    cursor: pointer;
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

.rn-icon-button {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.28);
    font-size: 22px;
    font-weight: 900;
    pointer-events: auto;
}

.rn-icon-button.is-muted {
    color: rgba(255, 255, 255, 0.55);
}

.rn-center-panel {
    position: absolute;
    z-index: 4;
    left: 50%;
    top: 49%;
    width: min(78vw, 310px);
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    padding: 22px 18px;
    background: var(--rn-panel);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
    text-align: center;
    backdrop-filter: blur(14px);
}

.rn-center-panel h2 {
    margin: 0 0 18px;
    color: #fff;
    font-size: 30px;
    line-height: 1.1;
    letter-spacing: 0;
}

.rn-center-panel p {
    min-height: 22px;
    margin: -6px 0 16px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 15px;
}

.rn-primary {
    width: 100%;
    min-height: 46px;
    border-radius: 8px;
    background: linear-gradient(135deg, #ff4f8b, #ffd34d);
    color: #111827;
    font-size: 18px;
    font-weight: 900;
}

.rn-hidden {
    display: none;
}

.rn-icon-button:active,
.rn-primary:active {
    transform: translateY(1px);
}

@media (max-width: 480px) {
    .rn-game-shell {
        padding: 0;
    }

    .rn-phone {
        width: 100vw;
        height: 100svh;
        aspect-ratio: auto;
        border-width: 0;
        border-radius: 0;
    }
}
