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

body {
    font-family: 'Arial', sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #e8d5c4;
    position: relative;
}

/* Main Content Container */
.container {
    max-width: 1200px;
    width: 100%;
    background: rgba(26, 26, 26, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.8s ease-out;
    margin: 20px;
    margin-top: 20px;
    border: 1px solid rgba(184, 134, 11, 0.2);
}

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

.header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5em;
    color: #daa520;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-size: 1.2em;
    color: #d4af37;
    margin-bottom: 20px;
}

/* Instructions Box */
.instructions-box {
    background: linear-gradient(135deg, #2d5016 0%, #3d6e20 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 40px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(218, 165, 32, 0.3);
}

.instructions-title {
    font-size: 1.5em;
    color: #e8d5c4;
    margin-bottom: 10px;
}

.instructions-text {
    font-size: 1.1em;
    color: #e8d5c4;
    opacity: 0.9;
}

/* Word Display Area */
.word-display-area {
    background: rgba(40, 40, 40, 0.8);
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(184, 134, 11, 0.3);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Word Card */
.word-card {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.8) 0%, rgba(160, 82, 45, 0.8) 100%);
    padding: 30px 50px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(218, 165, 32, 0.3);
    position: relative;
    overflow: hidden;
}

.word-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(218, 165, 32, 0.4);
    border-color: #daa520;
}

.word-card.active {
    transform: scale(1);
    cursor: default;
}

.word-text {
    font-size: 2.5em;
    font-weight: bold;
    color: #e8d5c4;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.click-hint {
    font-size: 0.9em;
    color: #d4af37;
    margin-top: 10px;
    opacity: 0.8;
}

/* Root Breakdown Container */
.root-breakdown {
    display: none;
    width: 100%;
    margin-top: 30px;
    animation: slideIn 0.5s ease;
}

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

.root-breakdown.active {
    display: block;
}

/* Root Parts Grid */
.root-parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.root-part {
    background: rgba(26, 26, 26, 0.8);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(184, 134, 11, 0.2);
    transition: all 0.3s ease;
}

.root-part:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(218, 165, 32, 0.3);
    border-color: #b8860b;
}

.part-label {
    font-size: 0.9em;
    color: #b8860b;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-weight: bold;
}

.part-text {
    font-size: 1.8em;
    color: #ffd700;
    font-weight: bold;
    margin-bottom: 10px;
}

.part-meaning {
    font-size: 1em;
    color: #d4af37;
    line-height: 1.4;
}

.part-text.empty {
    color: #666;
    font-style: italic;
    font-size: 1.2em;
}

/* Etymology Note */
.etymology-note {
    background: rgba(184, 134, 11, 0.2);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    border: 1px solid rgba(218, 165, 32, 0.3);
}

.etymology-title {
    font-size: 1.2em;
    color: #daa520;
    margin-bottom: 10px;
    font-weight: bold;
}

.etymology-text {
    color: #e8d5c4;
    line-height: 1.6;
}

/* Navigation Controls */
.nav-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.nav-btn {
    background: rgba(40, 40, 40, 0.8);
    color: #e8d5c4;
    border: 2px solid rgba(184, 134, 11, 0.3);
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn:hover:not(:disabled) {
    background: rgba(184, 134, 11, 0.2);
    border-color: #b8860b;
    transform: scale(1.05);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.counter {
    font-size: 1.1em;
    color: #d4af37;
    font-weight: bold;
}

/* Word List Sidebar */
.word-list-container {
    background: rgba(40, 40, 40, 0.8);
    padding: 25px;
    border-radius: 15px;
    margin-top: 30px;
    border: 1px solid rgba(184, 134, 11, 0.3);
}

.word-list-title {
    font-size: 1.3em;
    color: #daa520;
    margin-bottom: 20px;
    text-align: center;
}

.word-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
}

.word-list::-webkit-scrollbar {
    width: 8px;
}

.word-list::-webkit-scrollbar-track {
    background: rgba(26, 26, 26, 0.8);
    border-radius: 4px;
}

.word-list::-webkit-scrollbar-thumb {
    background: #b8860b;
    border-radius: 4px;
}

.word-list::-webkit-scrollbar-thumb:hover {
    background: #daa520;
}

.word-list-item {
    background: rgba(26, 26, 26, 0.8);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(184, 134, 11, 0.2);
    font-size: 0.95em;
    color: #e8d5c4;
}

.word-list-item:hover {
    background: rgba(184, 134, 11, 0.3);
    border-color: #b8860b;
    transform: translateY(-2px);
}

.word-list-item.active {
    background: linear-gradient(135deg, #b8860b 0%, #daa520 100%);
    color: #1a1a1a;
    border-color: #daa520;
}

.word-list-item.has-roots {
    border-color: #27ae60;
}

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

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #d4af37;
}

.legend-box {
    width: 20px;
    height: 20px;
    border: 2px solid;
    border-radius: 4px;
}

.legend-box.has-roots {
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.2);
}

.legend-box.no-roots {
    border-color: rgba(184, 134, 11, 0.3);
    background: rgba(26, 26, 26, 0.8);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
        border-radius: 15px;
        margin-top: 60px;
    }

    h1 {
        font-size: 2em;
    }

    .word-card {
        padding: 20px 30px;
    }

    .word-text {
        font-size: 2em;
    }

    .root-parts-grid {
        grid-template-columns: 1fr;
    }

    .nav-controls {
        gap: 10px;
    }

    .nav-btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .word-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}
