/* --- RESET & FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;500;700&family=VT323&display=swap');

:root {
    --neon-green: #39ff14;
    --neon-yellow: #b8ff14;
    --neon-red: #ff003c;
    --dark-bg: #050505;
    --panel-bg: rgba(20, 20, 20, 0.8);
    --border-color: #333;
    --text-color: #e0e0e0;
}

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

body {
    background-color: var(--dark-bg);
    color: var(--text-color);
    font-family: 'Rajdhani', sans-serif;
    background-image: 
        linear-gradient(rgba(57, 255, 20, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(57, 255, 20, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
}

h1, h2, h3, h4 { font-family: 'Orbitron', sans-serif; text-transform: uppercase; color: white; }

/* --- HEADER --- */
header {
    text-align: center;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(5,5,5,0.9) 100%);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

header h1 { font-size: 2.5rem; color: var(--neon-green); text-shadow: 0 0 15px rgba(57, 255, 20, 0.5); }
header p { font-size: 1.2rem; color: #aaa; margin-top: 10px; }

/* --- LAYOUT --- */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
}

/* --- SIDEBAR: INPUT LEGEND --- */
.sidebar {
    position: sticky;
    top: 150px;
    height: fit-content;
}

.legend-card {
    background: var(--panel-bg);
    border: 1px solid var(--neon-green);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.1);
}

.legend-card h3 { color: var(--neon-green); margin-bottom: 15px; font-size: 1.2rem; border-bottom: 1px solid #333; padding-bottom: 10px; }

.legend-list { list-style: none; }
.legend-item { display: flex; margin-bottom: 12px; font-size: 1.1rem; }
.legend-key { 
    font-family: 'Orbitron', sans-serif; 
    color: black; 
    background: var(--neon-green); 
    padding: 2px 8px; 
    border-radius: 4px; 
    font-weight: bold; 
    min-width: 45px; 
    text-align: center; 
    margin-right: 15px; 
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.4);
    
    display: flex;
    justify-content: center; /* Centers horizontally */
    align-items: center;     /* Centers vertically */
    height: fit-content;     /* Stops it from stretching if the text next to it is long */
}
.legend-desc { color: #ccc; line-height: 1.4; }
.legend-note { font-size: 0.9rem; color: #888; margin-top: 20px; padding-top: 15px; border-top: 1px dashed #333; }

/* --- MAIN CONTENT: TABS & DATA --- */
.tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    color: #888;
    padding: 12px 25px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.3s;
}

.tab-btn:hover { border-color: var(--neon-green); color: white; }
.tab-btn.active { 
    background: rgba(57, 255, 20, 0.1); 
    border-color: var(--neon-green); 
    color: var(--neon-green); 
    box-shadow: inset 0 0 15px rgba(57, 255, 20, 0.2); 
}

/* Generated Sections */
.watch-section { display: none; animation: fadeIn 0.4s ease; }
.watch-section.active { display: block; }

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

.mode-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 30px;
    overflow: hidden;
}

.mode-header {
    background: rgba(0,0,0,0.6);
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}
.mode-header h2 { font-size: 1.8rem; color: white; margin-bottom: 10px; }
.mode-header p { color: #aaa; font-size: 1.1rem; }

.commands-table {
    width: 100%;
    border-collapse: collapse;
}

.commands-table th, .commands-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #222;
}

