/* 
   ====================================
   DESIGN TOKENS — DARK STYLISH THEME
   ====================================
*/
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-card: #141414;
    --text-primary: #e8e8e8;
    --text-secondary: #777777;
    --text-muted: #555555;

    --accent: #e5e5e5;
    --accent-dim: #a3a3a3;
    --accent-glow: rgba(255, 255, 255, 0.15);
    --accent-secondary: #d4d4d4;
    --accent-tertiary: #fafafa;

    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;

    --gradient-main: linear-gradient(135deg, #ffffff 0%, #a3a3a3 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    --glass: rgba(10, 10, 10, 0.85);

    --shadow-glow: 0 0 30px var(--accent-glow);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.6);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Poppins', sans-serif;

    --radius: 16px;
    --radius-sm: 10px;
    --radius-full: 9999px;
    --container-max: 1100px;
}

/* 
   ====================================
   RESET & BASE
   ====================================
*/
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* Dynamic scaling for various viewport sizes */
    font-size: 16px;
}

/* Small phones (320px and below) */
@media (max-width: 320px) {
    html { font-size: 13px; }
}

/* Standard phones */
@media (min-width: 321px) and (max-width: 480px) {
    html { font-size: 14px; }
}

/* Large phones / small tablets */
@media (min-width: 481px) and (max-width: 768px) {
    html { font-size: 15px; }
}

/* Tablets and small laptops */
@media (min-width: 769px) and (max-width: 1024px) {
    html { font-size: 16px; }
}

/* Large desktops */
@media (min-width: 1441px) and (max-width: 1920px) {
    html { font-size: 17px; }
}

/* Ultra-wide / TV screens (2K+) */
@media (min-width: 1921px) and (max-width: 2560px) {
    html { font-size: 20px; }
}

/* 4K TV screens */
@media (min-width: 2561px) {
    html { font-size: 24px; }
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    font-family: var(--font-heading);
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

.hidden {
    display: none !important;
}

/* 
   ====================================
   FALLING PATTERN BG
   ====================================
*/
.falling-pattern-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background-color: var(--bg-primary);
    pointer-events: none;
}

.falling-pattern-content {
    position: absolute;
    inset: -10% -10% -10% -10%;
    width: 120%;
    height: 120%;
    /* The backgroundImage and backgroundSize will be injected via JS */
    animation: linear-fall 150s linear infinite;
    transform: translateZ(0); /* Hardware Acceleration */
    will-change: background-position; /* Hint browser to optimize this repainted prop */
}

.falling-pattern-overlay {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(1em);
    -webkit-backdrop-filter: blur(1em);
    background-image: radial-gradient(circle at 50% 50%, transparent 0, transparent 2px, var(--bg-primary) 2px);
    background-size: 8px 8px;
    z-index: 1;
}

@keyframes linear-fall {
    0% {
        background-position: var(--start-pos);
    }
    100% {
        background-position: var(--end-pos);
    }
}



/* 
   ====================================
   NAVBAR
   ====================================
*/
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 18px 0;
    z-index: 1000;
    background: transparent;
    transition: all 0.35s ease;
}

nav.scrolled {
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.4rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 28px;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
    position: relative;
    padding-bottom: 4px;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

#theme-toggle {
    color: var(--text-secondary);
    font-size: 1rem;
    padding: 8px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s, color 0.3s;
}

#theme-toggle:hover {
    transform: rotate(30deg);
    color: var(--accent);
}

/* 
   ====================================
   HERO
   ====================================
*/
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
    background: radial-gradient(ellipse at 50% 0%, rgba(168, 85, 247, 0.08) 0%, transparent 60%);
}

#particles-js {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.glitch-text {
    font-size: clamp(2.4rem, 5.5vw, 4.2rem);
    font-weight: 800;
    margin-bottom: 16px;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px var(--accent-glow));
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 550px;
    margin-inline: auto;
}

.cta-button {
    display: inline-block;
    background: var(--gradient-main);
    color: #fff;
    padding: 16px 42px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: var(--shadow-glow);
}

