/* CriptoSopa - Knight Movement Word Search */

:root {
    --cell-size: clamp(40px, 8vw, 60px);
    --grid-gap: 4px;
    --neon-cyan: #00ffff;
    --neon-magenta: #ff0080;
    --neon-yellow: #ffd700;
}

/* Desktop Logo (top left) */
.desktop-logo {
    display: none;
}

@media (min-width: 768px) {
    .desktop-logo {
        display: flex;
        position: fixed;
        top: 15px;
        left: 20px;
        z-index: 1001;
    }
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.03);
}

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-magenta);
}

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

.joystick-icon {
    width: 40px;
    height: 40px;
}

/* Desktop Navigation (top right) */
.desktop-nav {
    display: none;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
        position: fixed;
        top: 20px;
        right: 20px;
        gap: 12px;
        z-index: 1001;
    }
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    min-height: 44px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid;
    border-radius: 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    backdrop-filter: blur(10px);
}

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

.nav-btn.btn-home {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.nav-btn.btn-home:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
}

.nav-btn.btn-sound {
    border-color: #ff8000;
    color: #ff8000;
    box-shadow: 0 0 10px rgba(255, 128, 0, 0.3);
    min-width: 130px;
}

.nav-btn.btn-sound:hover {
    background: rgba(255, 128, 0, 0.1);
    box-shadow: 0 0 20px rgba(255, 128, 0, 0.6);
}

.nav-btn.btn-sound i {
    font-size: 1.2rem;
}

.nav-btn.btn-sound.muted {
    border-color: #ff4444;
    color: #ff4444;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
}

.nav-btn.btn-sound.muted:hover {
    background: rgba(255, 68, 68, 0.1);
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.6);
}

.nav-btn.btn-leaderboard {
    border-color: #a855f7;
    color: #a855f7;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.nav-btn.btn-leaderboard:hover {
    background: rgba(168, 85, 247, 0.1);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.6);
}

/* Games Menu Container */
.games-menu-container {
    position: relative;
}

.nav-btn.btn-games {
    border-color: var(--neon-yellow);
    color: var(--neon-yellow);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.nav-btn.btn-games:hover {
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.games-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: rgba(10, 10, 26, 0.98);
    border: 2px solid var(--neon-yellow);
    border-radius: 10px;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1002;
}

.games-menu-container:hover .games-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.game-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.2s ease;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
}

.game-menu-item:last-child {
    border-bottom: none;
}

.game-menu-item:hover {
    background: rgba(255, 215, 0, 0.1);
    color: var(--neon-yellow);
    padding-left: 20px;
}

.game-menu-item.current {
    background: rgba(255, 215, 0, 0.15);
    color: var(--neon-yellow);
}

.game-icon {
    font-size: 1.3rem;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
}

/* Layout */
.game-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

@media (min-width: 1024px) {
    .game-wrapper {
        grid-template-columns: 1fr 320px;
    }
}

/* Timer */
.timer-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.timer-display {
    background-color: rgba(9, 9, 11, 0.9);
    border: 2px solid var(--neon-orange);
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 0 20px rgba(255, 153, 0, 0.3);
}

.timer-display span {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--neon-orange);
    letter-spacing: 0.2em;
    text-shadow: 0 0 10px var(--neon-orange);
}

/* Board Panel */
.board-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.board-container {
    position: relative;
    padding: 1rem;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid var(--neon-cyan);
    border-radius: 12px;
    box-shadow:
        0 0 30px rgba(6, 182, 212, 0.3),
        inset 0 0 20px rgba(6, 182, 212, 0.1);
}

.game-board {
    display: grid;
    grid-template-columns: repeat(8, var(--cell-size));
    grid-template-rows: repeat(8, var(--cell-size));
    gap: var(--grid-gap);
}

/* Cell States */
.board-cell {
    width: var(--cell-size);
    height: var(--cell-size);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.cell-default {
    background-color: rgba(15, 23, 42, 0.5);
    color: #475569;
    border: 2px solid #1e293b;
}

.cell-default:hover {
    border-color: #475569;
    background-color: rgba(30, 41, 59, 0.6);
}

.cell-hint {
    background-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.cell-hint:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.08);
}

.cell-selected {
    background-color: white;
    color: black;
    border: 2px solid white;
    transform: scale(1.1);
    z-index: 20;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.8);
}

.cell-found {
    background-color: rgba(15, 23, 42, 0.9);
    color: white;
    border: 2px solid currentColor;
    z-index: 10;
}

