/* =============================================
   라이츠아웃 게임 스타일
   테마: 다크 + 옐로우 (#FBBF24)
   ============================================= */

html { background: #0f0f23; }

.lo-body {
    overflow: hidden;
    height: 100dvh;
    max-width: 480px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #f0f0f0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.lo-game {
    width: 100%;
    height: 100dvh;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #0f0f23;
}

.lo-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    z-index: 10;
    flex-shrink: 0;
}
.lo-back {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}
.lo-back:hover { color: #fff; }
.lo-info-badge {
    font-size: 13px;
    font-weight: 600;
    color: #FBBF24;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.lo-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 20px;
    overflow-y: auto;
}

/* ===== INTRO ===== */
.state-intro .lo-info-badge { display: none; }
.state-intro .lo-content {
    justify-content: center;
    padding-top: 0;
}

.lo-intro-emoji { font-size: 72px; margin-bottom: 16px; }
.lo-intro-title {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
}
.lo-intro-desc {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
}
.lo-intro-desc strong { color: #FBBF24; }

.lo-best {
    background: rgba(251, 191, 36, 0.1);
    border-radius: 10px;
    padding: 10px 18px;
    margin-bottom: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.lo-rules {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    justify-content: center;
}
.lo-rule-chip {
    padding: 6px 14px;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 20px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.lo-btn-start {
    display: inline-block;
    padding: 16px 48px;
    background: linear-gradient(135deg, #FBBF24, #D97706);
    color: #000;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
}
.lo-btn-start:active { transform: scale(0.95); }

/* ===== PLAYING ===== */
.state-playing .lo-content {
    justify-content: flex-start;
    padding-top: 16px;
}

.lo-stage-info {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
}
.lo-stage-info strong { color: #FBBF24; }

.lo-moves-info {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
}
.lo-moves-info strong { color: #FBBF24; }

/* Grid */
.lo-grid {
    display: grid;
    gap: 6px;
    margin-bottom: 16px;
}

.lo-cell {
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    border: 2px solid transparent;
    -webkit-tap-highlight-color: transparent;
}
.lo-cell.lo-on {
    background: #FBBF24;
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.5), inset 0 -3px 0 rgba(0,0,0,0.15);
    border-color: #D97706;
}
.lo-cell.lo-off {
    background: #1e1e35;
    border-color: #2d2d44;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
.lo-cell:active { transform: scale(0.92); }
.lo-cell.lo-toggling {
    animation: loToggle 0.2s ease;
}
@keyframes loToggle {
    0% { transform: scale(1); }
    50% { transform: scale(0.85); }
    100% { transform: scale(1); }
}

/* Stage clear overlay */
.lo-clear-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 15, 35, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    animation: loFadeIn 0.3s ease;
}
@keyframes loFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.lo-clear-text {
    font-size: 32px;
    font-weight: 900;
    color: #FBBF24;
    margin-bottom: 12px;
}
.lo-clear-moves {
    font-size: 16px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 24px;
}
.lo-btn-next {
    padding: 14px 40px;
    background: linear-gradient(135deg, #FBBF24, #D97706);
    color: #000;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
}
.lo-btn-next:active { transform: scale(0.95); }

/* ===== RESULT ===== */
.state-result .lo-info-badge { display: none; }
.state-result .lo-content {
    justify-content: flex-start;
    padding-top: 24px;
}

/* Toast */
.lo-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.lo-toast-show {
    opacity: 1;
    pointer-events: auto;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .lo-intro-title { font-size: 24px; }
    .lo-intro-emoji { font-size: 56px; }
}

@media (max-width: 360px) {
    .lo-top-bar { padding: 10px 12px; }
    .lo-content { padding: 12px 16px; }
    .lo-grid { gap: 4px; }
}
