/* Grid Filler Game - Static Website Styles */

:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #0f3460;
    --accent: #e94560;
    --accent-light: #ff6b6b;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --success: #4ade80;
    --warning: #fbbf24;
    --cell-empty: #2d3748;
    --cell-start: #22c55e;
    --cell-end: #ef4444;
    --cell-current: #3b82f6;
    --cell-path: #fbbf24;
    --cell-collapsed: #f97316;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-card);
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header .subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

header .date {
    margin-top: 15px;
    font-size: 1.3rem;
    color: var(--warning);
}

/* Game Section */
.game-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 900px) {
    .game-section {
        grid-template-columns: 1fr;
    }
}

.game-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.game-card h2 {
    margin-bottom: 20px;
    color: var(--accent-light);
    font-size: 1.5rem;
}

/* Game Grid */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.grid {
    display: grid;
    gap: 8px;
    margin: 20px 0;
}

.cell {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid transparent;
    background: var(--cell-empty);
    color: var(--text-secondary);
}

.cell:hover:not(.disabled) {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.3);
}

.cell.start {
    background: var(--cell-start);
    color: white;
}

.cell.end {
    background: var(--cell-end);
    color: white;
}

.cell.current {
    background: var(--cell-current);
    color: white;
    border-color: white;
    animation: pulse 1s infinite;
}

.cell.path {
    background: var(--cell-path);
    color: #1a1a2e;
}

.cell.collapsed {
    background: var(--cell-collapsed);
    color: white;
}

.cell.valid-move {
    border-color: var(--success);
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.5);
}

.cell.collapse-target {
    border-color: var(--cell-collapsed);
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.5);
}

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

@keyframes win-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px var(--success);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 40px var(--success);
    }
}

.cell.won {
    background: linear-gradient(135deg, var(--success), #22c55e);
    animation: win-pulse 0.8s infinite;
    border-color: white;
}

/* Game Info */
.game-info {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.info-badge {
    background: var(--bg-secondary);
    padding: 10px 20px;
    border-radius: 10px;
    text-align: center;
}

.info-badge .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.info-badge .value {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--accent-light);
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--accent);
}

.btn-secondary:hover {
    background: var(--accent);
}

/* Message */
.message {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    font-weight: bold;
}

.message.success {
    background: rgba(74, 222, 128, 0.2);
    color: var(--success);
}

.message.info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.message.error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Video Section */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: var(--bg-secondary);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

.video-container.loading::after {
    content: "Loading video...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-secondary);
}

/* How to Play */
.how-to-play {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
}

.how-to-play h2 {
    color: var(--accent-light);
    margin-bottom: 20px;
}

.how-to-play ol {
    margin-left: 20px;
}

.how-to-play li {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.how-to-play li strong {
    color: var(--text-primary);
}

/* Archive */
.archive {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
}

.archive h2 {
    color: var(--accent-light);
    margin-bottom: 20px;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.archive-item {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: block;
}

.archive-item:hover {
    background: var(--accent);
    transform: translateY(-3px);
}

.archive-item .date {
    font-weight: bold;
    margin-bottom: 5px;
}

.archive-item .target {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.archive-item:hover .target {
    color: white;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    border-top: 1px solid var(--bg-card);
    margin-top: 30px;
}

footer a {
    color: var(--accent-light);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.8rem;
    }

    .cell {
        width: 60px;
        height: 60px;
        font-size: 1.2rem;
    }

    .game-card {
        padding: 20px;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
