:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --accent-gold: #ffd700;
    --accent-pink: #ff6b9d;
    --accent-cyan: #00d4ff;
    --accent-purple: #a855f7;
    --accent-green: #22c55e;
    --accent-orange: #ff8c00;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --card-bg: rgba(255, 255, 255, 0.06);
    --card-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100vh;
    background: var(--bg-primary);
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Background effects */
.bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.25;
    animation: float 8s ease-in-out infinite;
}

.bg-orb-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-purple);
    top: -200px;
    right: -150px;
    animation-delay: 0s;
}

.bg-orb-2 {
    width: 350px;
    height: 350px;
    background: var(--accent-cyan);
    bottom: -100px;
    left: -100px;
    animation-delay: -3s;
}

.bg-orb-3 {
    width: 250px;
    height: 250px;
    background: var(--accent-pink);
    top: 40%;
    left: 60%;
    animation-delay: -6s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* Page layout */
.page-layout {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 20px 40px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Header */
header {
    padding-bottom: 8px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 8px;
    gap: 12px;
}

.back-btn {
    position: absolute;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s, background 0.3s;
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    margin-left: -8px;
    border-radius: 8px;
}

.back-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.back-btn:hover {
    color: var(--accent-gold);
    background: rgba(255, 255, 255, 0.08);
}

.back-btn:active {
    background: rgba(255, 255, 255, 0.14);
}

.header-title-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.community-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 20px;
    font-family: 'Jua', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--accent-purple), #7c3aed);
    color: #fff;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

h1 {
    font-family: 'Black Han Sans', sans-serif;
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    line-height: 1.2;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    margin-top: 4px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.game-author-line {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 4px;
}

.game-author-name {
    color: var(--accent-cyan);
    font-weight: 700;
}

/* Loading state */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error state */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 20px;
    color: var(--text-secondary);
    text-align: center;
}

.error-state p {
    font-size: 1.1rem;
    color: #ff6b6b;
}

.back-to-portal {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--accent-purple), #7c3aed);
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    font-family: 'Jua', sans-serif;
    font-size: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 44px;
}

.back-to-portal:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.4);
}

/* Game wrapper */
.game-wrapper {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.game-frame {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border: none;
    background: #000;
}

/* Action buttons row */
.game-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--text-secondary);
    font-family: 'Jua', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    min-height: 44px;
}

.action-btn svg {
    flex-shrink: 0;
}

.action-btn:hover {
    transform: scale(1.04);
}

.report-btn:hover {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.4);
    background: rgba(255, 107, 107, 0.1);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.2);
}

.share-btn:hover {
    color: var(--accent-cyan);
    border-color: rgba(0, 212, 255, 0.4);
    background: rgba(0, 212, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.2);
}

/* Game metadata row */
.game-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-size: 0.82rem;
}

/* Game description article */
.game-content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
}

.game-content h2 {
    font-family: 'Black Han Sans', sans-serif;
    font-size: 1.3rem;
    color: var(--accent-gold);
    margin-bottom: 12px;
}

.game-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Report modal */
.report-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.report-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 32px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
    animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.94) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.report-modal h3 {
    font-family: 'Black Han Sans', sans-serif;
    font-size: 1.4rem;
    color: var(--accent-gold);
    margin-bottom: 10px;
}

.report-modal > p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.report-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.report-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: border-color 0.2s, background 0.2s;
}

.report-options label:hover {
    border-color: rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.06);
    color: var(--text-primary);
}

.report-options input[type="radio"] {
    accent-color: var(--accent-purple);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

#reportDescription {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.9rem;
    padding: 12px;
    resize: vertical;
    margin-bottom: 20px;
    transition: border-color 0.2s;
}

#reportDescription:focus {
    outline: none;
    border-color: rgba(168, 85, 247, 0.5);
}

#reportDescription::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.report-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-submit,
.btn-cancel {
    font-family: 'Jua', sans-serif;
    font-size: 0.95rem;
    padding: 11px 24px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 44px;
}

.btn-submit {
    background: linear-gradient(135deg, var(--accent-purple), #7c3aed);
    color: #fff;
}

.btn-submit:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--text-primary);
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 0 10px;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--accent-gold);
}

/* Mobile responsive */
@media (max-width: 600px) {
    .container {
        padding: 14px 12px 32px;
        gap: 12px;
    }

    h1 {
        font-size: 1.7rem;
    }

    .back-btn span {
        display: none;
    }

    .back-btn {
        padding: 8px;
        min-width: 44px;
    }

    .game-frame {
        aspect-ratio: 3 / 4;
    }

    .game-wrapper {
        border-radius: 12px;
    }

    .game-actions {
        gap: 8px;
    }

    .action-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .game-content {
        padding: 16px;
    }

    .report-modal {
        padding: 24px 20px;
    }

    .report-buttons {
        flex-direction: column;
    }

    .btn-submit,
    .btn-cancel {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 400px) {
    h1 {
        font-size: 1.4rem;
    }

    .community-badge {
        font-size: 0.7rem;
        padding: 2px 10px;
    }
}