.cta-button:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 8px 40px var(--accent-glow);
}

.cta-button span {
    position: relative;
    z-index: 2;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.6s ease;
    z-index: 1;
}

.cta-button:hover::before {
    left: 100%;
}

/* 
   ====================================
   SECTIONS
   ====================================
*/
section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    margin-bottom: 56px;
    color: var(--text-primary);
}

/* ABOUT */
.about {
    background: var(--bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    align-items: center;
}

.about-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.about-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}

.img-card {
    padding: 0;
    overflow: hidden;
    height: 360px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.kelas-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
}

.img-card:hover .kelas-photo {
    transform: scale(1.06);
    filter: brightness(1.08);
}

.photo-placeholder {
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.info-card h3 {
    font-size: 1.6rem;
    margin-bottom: 16px;
    color: var(--accent);
}

.class-stats {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.class-stats li {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1rem;
    color: var(--text-secondary);
}

.class-stats li strong {
    color: var(--text-primary);
}

.class-stats i {
    color: var(--accent-dim);
    width: 22px;
    text-align: center;
}

/* GALLERY */
.gallery {
    padding-top: 60px;
    padding-bottom: 60px;
    /* Container for 3D perspective */
    perspective: 1000px;
}

.gallery-header {
    text-align: center;
    margin-bottom: 56px;
    position: relative;
    z-index: 10;
}

.gallery-subtitle {
    color: var(--text-secondary);
    max-width: 600px;
    margin: -36px auto 0 auto;
    font-size: 1.05rem;
    line-height: 1.6;
}

/* 3D Scrolling Card Container (Replicates container-scroll-animation) */
.gallery-card-container {
    padding: 24px;
    background: var(--bg-secondary);
    border: 4px solid #6C6C6C;
    border-radius: 30px;
    box-shadow: 0 0 #0000004d, 0 9px 20px #0000004a, 0 37px 37px #00000042, 0 84px 50px #00000026, 0 149px 60px #0000000a, 0 233px 65px #00000003;
    /* Initial state for GSAP to animate from */
    transform: rotateX(20deg) scale(0.9) translateY(-20px);
    transform-origin: top center;
    will-change: transform;
}

.gallery-grid {
    column-count: 3;
    column-gap: 24px;
    border-radius: 20px;
    overflow: visible;
    background: transparent;
    padding: 12px 0;
}

@media (max-width: 992px) {
    .gallery-grid {
        column-count: 2;
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        column-count: 1;
    }
}

.gallery-item {
    background: var(--bg-card);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s ease;
    break-inside: avoid;
    margin-bottom: 24px;
    transform-origin: center center;
    transform: translateZ(0); 
}

.gallery-item:hover {
    transform: translateY(-10px) scale(1.02) rotate(1deg);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), 0 0 30px var(--accent-glow);
    z-index: 10;
    border-color: rgba(255, 255, 255, 0.3);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.7s ease;
    filter: sepia(0.2) hue-rotate(-10deg) saturate(0.85) brightness(0.9); 
}

.gallery-item:hover img {
    transform: scale(1.08);
    filter: sepia(0) hue-rotate(0deg) saturate(1.1) brightness(1.1);
}

/* Remove bento-grid classes */
.item-large, .item-tall, .item-wide {
    grid-column: auto;
    grid-row: auto;
}

/* FOOTER */
footer {
    background: var(--bg-secondary);
    padding: 48px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.credits {
    color: var(--text-muted);
    margin-top: 8px;
    font-size: 0.8rem;
}

/* 
   ====================================
   MODAL & GAMES MENU
   ====================================
*/
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-primary);
    padding: 44px;
    border-radius: var(--radius);
    max-width: 860px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 60px rgba(168, 85, 247, 0.15);
    transform: scale(0.92);
    transition: transform 0.3s ease;
}

.modal-overlay:not(.hidden) .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 18px;
    right: 18px;
    font-size: 1.4rem;
    color: var(--text-muted);
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--danger);
}

