/* Game specific styles for Nonogram */

:root {
    --primary-color: #FF9800;
    --primary-hover: #F57C00;
    --text-main: #333;
    --bg-card: #FFFFFF;

    --cell-size: 32px;
    --border-thick: 2px solid #455A64;
    --border-thin: 1px solid #CFD8DC;
    --hint-bg: #FFF8E1;
    /* Soft yellow hints */
}

@media (max-width: 500px) {
    :root {
        var(--cell-size: 26px);
    }
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 20px 0;
}

.game-container h1 {
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.game-description {
    margin-bottom: 2rem;
    color: #555;
    font-size: 1.1rem;
}

/* Polished Controls */
.game-controls {
    background: var(--bg-card);
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    display: inline-flex;
    justify-content: center;
    gap: 2rem;
    align-items: center;
    border: 1px solid #eee;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: #555;
}

.form-select {
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #CFD8DC;
    background: #fff;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
}

.form-select:focus {
    border-color: var(--primary-color);
}

.game-area-wrapper {
    position: relative;
    display: inline-block;
    padding: 30px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    /* Soft shadow */
    margin-bottom: 2rem;
    overflow: auto;
    max-width: 100%;
}

.mode-switch-mobile {
    display: none;
    margin-bottom: 15px;
    justify-content: center;
    gap: 10px;
}

@media (hover: none) and (pointer: coarse) {
    .mode-switch-mobile {
        display: flex;
    }
}

.mode-btn {
    padding: 8px 20px;
    border: 2px solid #CFD8DC;
    background: white;
    border-radius: 20px;
    font-weight: bold;
    color: #607D8B;
    cursor: pointer;
}

.mode-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Board Layout */
.nono-board {
    display: grid;
    gap: 0;
    margin: 0 auto;
    user-select: none;
    background: #455A64;
    border: 2px solid #455A64;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.cell,
.hint-h,
.hint-v,
.corner {
    background-color: #fff;
    width: var(--cell-size);
    height: var(--cell-size);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13px;
    box-sizing: border-box;
    transition: background-color 0.05s;
}

/* Hints */
.hint-h,
.hint-v {
    background-color: var(--hint-bg);
    font-weight: bold;
    color: #5D4037;
    flex-direction: column;
    line-height: 1.1;
    font-size: 12px;
}

.hint-v {
    border-bottom: var(--border-thick);
    border-right: var(--border-thin);
    height: auto;
    min-height: calc(var(--cell-size) * 3);
    justify-content: flex-end;
    padding-bottom: 4px;
}

.hint-h {
    border-right: var(--border-thick);
    border-bottom: var(--border-thin);
    width: auto;
    min-width: calc(var(--cell-size) * 3);
    flex-direction: row;
    justify-content: flex-end;
    padding-right: 4px;
    gap: 4px;
}

.corner {
    background-color: transparent;
    border-right: var(--border-thick);
    border-bottom: var(--border-thick);
}

/* Cells */
.cell {
    border-right: var(--border-thin);
    border-bottom: var(--border-thin);
    cursor: pointer;
}

.cell:hover {
    background-color: #E3F2FD;
}

.cell.thick-r {
    border-right: var(--border-thick);
}

.cell.thick-b {
    border-bottom: var(--border-thick);
}

.hint-v.thick-r {
    border-right: var(--border-thick);
}

.hint-h.thick-b {
    border-bottom: var(--border-thick);
}

/* Cell States */
.cell.filled {
    background-color: #37474F;
    /* Softer black */
    animation: popIn 0.1s;
}

@keyframes popIn {
    from {
        transform: scale(0.8);
    }

    to {
        transform: scale(1);
    }
}

.cell.crossed {
    color: #B0BEC5;
    font-weight: bold;
}

.cell.crossed::after {
    content: '×';
    font-size: 1.4em;
}

/* Overlay */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

.hidden {
    display: none;
}

/* Buttons */
.primary-btn {
    background-color: var(--primary-color);
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 1rem 3rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(255, 152, 0, 0.3);
    letter-spacing: 1px;
}

.primary-btn:hover {
    background: #F57C00;
}

/* Instructions */
.instructions {
    background: #FAFAFA;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: left;
    margin: 3rem auto 5rem;
    color: #444;
    line-height: 1.8;
}

.instructions h3 {
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 700;
}