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

:root {
    --primary: #ff6b6b;
    --primary-dark: #ee5a5a;
    --secondary: #4ecdc4;
    --accent: #ffd93d;
    --bg-dark: #1a1a2e;
    --bg-card: #16213e;
    --bg-card-hover: #1f3a5f;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --common: #95a5a6;
    --rare: #3498db;
    --epic: #9b59b6;
    --loving: #27ae60;
    --savage: #e74c3c;
    --gradient-fire: linear-gradient(135deg, #ff6b6b, #feca57, #ff9ff3);
    --gradient-ice: linear-gradient(135deg, #74b9ff, #a29bfe, #fd79a8);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

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

header h1 {
    font-size: 2.5rem;
    background: var(--gradient-fire);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

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

/* Tabs Navigation */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 20px;
    background: var(--bg-card);
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.tab:hover {
    background: var(--bg-card-hover);
}

.tab.active {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Timer Section */
.timer-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
}

.preset-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.preset-selector select {
    padding: 10px 15px;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 2px solid var(--secondary);
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
}

.btn-small {
    padding: 8px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-small:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.timer-display {
    margin: 30px 0;
}

.phase-indicator {
    font-size: 1rem;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.time {
    font-size: 5rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    background: var(--gradient-fire);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pomodoro-count {
    font-size: 1.5rem;
    margin-top: 10px;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.pomodoro-count.active {
    opacity: 1;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-dark);
    color: var(--text-primary);
}

.btn:hover {
    transform: translateY(-2px);
}

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

.btn.primary:hover {
    background: var(--primary-dark);
}

.stats-mini {
    display: flex;
    justify-content: center;
    gap: 30px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Words Section */
.words-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
}

.words-section h2 {
    text-align: center;
    margin-bottom: 20px;
}

.word-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 25px;
    background: var(--bg-dark);
    border-radius: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
}

.stat-box:nth-child(1) .stat-value { color: var(--common); }
.stat-box:nth-child(2) .stat-value { color: var(--rare); }
.stat-box:nth-child(3) .stat-value { color: var(--epic); }

.word-collection {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    min-height: 100px;
    padding: 15px;
    background: var(--bg-dark);
    border-radius: 10px;
}

.word-tag {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.word-tag.common { background: var(--common); color: white; }
.word-tag.rare { background: var(--rare); color: white; }
.word-tag.epic { background: var(--epic); color: white; }

.hint {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 15px;
    font-size: 0.9rem;
}

/* Roasts Section */
.roasts-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
}

.roasts-section h2 {
    text-align: center;
    margin-bottom: 20px;
}

.roast-filter {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

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

.roast-card {
    background: var(--bg-dark);
    border-radius: 15px;
    padding: 15px;
    position: relative;
    transition: all 0.3s ease;
}

.roast-card.locked {
    opacity: 0.5;
}

.roast-card.unlocked {
    border: 2px solid var(--loving);
}

.roast-card.unlocked.savage {
    border-color: var(--savage);
}

.roast-type-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: bold;
}

.roast-type-badge.loving { background: var(--loving); }
.roast-type-badge.savage { background: var(--savage); }

.roast-text {
    font-size: 1rem;
    margin: 10px 0;
    line-height: 1.4;
}

.roast-progress {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.roast-progress-bar {
    height: 4px;
    background: var(--bg-card);
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}

.roast-progress-fill {
    height: 100%;
    background: var(--gradient-fire);
    transition: width 0.3s ease;
}

.roast-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.roast-actions button {
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
}

/* Opponents Section */
.opponents-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
}

.opponents-section h2 {
    text-align: center;
    margin-bottom: 20px;
}

.add-opponent {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.add-opponent input {
    padding: 10px 15px;
    background: var(--bg-dark);
    border: 2px solid var(--text-secondary);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
}

.add-opponent input:focus {
    outline: none;
    border-color: var(--primary);
}

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

.opponent-card {
    background: var(--bg-dark);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    position: relative;
}

.opponent-emoji {
    font-size: 3rem;
    margin-bottom: 10px;
}

.opponent-name {
    font-size: 1.1rem;
    font-weight: bold;
}

.opponent-actions {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 5px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 20px;
    text-align: center;
}

.add-preset-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.add-preset-form input {
    padding: 10px;
    background: var(--bg-dark);
    border: 1px solid var(--text-secondary);
    border-radius: 8px;
    color: var(--text-primary);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

.toast {
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 10px;
    animation: slideIn 0.3s ease;
    max-width: 300px;
}

.toast.success { background: var(--loving); }
.toast.error { background: var(--savage); }
.toast.info { background: var(--rare); }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Word Popup Animation */
.word-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px 50px;
    z-index: 3000;
    animation: popIn 0.5s ease;
}

.word-content {
    text-align: center;
}

.word-text {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.word-rarity {
    display: block;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

@keyframes popIn {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 600px) {
    .time {
        font-size: 3.5rem;
    }
    
    .timer-controls {
        flex-direction: column;
    }
    
    .tabs {
        justify-content: center;
    }
    
    .word-stats {
        flex-direction: column;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}