/* =============================================
   노노그램 (네모로직) 게임 스타일
   테마: 다크 + 퍼플 (#A855F7)
   ============================================= */

html { background: #0f0f23; }

.nn-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;
}

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

.nn-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    z-index: 10;
    flex-shrink: 0;
}
.nn-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);
}
.nn-back:hover { color: #fff; }
.nn-info-badge {
    font-size: 13px;
    font-weight: 600;
    color: #A855F7;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
}

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

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

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

.nn-best {
    background: rgba(168, 85, 247, 0.1);
    border-radius: 10px;
    padding: 10px 18px;
    margin-bottom: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.nn-diff-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 280px;
    margin-bottom: 16px;
}
.nn-diff-btn {
    padding: 14px 20px;
    border: 2px solid rgba(168, 85, 247, 0.3);
    background: rgba(168, 85, 247, 0.08);
    color: #fff;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.nn-diff-btn:active { transform: scale(0.96); background: rgba(168, 85, 247, 0.2); }
.nn-diff-btn span { font-size: 13px; color: rgba(255,255,255,0.5); font-weight: 400; }

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

.nn-puzzle-info {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}
.nn-puzzle-info strong { color: #A855F7; }

.nn-grid-wrap {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 0;
    margin-bottom: 12px;
}

/* Column hints (above the grid) */
.nn-col-hints {
    display: flex;
    flex-direction: row;
}
.nn-col-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}
.nn-col-hint span {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.3;
}

/* Row hints (left of the grid) */
.nn-row-hints {
    display: flex;
    flex-direction: column;
}
.nn-row-hint {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    padding-right: 4px;
}
.nn-row-hint span {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
}

/* Grid */
.nn-grid {
    display: grid;
    gap: 1px;
    background: rgba(168, 85, 247, 0.15);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 4px;
}

.nn-cell {
    background: #1a1a2e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
    -webkit-tap-highlight-color: transparent;
}
.nn-cell.nn-filled {
    background: #A855F7;
}
.nn-cell.nn-marked {
    background: #1a1a2e;
    color: #EF4444;
    font-weight: 800;
}
.nn-cell.nn-error {
    background: #EF4444;
    animation: nnShake 0.3s;
}
@keyframes nnShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.nn-cell.nn-correct-reveal {
    background: #22C55E;
}

/* ===== Penalty display ===== */
.nn-penalty {
    font-size: 14px;
    color: #EF4444;
    margin-top: 8px;
    min-height: 20px;
}

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

/* Toast */
.nn-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;
}
.nn-toast-show {
    opacity: 1;
    pointer-events: auto;
}

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

@media (max-width: 360px) {
    .nn-top-bar { padding: 10px 12px; }
    .nn-content { padding: 12px 16px; }
    .nn-col-hint span,
    .nn-row-hint span { font-size: 9px; }
}
