:root {
    --bg1: #f5f7fa;
    --bg2: #e8eef3;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --card: #ffffff;
    --brand: #55b761;
    --brand2: #48a356;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 100%);
    color: var(--text);
}

/* Ensure HTML `hidden` always wins (we use it to hide the game overlay) */
[hidden] {
    display: none !important;
}

/* Split layout */
.app {
    min-height: 100vh;
    display: flex;
}

.left,
.right {
    flex: 0 0 50%;
    min-width: 0;
}

.left {
    padding: 48px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.left-card {
    width: 100%;
    max-width: 680px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 56px 52px;
    backdrop-filter: blur(10px);
}

.brand-logo {
    width: 190px;
    height: auto;
    margin-bottom: 28px;
}

h1 {
    font-size: 32px;
    font-weight: 650;
    color: #111827;
    margin: 0 0 12px;
    line-height: 1.2;
}

.subtitle {
    margin: 0 0 30px;
    font-size: 18px;
    line-height: 1.65;
    color: var(--muted);
}

.cta-section {
    background: linear-gradient(135deg, #f8fafb 0%, #f1f5f9 100%);
    border-radius: 14px;
    padding: 28px;
    margin: 28px 0 0;
    border-left: 4px solid var(--brand);
}

.cta-text {
    margin: 0 0 18px;
    font-size: 16px;
    color: #475569;
    line-height: 1.7;
}

.notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 0;
    font-size: 13px;
    color: #64748b;
}

.notice::before {
    content: '🔒';
    font-size: 15px;
}

.company-info {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.company-info h2 {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.company-details {
    font-size: 14px;
    color: #64748b;
    line-height: 1.85;
}

.company-details strong {
    color: #334155;
    font-weight: 700;
}

.footer {
    margin-top: 26px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    text-align: center;
}

.edit-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.25s ease;
}

.edit-link:hover {
    color: #64748b;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 22px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 650;
    font-size: 15px;
    border: 1px solid transparent;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand2) 100%);
    box-shadow: 0 10px 24px rgba(85, 183, 97, 0.28);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(85, 183, 97, 0.34);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.92);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
}

/* Right side (game) */
.right {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(1200px 600px at 20% 20%, rgba(85, 183, 97, 0.24), rgba(85, 183, 97, 0) 60%),
        radial-gradient(900px 600px at 85% 75%, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 55%),
        #0b1220;
}

.game-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px;
}

.game-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.game-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.game-brand-icon {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.35));
}

.game-brand-text {
    min-width: 0;
}

.game-name {
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.1;
    font-size: 18px;
}

.game-tagline {
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    line-height: 1.35;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    flex: 0 0 auto;
    width: min(340px, 100%);
}

.stat {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
}

.stat-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 750;
}

.stat-value {
    margin-top: 4px;
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

.game-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
}

.game-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.game-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: radial-gradient(100% 100% at 50% 20%, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.55));
    backdrop-filter: blur(10px);
}

.overlay-card {
    width: min(460px, 100%);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
    padding: 20px 20px 18px;
    color: rgba(255, 255, 255, 0.9);
}

.overlay-card h2 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 22px;
    letter-spacing: 0.02em;
}

.overlay-message {
    margin: 0 0 14px;
    color: rgba(255, 255, 255, 0.76);
    line-height: 1.6;
}

.overlay-list {
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.overlay-list li {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
}

.overlay-list strong {
    color: #ffffff;
}

.overlay-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.overlay-note {
    margin: 14px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.55;
}

.game-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 20px;
}

.game-hint {
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    line-height: 1.4;
}

/* Corner buttons (mobile + quick access) */
.game-corner-buttons {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.corner {
    pointer-events: auto;
    position: absolute;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
    font-size: 18px;
    font-weight: 800;
    opacity: 0.85;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.corner:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.24);
}

.corner:active {
    transform: scale(0.96);
}

.corner-tl {
    top: 14px;
    left: 14px;
}
.corner-tr {
    top: 14px;
    right: 14px;
}
.corner-bl {
    bottom: 14px;
    left: 14px;
}
.corner-br {
    bottom: 14px;
    right: 14px;
}

.game-stage.shake {
    animation: shake 220ms ease-in-out;
}

@keyframes shake {
    0% {
        transform: translate3d(0, 0, 0);
    }
    25% {
        transform: translate3d(-6px, 0, 0);
    }
    50% {
        transform: translate3d(6px, 0, 0);
    }
    75% {
        transform: translate3d(-4px, 0, 0);
    }
    100% {
        transform: translate3d(0, 0, 0);
    }
}

/* Responsive */
@media (max-width: 980px) {
    .app {
        flex-direction: column;
    }

    .left,
    .right {
        flex: 0 0 auto;
        width: 100%;
    }

    .left {
        padding: 24px;
    }

    .left-card {
        max-width: 820px;
        padding: 44px 34px;
    }

    .game-shell {
        padding: 18px;
    }
}

@media (min-width: 981px) {
    .app {
        height: 100vh;
    }
}

@media (pointer: fine) {
    .corner {
        opacity: 0.32;
    }

    .corner:hover {
        opacity: 0.95;
    }
}

@media (max-width: 520px) {
    h1 {
        font-size: 26px;
    }

    .subtitle {
        font-size: 16px;
    }

    .cta-section {
        padding: 22px;
    }

    .game-stats {
        width: 100%;
    }

    .corner {
        width: 50px;
        height: 50px;
        border-radius: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn {
        transition: none;
    }
    .game-stage.shake {
        animation: none;
    }
}


