/* ========================================
   主題：紙張鉛筆風格 (預設)
   Paper & Pencil Theme
   ======================================== */

.theme-paper {
    /* Color Palette */
    --bg-primary: #f5f0e6;
    --bg-secondary: #fffef9;
    --text-primary: #2c2c2c;
    --text-secondary: #666666;
    --accent-color: #5a7a8a;
    --error-color: #c0392b;
    --success-color: #27ae60;
    --border-color: #b8b0a0;

    /* Paper texture */
    background-image:
        linear-gradient(90deg, transparent 79px, #d4cfc4 79px, #d4cfc4 81px, transparent 81px),
        linear-gradient(#e8e4db 0.1em, transparent 0.1em);
    background-size: 100% 1.2em;
}

/* Paper-like background */
.theme-paper #app {
    background-color: var(--bg-secondary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23d4cfc4' fill-opacity='0.15'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.05),
        0 4px 20px rgba(0, 0, 0, 0.1),
        inset 0 0 80px rgba(0, 0, 0, 0.03);
}

/* Handwriting font for numbers */
.theme-paper .sudoku-cell {
    font-family: var(--font-handwriting);
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
}

.theme-paper .sudoku-cell.fixed {
    font-weight: 700;
    color: #1a1a1a;
}

.theme-paper .sudoku-cell.user-input {
    color: #4a6070;
    font-style: italic;
}

/* Pencil line effect for grid */
.theme-paper #sudoku-board {
    background-color: #c0b8a8;
    border: 3px solid #4a4a4a;
    box-shadow:
        inset 0 0 10px rgba(0, 0, 0, 0.1),
        0 2px 10px rgba(0, 0, 0, 0.15);
}

.theme-paper .sudoku-cell {
    background-color: var(--bg-secondary);
    border: 1px solid #d0c8b8;
}

/* 3x3 box borders - pencil thick lines */
.theme-paper .sudoku-cell:nth-child(3n) {
    border-right: 2px solid #4a4a4a;
}

.theme-paper .sudoku-cell:nth-child(9n) {
    border-right: 1px solid #d0c8b8;
}

.theme-paper .sudoku-cell:nth-child(n+19):nth-child(-n+27),
.theme-paper .sudoku-cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid #4a4a4a;
}

/* Header styling */
.theme-paper #game-header {
    background: linear-gradient(180deg, #f8f4eb 0%, #f0ebe0 100%);
    border-bottom: 2px dashed #c0b8a8;
}

.theme-paper #game-title {
    font-family: var(--font-handwriting);
    font-size: 2.2rem;
    color: #3a3a3a;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
}

/* Stats bar - notebook style */
.theme-paper #stats-bar {
    background: linear-gradient(90deg, transparent 0px, #faf7f0 0px);
    border: 1px dashed #c0b8a8;
    border-radius: 4px;
}

.theme-paper .stat-value {
    font-family: var(--font-handwriting);
    font-size: 1.5rem;
}

/* Number pad - paper buttons */
.theme-paper .num-btn {
    font-family: var(--font-handwriting);
    font-size: 1.8rem;
    background-color: #faf7f0;
    border: 2px solid #c0b8a8;
    border-radius: 4px;
    box-shadow:
        2px 2px 0 #c0b8a8,
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: all 0.15s ease;
}

.theme-paper .num-btn:hover {
    background-color: #5a7a8a;
    color: #fff;
    border-color: #4a6a7a;
    box-shadow: 1px 1px 0 #4a6a7a;
    transform: translate(1px, 1px);
}

.theme-paper .num-btn.erase-btn {
    background-color: #f0e8e0;
}

.theme-paper .num-btn.erase-btn:hover {
    background-color: #c0392b;
    border-color: #a0291b;
}

/* Control buttons */
.theme-paper .control-btn {
    font-family: var(--font-primary);
    background-color: #faf7f0;
    border: 2px solid #c0b8a8;
    box-shadow: 2px 2px 0 #c0b8a8;
}

.theme-paper .control-btn:hover {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 #c0b8a8;
}

.theme-paper .control-btn.primary {
    background-color: #5a7a8a;
    border-color: #4a6a7a;
    box-shadow: 2px 2px 0 #4a6a7a;
}

/* Icon buttons */
.theme-paper .icon-btn {
    background-color: transparent;
    border: 2px solid transparent;
}

.theme-paper .icon-btn:hover {
    background-color: rgba(90, 122, 138, 0.1);
    border-color: #c0b8a8;
    border-radius: 50%;
}

/* Modal styling */
.theme-paper .modal-content {
    background-color: #fffef9;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23d4cfc4' fill-opacity='0.1'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    border: 3px solid #c0b8a8;
    box-shadow:
        5px 5px 0 #c0b8a8,
        0 0 20px rgba(0, 0, 0, 0.1);
}

.theme-paper .modal-content h2 {
    font-family: var(--font-handwriting);
    font-size: 2rem;
}

/* Selection highlight */
.theme-paper .sudoku-cell.selected {
    background-color: rgba(90, 122, 138, 0.25);
    box-shadow: inset 0 0 0 2px #5a7a8a;
}

.theme-paper .sudoku-cell.highlighted {
    background-color: rgba(90, 122, 138, 0.1);
}

/* Error state */
.theme-paper .sudoku-cell.error {
    color: #c0392b;
    background-color: rgba(192, 57, 43, 0.1);
}

/* Difficulty buttons */
.theme-paper .difficulty-btn {
    background-color: #faf7f0;
    border: 2px solid #c0b8a8;
    box-shadow: 2px 2px 0 #c0b8a8;
}

.theme-paper .difficulty-btn:hover {
    border-color: #5a7a8a;
    background-color: rgba(90, 122, 138, 0.1);
    box-shadow: 1px 1px 0 #5a7a8a;
    transform: translate(1px, 1px);
}

/* Theme cards */
.theme-paper .theme-card {
    background-color: #faf7f0;
    border: 2px solid #c0b8a8;
}

.theme-paper .theme-card:hover {
    border-color: #5a7a8a;
}

.theme-paper .theme-card.active {
    border-color: #27ae60;
    box-shadow: 0 0 0 2px #27ae60;
}