.games-menu h2 {
    text-align: center;
    margin-bottom: 36px;
    font-size: 2rem;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.game-card {
    background: var(--bg-card);
    padding: 28px;
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.35s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.game-card:hover {
    border-color: var(--accent);
    transform: translateY(-6px);
    box-shadow: var(--shadow-glow);
}

.game-card h3 {
    font-size: 1.15rem;
}

.game-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.game-icon {
    font-size: 2.6rem;
    color: var(--accent);
}

/* 
   ====================================
   GAME CONTAINER (FULLSCREEN)
   ====================================
*/
.game-container {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 3000;
    display: flex;
    flex-direction: column;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

.game-header h2 {
    font-size: 1.2rem;
}

.back-to-menu {
    color: var(--text-primary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    transition: background 0.3s;
}

.back-to-menu:hover {
    background: var(--danger);
}

.score-display {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.game-body {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* 
   ====================================
   BUTTONS (PREMIUM MONOCHROME)
   ====================================
*/
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 700;
    padding: 14px 28px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn:active {
    transform: scale(0.94);
}

.btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

/* Primary Variants */
.btn-primary {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
}
.btn-primary:hover {
    background-color: #ffffff;
    box-shadow: 0 6px 25px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #ffffff;
    transform: translateY(-2px);
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Game Colored Buttons mapped to Monochrome */
.btn-warning {
    background-color: #a3a3a3;
    color: #000;
}
.btn-warning:hover {
    background-color: #d4d4d4;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: #333333;
    border: 2px solid #555;
    color: #fff;
}
.btn-danger:hover {
    background-color: #444444;
    border-color: #777;
    transform: translateY(-2px);
}

.btn-dark {
    background-color: #111111;
    border: 2px solid #333;
    color: #a3a3a3;
}
.btn-dark:hover {
    background-color: #1a1a1a;
    color: #fff;
    border-color: #555;
    transform: translateY(-2px);
}

/* Sizes */
.btn-sm-sz {
    padding: 8px 18px;
    font-size: 0.9rem;
}
.btn-lg-sz {
    padding: 18px 36px;
    font-size: 1.15rem;
}
.btn-default-sz {
    padding: 14px 28px;
}

/* 
   ====================================
   WORDLE SPECIFIC
   ====================================
*/
.wordle-body {
    flex-direction: column !important;
    gap: 20px;
    padding: 16px !important;
    overflow-y: auto !important;
}

#wordle-board-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#wordle-keyboard-container {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
}

/* 
   ====================================
   SOCCER SPECIFIC
   ====================================
*/
.soccer-body {
    padding: 0 !important;
    position: relative;
}

.soccer-ui-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    z-index: 10;
    padding: 24px;
}

.team-selection {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.player-col {
    text-align: center;
}

.player-col h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.player-col p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.vs-badge {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
}

.fancy-select {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1rem;
    font-family: var(--font-body);
}

.match-settings {
    text-align: center;
}

.match-settings label {
    color: var(--text-secondary);
    margin-right: 10px;
}

#soccer-canvas-container {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

#soccer-canvas-container canvas {
    display: block;
}

#soccer-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 12px 20px;
    z-index: 20;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent);
    pointer-events: none;
}

.score-board {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 4px;
}

.timer {
    font-size: 1.2rem;
    color: var(--accent);
    font-weight: 600;
}

#goal-announcement {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent);
    text-shadow: 0 0 40px var(--accent-glow);
    z-index: 30;
}

.final-score {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: 3px;
}

.soccer-actions {
    display: flex;
    gap: 16px;
}

/* On-screen Joystick */
.joystick-zone {
    position: absolute;
    bottom: 20px;
    z-index: 50;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.1);
    touch-action: none;
}

.joystick-zone.left {
    left: 24px;
}

.joystick-zone.right {
    right: 24px;
}

.joystick-knob {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid var(--accent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: none;
}

.kick-btn {
    position: absolute;
    bottom: 160px;
    z-index: 50;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.4);
    border: 2px solid var(--danger);
    color: #fff;
    font-weight: 800;
    font-size: 0.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
}

.kick-btn.left {
    left: 130px;
}

.kick-btn.right {
    right: 130px;
}

/* 
   ====================================
   RESPONSIVE
   ====================================
*/
@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .img-card {
        height: 260px;
    }

    .nav-links {
        gap: 16px;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .game-header {
        padding: 12px 16px;
    }

    .team-selection {
        flex-direction: column;
    }

    .vs-badge {
        font-size: 1.4rem;
    }

    .modal-content {
        padding: 28px 20px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    .item-large, .item-tall, .item-wide {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* 
   ====================================
   GAMES 3D & PRO MAX DESIGN
   ====================================
*/
.game-card-3d {
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md, 20px);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: perspective(1000px) translateZ(0);
    position: relative;
    overflow: hidden;
}

.game-card-3d::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.game-card-3d:hover {
    transform: perspective(1000px) translateY(-12px) rotateX(10deg) scale(1.03);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8), 0 0 25px var(--accent-glow);
    border-color: rgba(255, 255, 255, 0.3);
    z-index: 10;
}

.game-card-3d:hover::before {
    opacity: 1;
}

.game-card-3d.correct {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--success);
    box-shadow: 0 0 40px rgba(34, 197, 94, 0.3);
}

.game-card-3d.wrong {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.3);
}