/* Step Badge */
.step-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: bold;
    border-radius: 50%;
    font-family: 'Orbitron', sans-serif;
}

.badge-selected {
    background-color: black;
    color: white;
    border: 2px solid white;
}

.badge-found {
    color: black;
}

/* Wave Animation for Found Words */
@keyframes waveSequence {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.25);
        filter: brightness(1.8);
        box-shadow: 0 0 25px currentColor;
    }
}

.cell-wave {
    animation: waveSequence 3s ease-in-out infinite;
}

/* Selection Bar */
.selection-bar {
    width: 100%;
    max-width: 500px;
    height: 4rem;
    background-color: rgba(15, 23, 42, 0.9);
    border: 1px solid #334155;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.selection-bar span {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.3em;
    color: white;
    z-index: 10;
}

.cursor-blink {
    animation: blink 1s infinite;
    color: var(--neon-cyan);
}

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

/* Controls */
.controls-panel {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Info Panel */
.info-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--neon-cyan);
    border-radius: 12px;
    padding: 1.25rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

.info-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* Stats */
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(100, 116, 139, 0.3);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    color: var(--neon-text-muted);
    font-weight: 500;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--neon-cyan);
}

/* Word List */
.word-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.3s;
    cursor: default;
}

.word-item span {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.word-default {
    color: #64748b;
}

.word-found {
    background-color: rgba(30, 41, 59, 0.6);
    border-color: #475569;
    transform: translateX(0.5rem);
    color: white;
}

.word-found:hover {
    background-color: rgba(51, 65, 85, 0.8);
    cursor: help;
}

.word-badge {
    font-size: 0.65rem;
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: black;
    font-family: 'Orbitron', sans-serif;
}

.word-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #334155;
}

/* Instructions */
.instructions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.instructions-list li {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    color: var(--neon-text-muted);
    padding: 0.4rem 0;
    padding-left: 1.25rem;
    position: relative;
    line-height: 1.5;
}

.instructions-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--neon-cyan);
    font-weight: bold;
}

/* Help Modal */
.help-text {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    color: var(--neon-text);
    text-align: center;
    margin-bottom: 1rem;
}

.help-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    text-align: center;
}

.help-list li {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    color: var(--neon-text-muted);
    padding: 0.5rem 0;
}

.help-example {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.help-example p {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    color: var(--neon-text-muted);
    margin: 0.5rem 0;
}

.example-moves {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    color: var(--neon-cyan);
    margin-top: 0.5rem;
}

.help-tip {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    color: var(--neon-yellow);
    text-align: center;
    margin-top: 1rem;
}

/* Victory Modal */
.victory-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.victory-stat {
    text-align: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--neon-cyan);
    border-radius: 8px;
}

.victory-label {
    display: block;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    color: var(--neon-text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.victory-value {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--neon-cyan);
}

.victory-message {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    color: var(--neon-text);
    text-align: center;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .modal-footer {
        flex-direction: row;
    }
}

/* Responsive */
@media (max-width: 640px) {
    :root {
        --cell-size: clamp(35px, 10vw, 45px);
    }

    .game-board {
        gap: 2px;
    }

    .board-container {
        padding: 0.5rem;
    }

    .selection-bar {
        height: 3rem;
    }

    .selection-bar span {
        font-size: 1.2rem;
    }

    .controls-panel {
        width: 100%;
    }

    .controls-panel button {
        flex: 1;
        min-width: 120px;
    }
}

/* Hint Flash Animation */
@keyframes hintFlash {
    0%, 100% {
        background-color: rgba(251, 191, 36, 0.2);
        border-color: var(--neon-yellow);
    }
    50% {
        background-color: rgba(251, 191, 36, 0.5);
        border-color: var(--neon-yellow);
        transform: scale(1.15);
        box-shadow: 0 0 25px rgba(251, 191, 36, 0.6);
    }
}

.cell-hint-flash {
    animation: hintFlash 1s ease-in-out 3;
}

/* Board Shake Animation */
@keyframes boardShake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5px, -5px); }
    20% { transform: translate(5px, 5px); }
    30% { transform: translate(-5px, 5px); }
    40% { transform: translate(5px, -5px); }
    50% { transform: translate(-5px, -5px); }
    60% { transform: translate(5px, 5px); }
    70% { transform: translate(-5px, 5px); }
    80% { transform: translate(5px, -5px); }
    90% { transform: translate(-5px, -5px); }
}

.board-shake {
    animation: boardShake 0.5s ease-in-out;
}