.commands-table th { font-family: 'Orbitron', sans-serif; color: #888; background: #0a0a0a; text-transform: uppercase; font-size: 0.9rem; }
.commands-table tr:hover { background: rgba(57, 255, 20, 0.05); }
.commands-table tr:last-child td { border-bottom: none; }

.cmd-input { 
    font-family: 'Orbitron', sans-serif; 
    color: var(--neon-yellow); 
    font-weight: bold; 
    font-size: 1.1rem; 
    white-space: normal; 
    word-break: break-word; 
    transition: color 0.3s ease; 
}
.cmd-action { font-size: 1.2rem; font-weight: bold; color: white; margin-bottom: 5px; display: flex; align-items: center; gap: 10px; }
.cmd-desc { color: #999; font-size: 1rem; }

/* --- CHEAT CODE STYLES --- */
.cheat-locked {
    color: black !important;
    background-color: black;
    cursor: pointer;
    border-radius: 4px;
    user-select: none;
    position: relative;
    padding: 5px 10px;
    display: inline-block;
}
.cheat-locked:hover {
    box-shadow: 0 0 8px rgba(255, 0, 60, 0.5);
}
.cheat-locked::after {
    content: "CLICK TO DECRYPT";
    color: #444;
    font-size: 0.8rem;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}
.cheat-tag {
    background-color: var(--neon-red);
    color: white;
    font-size: 0.7rem;
    padding: 3px 6px;
    border-radius: 4px;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    box-shadow: 0 0 5px var(--neon-red);
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .container { grid-template-columns: 1fr; }
    .sidebar { position: relative; top: 0; margin-bottom: 30px; }
    .commands-table th, .commands-table td { padding: 10px; }
    .cmd-input { font-size: 1rem; }
    .cheat-locked::after { font-size: 0.6rem; }
}

/* --- PRACTICE MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--dark-bg);
    border: 2px solid var(--neon-green);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    position: relative;
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.2);
    animation: fadeIn 0.3s ease;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    color: var(--neon-red);
    font-size: 2rem;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    transition: 0.3s;
}

.close-modal:hover {
    text-shadow: 0 0 10px var(--neon-red);
}

#practice-message {
    font-family: 'Orbitron', sans-serif;
    color: var(--neon-yellow);
    font-size: 2.5rem;
    height: 50px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(184, 255, 20, 0.5);
}

.watch-face {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: #111;
    border: 4px solid #333;
    position: relative;
    margin: 0 auto;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 0 15px rgba(57, 255, 20, 0.1);
}

.tap-zone {
    position: absolute;
    width: 50px;
    height: 50px;
    background: rgba(57, 255, 20, 0.1);
    border: 1px dashed var(--neon-green);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.1s;
}

.tap-zone:active {
    background: var(--neon-green);
    box-shadow: 0 0 15px var(--neon-green);
    transform: scale(0.9);
}

.zone-c { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.zone-u { top: 10px; left: 50%; transform: translateX(-50%); }
.zone-d { bottom: 10px; left: 50%; transform: translateX(-50%); }
.zone-l { top: 50%; left: 10px; transform: translateY(-50%); }
.zone-r { top: 50%; right: 10px; transform: translateY(-50%); }

#practice-btn {
    width: 100%;
    margin-top: 20px;
    text-align: center;
    display: block;
}
/* --- PRACTICE MODAL REBUILT --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--dark-bg);
    border: 2px solid var(--neon-green);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    position: relative;
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.2);
    animation: fadeIn 0.3s ease;
    max-width: 90%;
    width: 400px;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    color: var(--neon-red);
    font-size: 2rem;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    transition: 0.3s;
}

.close-modal:hover { text-shadow: 0 0 10px var(--neon-red); }

#practice-message {
    font-family: 'Orbitron', sans-serif;
    color: var(--neon-yellow);
    font-size: 2.5rem;
    height: 40px;
    margin-bottom: 5px;
    text-shadow: 0 0 10px rgba(184, 255, 20, 0.5);
    transition: color 0.1s;
}

#practice-history {
    font-family: 'Orbitron', sans-serif;
    color: #888;
    font-size: 1rem;
    height: 20px;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.watch-face {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, #222 0%, #0a0a0a 100%);
    border: 4px solid #333;
    position: relative;
    margin: 0 auto;
    box-shadow: inset 0 0 30px rgba(0,0,0,1), 0 0 15px rgba(57, 255, 20, 0.1);
    cursor: crosshair;
    overflow: hidden; /* Contains the ripple */
    touch-action: manipulation; /* Prevents double-tap zooming on mobile */
}

/* Visual guidelines for the user */
.watch-face::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 40%; height: 40%;
    border-radius: 50%;
    border: 1px dashed rgba(255,255,255,0.1);
    pointer-events: none;
}

/* Ripple Animation */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(57, 255, 20, 0.6);
    transform: scale(0);
    animation: ripple-anim 0.4s linear;
    pointer-events: none;
}

@keyframes ripple-anim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

#practice-btn {
    width: 100%;
    margin-top: 20px;
    text-align: center;
    display: block;
}
/* --- PRACTICE MODAL REBUILT --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--dark-bg);
    border: 2px solid var(--neon-green);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    position: relative;
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.2);
    animation: fadeIn 0.3s ease;
    max-width: 90%;
    width: 400px;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    color: var(--neon-red);
    font-size: 2rem;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    transition: 0.3s;
}

.close-modal:hover { text-shadow: 0 0 10px var(--neon-red); }

#practice-message {
    font-family: 'Orbitron', sans-serif;
    color: var(--neon-yellow);
    font-size: 2.5rem;
    height: 40px;
    margin-bottom: 5px;
    text-shadow: 0 0 10px rgba(184, 255, 20, 0.5);
    transition: color 0.1s;
}

#practice-history {
    font-family: 'Orbitron', sans-serif;
    color: #888;
    font-size: 1rem;
    height: 20px;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.watch-face {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, #222 0%, #0a0a0a 100%);
    border: 4px solid #333;
    position: relative;
    margin: 0 auto;
    box-shadow: inset 0 0 30px rgba(0,0,0,1), 0 0 15px rgba(57, 255, 20, 0.1);
}

.tap-zone {
    position: absolute;
    width: 50px;
    height: 50px;
    background: rgba(57, 255, 20, 0.1);
    border: 1px dashed var(--neon-green);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.1s, transform 0.1s;
    overflow: hidden; /* Keeps the ripple inside the circle */
    /* Prevents double-tap zooming on mobile */
    touch-action: manipulation; 
}

.tap-zone:active {
    background: var(--neon-green);
    box-shadow: 0 0 15px var(--neon-green);
    transform: scale(0.9);
}

.zone-c { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.zone-u { top: 10px; left: 50%; transform: translateX(-50%); }
.zone-d { bottom: 10px; left: 50%; transform: translateX(-50%); }
.zone-l { top: 50%; left: 10px; transform: translateY(-50%); }
.zone-r { top: 50%; right: 10px; transform: translateY(-50%); }

/* Ripple Animation */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    transform: scale(0);
    animation: ripple-anim 0.3s linear;
    pointer-events: none; /* Ensures the ripple doesn't block the next click */
}

@keyframes ripple-anim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

#practice-btn {
    width: 100%;
    margin-top: 20px;
    text-align: center;
    display: block;
}