/* Developer Wordle - Terminal Theme */

:root {
    --bg-primary: #000000;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --accent-green: #238636;
    --accent-yellow: #d29922;
    --accent-blue: #58a6ff;
    --accent-purple: #a371f7;
    --border-color: #30363d;
    --error-color: #f85149;
    --success-color: #238636;
    --warning-color: #d29922;
    --neon-orange: #ff6b35;
    --neon-glow: #ff9500;
}

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

body {
    font-family: 'Consolas', 'Monaco', 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: -1;
}

.container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 40px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3);
    border: none;
    transition: all 0.3s ease;
}

.container:hover {
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3);
    border: none;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 40px;
    background-image: url('banner.jpg');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    margin: -40px -40px 40px -40px;
    padding: 60px 40px 40px 40px;
    position: relative;
    border-radius: 12px 12px 0 0;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px 12px 0 0;
    z-index: 1;
}

header > * {
    position: relative;
    z-index: 2;
}

.ascii-title {
    font-size: 12px;
    line-height: 1;
    color: var(--neon-orange);
    margin-bottom: 10px;
    text-align: center;
    text-shadow:
        0 0 5px var(--neon-glow),
        0 0 10px var(--neon-glow),
        0 0 15px var(--neon-glow),
        0 0 20px var(--neon-glow);
    animation: neonFlicker 2s ease-in-out infinite alternate;
}

@keyframes neonFlicker {
    0%, 100% {
        text-shadow:
            0 0 5px var(--neon-glow),
            0 0 10px var(--neon-glow),
            0 0 15px var(--neon-glow),
            0 0 20px var(--neon-glow);
    }
    50% {
        text-shadow:
            0 0 10px var(--neon-glow),
            0 0 20px var(--neon-glow),
            0 0 30px var(--neon-glow),
            0 0 40px var(--neon-glow),
            0 0 50px var(--neon-glow);
    }
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 10px;
}

/* Difficulty Selector */
.difficulty-selector {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
}

.difficulty-selector h2 {
    color: var(--accent-blue);
    margin-bottom: 20px;
    text-align: center;
}

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

.difficulty-option {
    background: rgba(33, 38, 45, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.difficulty-option:hover {
    border-color: var(--neon-orange);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(255, 107, 53, 0.2);
}

.difficulty-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 107, 53, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.difficulty-option:hover::before {
    opacity: 1;
}

.difficulty-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.difficulty-option h3 {
    color: var(--neon-orange);
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.difficulty-option:hover h3 {
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
}

.difficulty-option p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.difficulty-details {
    color: var(--text-secondary);
    font-size: 12px;
    opacity: 0.8;
}

/* Game Info */
.game-info {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.terminal-title {
    color: var(--accent-green);
    font-weight: bold;
}

.difficulty-badge {
    background: var(--accent-purple);
    color: var(--bg-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.difficulty-badge.junior { background: var(--accent-green); }
.difficulty-badge.mid { background: var(--accent-blue); }
.difficulty-badge.senior { background: var(--accent-yellow); }
.difficulty-badge.architect { background: var(--accent-purple); }

.hints-remaining, .timer {
    color: var(--text-secondary);
    font-size: 14px;
}

.timer.warning {
    color: var(--error-color);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

/* Game Container */
.game-container {
    text-align: center;
}

.game-grid {
    display: grid;
    gap: 5px;
    margin: 20px auto;
    max-width: 350px;
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 12px;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 0 20px rgba(255, 107, 53, 0.1);
    border: 1px solid rgba(255, 107, 53, 0.2);
    position: relative;
    transition: all 0.3s ease;
}

.game-grid:hover {
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 0 30px rgba(255, 107, 53, 0.2),
        0 0 20px rgba(255, 107, 53, 0.1);
}

.tile {
    width: 50px;
    height: 50px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
    background: rgba(22, 27, 34, 0.8);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tile:hover {
    transform: scale(1.05);
    border-color: var(--neon-orange);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
}

.tile::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 107, 53, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
}

.tile:hover::before {
    animation: shimmer 0.5s ease-in-out;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
        opacity: 0;
    }
}

.tile.filled {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.tile.correct {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: var(--bg-primary);
}

.tile.present {
    background: var(--accent-yellow);
    border-color: var(--accent-yellow);
    color: var(--bg-primary);
}

.tile.absent {
    background: var(--border-color);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* Keyboard */
.keyboard {
    margin: 20px auto;
    max-width: 500px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 8px;
}

.key {
    background: rgba(33, 38, 45, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    min-width: 35px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.key:hover {
    background: var(--border-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.3);
}

.key:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
}

.key::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.3), transparent);
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    border-radius: 50%;
}

.key:hover::after {
    width: 100%;
    height: 100%;
}

.key.wide {
    min-width: 65px;
    font-size: 12px;
}

.key.correct {
    background: var(--accent-green);
    color: var(--bg-primary);
}

.key.present {
    background: var(--accent-yellow);
    color: var(--bg-primary);
}

.key.absent {
    background: var(--border-color);
    color: var(--text-secondary);
}

/* Message */
.message {
    margin: 20px 0;
    padding: 10px;
    border-radius: 4px;
    font-weight: bold;
    min-height: 20px;
}

.message.success {
    background: var(--accent-green);
    color: var(--bg-primary);
}

.message.error {
    background: var(--error-color);
    color: var(--bg-primary);
}

.message.info {
    background: var(--accent-blue);
    color: var(--bg-primary);
}

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

.btn {
    background: rgba(33, 38, 45, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    padding: 10px 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background: var(--border-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    border-color: var(--neon-orange);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 5% auto;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}

/* Stats */
.stats-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-green);
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.guess-distribution {
    margin-top: 20px;
}

.guess-bar {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

.guess-label {
    width: 20px;
    text-align: right;
    margin-right: 10px;
    font-size: 14px;
}

.guess-fill {
    height: 20px;
    background: var(--accent-green);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 5px;
    color: var(--bg-primary);
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
}

/* Story Modal */
#storyContent h3 {
    color: var(--accent-blue);
    margin: 15px 0 10px 0;
}

.story-quote {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--accent-green);
    padding: 15px;
    margin: 15px 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .difficulty-options {
        grid-template-columns: 1fr;
    }
    
    .tile {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .game-grid {
        max-width: 320px;
        padding: 15px;
    }
    
    .key {
        min-width: 30px;
        height: 40px;
        font-size: 12px;
    }
    
    .key.wide {
        min-width: 50px;
        font-size: 10px;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
}

/* Animation Classes */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

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

@keyframes flip {
    0% { transform: rotateY(0); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(0); }
}

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

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Terminal Effects */
.terminal-cursor {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Code Syntax Highlighting */
.code-block {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    overflow-x: auto;
}

.keyword { color: #ff7b72; }
.string { color: #a5d6ff; }
.comment { color: #8b949e; }
.function { color: #d2a8ff; }
.number { color: #79c0ff; }