/* ============================================
   CYBER GAMES — Styling
   ============================================ */

/* ── Scoreboard ── */
.games-scoreboard {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    padding: 16px 24px;
    background: rgba(var(--accent-rgb), 0.04);
    border: 1px solid rgba(var(--accent-rgb), 0.15);
    border-radius: 12px;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 14px;
    color: var(--text-secondary);
}

.score-item i {
    color: var(--accent);
    font-size: 18px;
}

.score-item strong {
    color: var(--accent);
    font-size: 18px;
}

.btn-sm {
    padding: 8px 16px !important;
    font-size: 12px !important;
    margin-left: auto;
}

/* ── Games Grid ── */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
}

/* ── Game Card ── */
.game-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    border-color: rgba(var(--accent-rgb), 0.2);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25), 0 0 25px rgba(var(--accent-rgb), 0.05);
    transform: translateY(-4px);
}

.game-completed {
    border-color: rgba(var(--accent-rgb), 0.3) !important;
    box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.08) !important;
}

.game-completed::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.game-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px 0;
}

.game-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.15), rgba(var(--accent2-rgb), 0.08));
    border-radius: 12px;
    font-size: 18px;
    color: var(--accent);
    flex-shrink: 0;
}

.game-meta {
    flex: 1;
}

.game-meta h3 {
    font-size: 17px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.game-difficulty {
    font-family: var(--font-heading);
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 50px;
    display: inline-block;
}

.diff-easy {
    color: #00ff88;
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.diff-medium {
    color: #ffaa00;
    background: rgba(255, 170, 0, 0.08);
    border: 1px solid rgba(255, 170, 0, 0.2);
}

.diff-hard {
    color: #ff4466;
    background: rgba(255, 68, 102, 0.08);
    border: 1px solid rgba(255, 68, 102, 0.2);
}

.game-status {
    font-size: 20px;
    color: var(--text-secondary);
    opacity: 0.4;
}

.game-completed .game-status {
    opacity: 1;
}

.game-desc {
    padding: 12px 24px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

/* ── Game Terminal ── */
.game-terminal {
    margin: 0 16px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.3);
}

.game-terminal-header {
    background: rgba(255, 255, 255, 0.04);
    padding: 8px 14px;
    font-family: var(--font-heading);
    font-size: 11px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-terminal-header::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
}

.game-terminal-body {
    padding: 16px;
}

/* ── Form Styles inside games ── */
.fake-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fake-form label,
.cipher-display label,
.binary-display label {
    font-family: var(--font-heading);
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.fake-form input,
.cipher-display input[type="text"],
.binary-display input,
.xss-app input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
    width: 100%;
}

.fake-form input:focus,
.cipher-display input:focus,
.binary-display input:focus,
.xss-app input:focus {
    border-color: rgba(var(--accent-rgb), 0.5);
    box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.1);
}

/* ── SQL Query Preview ── */
.game-query-preview {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(var(--accent-rgb), 0.1);
    border-radius: 6px;
    padding: 10px 12px;
    margin-top: 8px;
    font-family: var(--font-heading);
    font-size: 12px;
    overflow-x: auto;
}

.query-label {
    color: var(--text-secondary);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 4px;
}

.game-query-preview code {
    color: var(--accent2);
    word-break: break-all;
}

/* ── Game Button ── */
.btn-game {
    background: rgba(var(--accent-rgb), 0.1);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    color: var(--accent);
    padding: 10px 20px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    width: 100%;
}

.btn-game:hover {
    background: rgba(var(--accent-rgb), 0.2);
    box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.2);
    transform: translateY(-1px);
}

.btn-game:active {
    transform: translateY(0);
}

/* ── Phishing Buttons ── */
.phishing-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.btn-legit {
    border-color: rgba(0, 255, 136, 0.3);
    color: #00ff88;
    background: rgba(0, 255, 136, 0.06);
}