.teacher-img-3d {
    width: 280px; 
    height: 280px;
    border-radius: 20px;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: perspective(1000px) rotateY(-8deg) rotateX(4deg);
    filter: drop-shadow(0 0 20px rgba(255,255,255,0.05));
}

.teacher-img-3d:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg) scale(1.08);
}

.countdown-3d {
    font-size: clamp(5rem, 15vw, 8rem);
    font-weight: 900; 
    color: transparent;
    -webkit-text-stroke: 2px var(--accent);
    text-shadow: 0 10px 40px var(--accent-glow);
    animation: popIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) infinite alternate;
}

@keyframes popIn {
    0% { transform: scale(0.85) translateZ(-50px); opacity: 0; }
    100% { transform: scale(1) translateZ(0); opacity: 1; filter: drop-shadow(0 0 10px var(--accent-glow)); }
}

.glass-panel {
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 30px;
}

/* Reflex Virtual Numpad */
.numpad-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 400px;
}

.numpad-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 18px 0;
    color: var(--text-primary);
    font-size: 1.6rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.numpad-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.numpad-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.15);
}

.numpad-del {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.reflex-input-display {
    padding: 18px;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 6px;
    text-align: center;
    border-radius: var(--radius-md);
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
    min-height: 80px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 4px 15px rgba(0, 0, 0, 0.5);
}

.reflex-caret {
    display: inline-block;
    width: 3px;
    height: 35px;
    background-color: var(--accent);
    animation: blink 1s step-end infinite;
    margin-left: 4px;
}

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

/* ====================================
   RESPONSIVE: MOBILE PHONES
   ==================================== */
@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .img-card {
        height: 220px;
    }

    section {
        padding: 60px 0;
    }

    .hero {
        padding-top: 60px;
        min-height: 80vh;
    }

    .nav-links a {
        display: none;
    }

    .modal-content {
        padding: 24px;
        width: 96%;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

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

/* ====================================
   RESPONSIVE: TV / LARGE SCREENS (2K+)
   ==================================== */
@media (min-width: 1921px) {
    .container {
        max-width: 1600px;
    }

    .about-grid {
        gap: 60px;
    }

    .img-card {
        height: 500px;
    }

    .gallery-grid {
        column-count: 4;
        column-gap: 36px;
    }

    .modal-content {
        max-width: 1200px;
    }

    footer {
        padding: 80px 0;
    }
}

/* 4K TV */
@media (min-width: 2561px) {
    .container {
        max-width: 2200px;
    }

    .gallery-grid {
        column-count: 5;
    }

    .hero {
        min-height: 60vh;
    }
}