:root {
    --bg-color: #0d1117;
    --text-primary: #e6edf3;
    --text-secondary: #7d8590;
    --card-bg: rgba(30, 35, 43, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --modal-bg: rgba(20, 25, 30, 0.7);
    --modal-border: rgba(255, 255, 255, 0.15);
    
    --spring-gradient: linear-gradient(135deg, #2ea043 0%, #3fb950 100%);
    --spring-glow: rgba(63, 185, 80, 0.4);
    
    --summer-gradient: linear-gradient(135deg, #d29922 0%, #e3b341 100%);
    --summer-glow: rgba(227, 179, 65, 0.4);
    
    --autumn-gradient: linear-gradient(135deg, #da3633 0%, #f85149 100%);
    --autumn-glow: rgba(248, 81, 73, 0.4);
    
    --winter-gradient: linear-gradient(135deg, #316dca 0%, #388bfd 100%);
    --winter-glow: rgba(56, 139, 253, 0.4);
    
    --empty-bg: rgba(255, 255, 255, 0.03);
}

body {
    font-family: 'Outfit', sans-serif;
    margin: 0;
    padding: 40px 20px;
    background: radial-gradient(circle at 50% 0%, #1a202c 0%, #0d1117 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out forwards;
}

h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 0.2em;
    background: linear-gradient(to right, #e6edf3, #7d8590);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
    margin-top: 10px;
}

header strong {
    color: #fff;
    font-weight: 600;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.02);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: fadeInUp 0.8s ease-out backwards;
    animation-delay: 0.2s;
    box-sizing: border-box;
}

.cell {
    position: relative;
    border: 1px solid var(--card-border);
    padding: 18px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-size: 13px;
    font-weight: 600;
    border-radius: 12px;
    background: var(--card-bg);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    overflow: hidden;
    z-index: 1;
}

.cell::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    border-radius: 11px;
}

.cell:hover {
    transform: translateY(-4px) scale(1.03);
    border-color: rgba(255, 255, 255, 0.3);
    z-index: 10;
}

/* Кольори за фазою WHEN */
.cell-spring {
    background: rgba(46, 160, 67, 0.15);
    border-color: rgba(46, 160, 67, 0.3);
    color: #7ee787;
}
.cell-spring:hover {
    box-shadow: 0 8px 24px var(--spring-glow);
    background: var(--spring-gradient);
    color: #fff;
    border-color: transparent;
}

.cell-summer {
    background: rgba(210, 153, 34, 0.15);
    border-color: rgba(210, 153, 34, 0.3);
    color: #e3b341;
}
.cell-summer:hover {
    box-shadow: 0 8px 24px var(--summer-glow);
    background: var(--summer-gradient);
    color: #fff;
    border-color: transparent;
}

.cell-autumn {
    background: rgba(218, 54, 51, 0.15);
    border-color: rgba(218, 54, 51, 0.3);
    color: #ff7b72;
}
.cell-autumn:hover {
    box-shadow: 0 8px 24px var(--autumn-glow);
    background: var(--autumn-gradient);
    color: #fff;
    border-color: transparent;
}

.cell-winter {
    background: rgba(49, 109, 202, 0.15);
    border-color: rgba(49, 109, 202, 0.3);
    color: #79c0ff;
}
.cell-winter:hover {
    box-shadow: 0 8px 24px var(--winter-glow);
    background: var(--winter-gradient);
    color: #fff;
    border-color: transparent;
}

.cell-empty {
    background: var(--empty-bg);
    border-color: transparent;
    color: rgba(255, 255, 255, 0.2);
    cursor: default;
}
.cell-empty:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

/* Модальне вікно (Glassmorphism) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: var(--modal-bg);
    margin: 5% auto;
    padding: 40px;
    border: 1px solid var(--modal-border);
    width: 100%;
    max-width: 800px;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    color: var(--text-primary);
    position: relative;
    animation: modalScaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-sizing: border-box;
}

.close {
    position: absolute;
    top: 24px;
    right: 24px;
    color: var(--text-secondary);
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
}
.close:hover {
    color: #fff;
    transform: rotate(90deg);
}

#modal-title {
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 12px;
    font-weight: 700;
}

.trigram {
    font-family: 'Outfit', monospace;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    display: inline-block;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 24px;
    border: 1px solid var(--card-border);
    font-weight: 500;
    letter-spacing: 1px;
    color: #8b949e;
}

#modal-desc {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #c9d1d9;
    margin-bottom: 30px;
}

#modal-fields, #modal-representatives, #modal-works, #modal-links {
    margin-top: 16px;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

#modal-fields strong, #modal-representatives strong, #modal-works strong, #modal-links strong {
    color: #58a6ff;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

#modal-links a {
    display: inline-block;
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.3);
    padding: 6px 14px;
    border-radius: 20px;
    margin-right: 8px;
    margin-bottom: 8px;
    color: #58a6ff;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
}
#modal-links a:hover {
    background: rgba(88, 166, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.2);
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modalScaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Responsive */
@media (max-width: 900px) {
    .grid-container {
        gap: 8px;
        padding: 16px;
    }
    .cell {
        font-size: 11px;
        min-height: 50px;
        padding: 12px 4px;
    }
}

@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }
    .grid-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    .cell {
        font-size: 12px;
        min-height: 44px;
        padding: 8px 4px;
    }
    .modal-content {
        padding: 24px;
        margin: 10% auto;
        width: 100%;
    }
    #modal-title {
        font-size: 1.5rem;
    }
}