.btn-legit:hover {
    background: rgba(0, 255, 136, 0.15);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.btn-phish {
    border-color: rgba(255, 68, 102, 0.3);
    color: #ff4466;
    background: rgba(255, 68, 102, 0.06);
}

.btn-phish:hover {
    background: rgba(255, 68, 102, 0.15);
    box-shadow: 0 0 15px rgba(255, 68, 102, 0.2);
}

.phishing-progress {
    font-family: var(--font-heading);
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.phishing-url {
    font-family: var(--font-heading);
    font-size: 14px;
    color: var(--accent2);
    background: rgba(0, 0, 0, 0.3);
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    word-break: break-all;
    transition: all 0.3s ease;
    user-select: none;
}

.flash-green {
    background: rgba(0, 255, 136, 0.15) !important;
    border-color: rgba(0, 255, 136, 0.4) !important;
}

.flash-red {
    background: rgba(255, 68, 102, 0.15) !important;
    border-color: rgba(255, 68, 102, 0.4) !important;
}

/* ── Hash Options ── */
.hash-display {
    font-family: var(--font-heading);
    font-size: 12px;
    color: var(--accent2);
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    word-break: break-all;
    margin-bottom: 12px;
    line-height: 1.5;
}

.hash-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn-hash-option {
    width: 100%;
}

.btn-correct {
    background: rgba(0, 255, 136, 0.2) !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.2);
}

.btn-wrong {
    background: rgba(255, 68, 102, 0.2) !important;
    border-color: #ff4466 !important;
    color: #ff4466 !important;
}

/* ── Caesar Cipher ── */
.cipher-display {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cipher-label {
    font-family: var(--font-heading);
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cipher-text {
    font-family: var(--font-heading);
    font-size: 16px;
    color: #ff6b6b;
    letter-spacing: 3px;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 107, 107, 0.15);
    text-align: center;
}

.cipher-result {
    font-family: var(--font-heading);
    font-size: 16px;
    color: var(--accent);
    letter-spacing: 3px;
    background: rgba(var(--accent-rgb), 0.04);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid rgba(var(--accent-rgb), 0.15);
    text-align: center;
    min-height: 44px;
}

.cipher-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.cipher-controls input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

.cipher-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.5);
    cursor: pointer;
}

.shift-value {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--accent);
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

/* ── XSS Playground ── */
.xss-app {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.xss-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

.xss-url {
    padding: 10px 4px 10px 12px;
    font-family: var(--font-heading);
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.xss-bar input {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 10px 12px;
}

.xss-preview {
    background: rgba(0, 0, 0, 0.3);
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 14px;
    color: var(--text-secondary);
    min-height: 48px;
    position: relative;
}

.xss-preview span {
    color: var(--accent2);
}

/* Fake Alert Box */
.fake-alert {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    animation: fadeIn 0.3s ease;
}

.fake-alert-box {
    background: var(--bg-secondary);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 20px 30px;
    text-align: center;
    box-shadow: 0 0 40px rgba(var(--accent-rgb), 0.3);
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fake-alert-header {
    font-family: var(--font-heading);
    font-size: 13px;
    color: #ffaa00;
    margin-bottom: 10px;
}

.fake-alert-box p {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.fake-alert-box button {
    background: var(--accent);
    color: var(--bg-color);
    border: none;
    padding: 8px 32px;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── Binary Display ── */
.binary-display {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.binary-text {
    font-family: var(--font-heading);
    font-size: 13px;
    color: var(--accent2);
    background: rgba(0, 0, 0, 0.3);
    padding: 14px;
    border-radius: 8px;
    border: 1px solid rgba(var(--accent2-rgb), 0.12);
    word-break: break-all;
    letter-spacing: 1px;
    line-height: 1.8;
}

/* ── Feedback ── */
.game-feedback {
    display: none;
    margin-top: 12px;
    padding: 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    animation: fadeIn 0.3s ease;
}

.feedback-success {
    background: rgba(0, 255, 136, 0.06);
    border: 1px solid rgba(0, 255, 136, 0.2);
    color: var(--text-primary);
}

.feedback-success i:first-child {
    color: var(--accent);
}

.feedback-error {
    background: rgba(255, 68, 102, 0.06);
    border: 1px solid rgba(255, 68, 102, 0.2);
    color: var(--text-primary);
}

.feedback-error i:first-child {
    color: #ff4466;
}

.feedback-detail {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.feedback-detail strong {
    color: var(--accent);
}

/* ── Hints ── */
.game-hint-wrap {
    padding: 12px 24px 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.btn-hint {
    background: none;
    border: 1px solid rgba(255, 170, 0, 0.2);
    color: #ffaa00;
    padding: 5px 12px;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-hint:hover {
    background: rgba(255, 170, 0, 0.08);
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.1);
}

.btn-hint i {
    margin-right: 4px;
}

.game-hint {
    font-family: var(--font-heading);
    font-size: 12px;
    color: #ffaa00;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    line-height: 1.6;
}

.game-hint.hint-visible {
    opacity: 0.8;
    max-height: 100px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: 1fr;
    }

    .games-scoreboard {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .btn-sm {
        margin-left: 0;
        width: 100%;
    }

    .xss-url {
        display: none;
    }

    .cipher-controls {
        flex-wrap: wrap;
    }

    .phishing-buttons {
        grid-template-columns: 1fr;
    }
}
