:root {
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --grid-cell-size: 35px;
}

.font-size-xs { font-size: var(--font-size-xs) !important; }
.font-size-sm { font-size: var(--font-size-sm) !important; }
.font-size-base { font-size: var(--font-size-base) !important; }
.font-size-lg { font-size: var(--font-size-lg) !important; }
.font-size-xl { font-size: var(--font-size-xl) !important; }

.crossword-grid {
    display: grid;
    gap: 1px;
    background-color: #000;
    padding: 1px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    overflow-x: auto;
}

.crossword-cell {
    width: var(--grid-cell-size);
    height: var(--grid-cell-size);
    background-color: white;
    border: none;
    text-align: center;
    font-weight: 500;
    font-size: 1.125rem;
    line-height: 1;
    transition: all 0.2s;
    position: relative;
}

.crossword-cell:focus {
    outline: 3px solid #4F46E5;
    z-index: 10;
}

.crossword-cell.blocked {
    background-color: #1F2937;
    cursor: not-allowed;
}

.crossword-cell.highlighted {
    background-color: #EEF2FF;
}

.crossword-cell.active {
    background-color: #C7D2FE;
}

.cell-input {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    text-align: center;
    font-size: 1.1rem;
    background: transparent;
    font-weight: 500;
    font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
    color: #1F2937;
}

.cell-input:focus {
    background-color: #EEF2FF;
    color: #1F2937;
}

.dark .cell-input {
    color: #F9FAFB;
}

.dark .cell-input:focus {
    background-color: #4338CA;
    color: #F9FAFB;
}

.cell-number {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 10px;
    font-weight: bold;
    color: #4B5563;
}

.sidebar-transition {
    transition: transform 0.3s ease-in-out;
}

.dark .crossword-cell {
    background-color: #374151;
    color: white;
}

.dark .crossword-cell.blocked {
    background-color: #111827;
}

.dark .crossword-cell.highlighted {
    background-color: #4338CA;
}

.dark .crossword-cell.active {
    background-color: #6366F1;
}

@media (max-width: 768px) {
    :root {
        --grid-cell-size: 28px;
    }
}

/* PCでのレイアウト最適化 */
@media (min-width: 1024px) {
    .crossword-grid {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .clue-item {
        font-size: 0.875rem;
        line-height: 1.4;
    }
    
    .clue-item .clue-number {
        font-size: 0.75rem;
    }
}

.animate-bounce-subtle {
    animation: bounce-subtle 0.5s ease-in-out;
}

@keyframes bounce-subtle {
    0%, 20%, 53%, 80%, 100% { transform: translate3d(0,0,0); }
    40%, 43% { transform: translate3d(0,-4px,0); }
    70% { transform: translate3d(0,-2px,0); }
}

.pulse-success {
    animation: pulse-success 0.6s ease-in-out;
}

@keyframes pulse-success {
    0% { background-color: #10B981; }
    100% { background-color: white; }
}

.modal-backdrop {
    backdrop-filter: blur(4px);
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-fill {
    transition: stroke-dasharray 0.3s ease;
}

/* 追加のスタイル */
.game-container {
    max-width: 1200px;
    margin: 0 auto;
}

.clue-item {
    transition: all 0.2s ease;
}

.clue-item:hover {
    transform: translateX(4px);
}

.hint-button {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    transition: all 0.3s ease;
}

.hint-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.success-animation {
    animation: success-pulse 1s ease-in-out;
}

@keyframes success-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* アクセシビリティ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* フォーカス表示の改善 */
.crossword-cell:focus-visible {
    outline: 3px solid #4F46E5;
    outline-offset: 2px;
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
    .crossword-cell {
        border: 2px solid #000;
    }
    
    .crossword-cell.blocked {
        background-color: #000;
    }
} 