@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Nunito:wght@500;700&family=Barriecito&display=swap');

:root {
    --bg: #0b1222;
    --card: rgba(14, 21, 42, 0.78);
    --grid: rgba(255, 255, 255, 0.04);
    --accent: #5de5ff;
    --accent-2: #7bf772;
    --accent-3: #ffde59;
    --text: #e8f2ff;
}

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

body {
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background:
        radial-gradient(140% 140% at 20% 20%, #1a2955 0%, transparent 40%),
        radial-gradient(120% 120% at 80% 0%, #0e1d38 0%, transparent 35%),
        linear-gradient(135deg, #0b1222 0%, #0f1a36 50%, #0d192f 100%);
    min-height: 100vh;
    position: relative;
    padding: 30px;
}
body::before {
    content: "";
    position: fixed; inset: 0;
    background-image:
        linear-gradient(90deg, var(--grid) 1px, transparent 1px),
        linear-gradient(var(--grid) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--card);
    border: 3px solid var(--accent);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.55), 0 0 0 8px rgba(93,229,255,0.08);
    overflow: hidden;
}

header {
    text-align: center;
    padding:10px;
}
header h1 {
    font-family: 'Barriecito', 'Press Start 2P', cursive;
    color: #ffde59;
    text-shadow: 0 4px 0 #0c1127, 0 8px 20px rgba(0,0,0,0.45);
    letter-spacing: 2px;
}

header.profile-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    background: linear-gradient(120deg, #142857 0%, #1f7eff 40%, #31f7a1 100%);
    border-bottom: 4px solid var(--accent-3);
    box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}
.profile-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.profile-name {
    font-family: 'Barriecito', 'Press Start 2P', cursive;
    color: #ffde59;
    font-size: 1rem;
    letter-spacing: 1px;
    text-shadow: 0 3px 0 #0c1127, 0 6px 18px rgba(0,0,0,0.35);
}
.profile-status {
    color: #0b1222;
    font-weight: 800;
}

main {
    display: flex;
    justify-content: center;
    padding: 30px;
}

.welcome-message {
    width: 100%;
    text-align: center;

    position: relative;
    overflow: hidden;
}
.welcome-message::after {
    content: "";
    position: absolute;
    inset: -30% -10% auto auto;
    width: 220px; height: 220px;
    transform: rotate(12deg);
    pointer-events: none;
}
.welcome-message h2 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.1rem;
    letter-spacing: 1px;
    color: var(--accent-3);
    margin-bottom: 18px;
    text-transform: uppercase;
}
.welcome-message p {
    font-size: 1.05rem;
    color: #d5e7ff;
    margin-bottom: 28px;
    font-weight: 700;
}

/* HUD */
.hud {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.hud-card {
    background: rgba(10, 17, 35, 0.8);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 12px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.75rem;
    color: var(--accent-3);
    box-shadow: 0 10px 0 #0c1127, 0 14px 32px rgba(0,0,0,0.45);
    text-transform: uppercase;
}
.hud-card.xp { color: var(--accent); }
.xp-bar {
    margin-top: 10px;
    height: 10px;
    background: #0c132a;
    border-radius: 6px;
    border: 1px solid var(--accent);
    overflow: hidden;
}
.xp-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 10px rgba(93,229,255,0.7);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin: 24px 0 32px 0;
}
.hero-cta {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr;
    gap: 16px;
    align-items: center;
    padding: 20px;
    border: 2px solid var(--accent);
    border-radius: 14px;
    background: linear-gradient(120deg, rgba(93,229,255,0.18), rgba(136,255,163,0.16)), rgba(9,16,35,0.7);
    box-shadow: 0 12px 0 #0c1127, 0 16px 32px rgba(0,0,0,0.4);
    margin-bottom: 16px;
}
.hero-cta h2 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.1rem;
    color: var(--accent-3);
    margin: 6px 0 10px 0;
}
.hero-cta .sub {
    color: #d5e7ff;
    font-weight: 800;
    margin-bottom: 10px;
}
.hero-cta .eyebrow {
    color: var(--accent);
    font-weight: 900;
    letter-spacing: 1px;
    font-size: 0.8rem;
}
.hero-badge {
    justify-self: end;
    background: rgba(12,22,46,0.9);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 8px 0 #0c1127;
    text-align: center;
    color: #e8f2ff;
    font-weight: 800;
}
.hero-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    background: linear-gradient(90deg, #ffde59, #ff7a1f);
    color: #0b1222;
    font-weight: 900;
    margin-bottom: 6px;
}
.feature {
    background: rgba(12, 22, 46, 0.9);
    padding: 24px;
    border-radius: 12px;
    border: 2px solid #2f4fe0;
    box-shadow: 0 10px 0 #0c1127, 0 12px 30px rgba(0,0,0,0.45);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 60%, rgba(255,255,255,0.08));
    pointer-events: none;
}
.feature:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 14px 0 #0c1127, 0 18px 40px rgba(0,0,0,0.5);
}
.feature .icon {
    font-size: 2.4rem;
    display: block;
    margin-bottom: 14px;
    filter: drop-shadow(0 4px 8px rgba(93,229,255,0.45));
}
.feature h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    color: var(--accent-3);
    margin-bottom: 8px;
    font-weight: 800;
}
.feature p {
    color: #c7d9ff;
    font-size: 1.02rem;
    line-height: 1.5;
    font-weight: 700;
}

/* Button */
.start-btn {
    background: linear-gradient(90deg, #ffde59 0%, #ff7a1f 100%);
    color: #0b1222;
    border: 3px solid #ffffff;
    padding: 16px 42px;
    font-size: 0.85rem;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 12px 0 #c65300, 0 16px 40px rgba(0,0,0,0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.start-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 0 #a84400, 0 20px 45px rgba(0,0,0,0.55);
}
.start-btn.small {
    font-size: 0.75rem;
    padding: 12px 24px;
    box-shadow: 0 10px 0 #c65300, 0 14px 32px rgba(0,0,0,0.45);
}

/* Flow steps */
.flow {
    margin: 28px 0 16px 0;
}
.flow h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.95rem;
    color: var(--accent-3);
    margin-bottom: 12px;
    letter-spacing: 1px;
    font-weight: 800;
}
.flow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.step-card {
    background: rgba(12, 22, 46, 0.9);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 14px 12px;
    box-shadow: 0 10px 0 #0c1127, 0 14px 28px rgba(0,0,0,0.45);
    text-align: left;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
}
.step-number {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0b1222;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    display: grid;
    place-items: center;
    box-shadow: 0 6px 0 #0c1127;
}
.step-card p {
    margin: 0;
    color: #d5e7ff;
    font-weight: 800;
    font-size: 1.02rem;
}

/* Avatars */
.avatars {
    margin: 26px 0 12px 0;
    text-align: left;
}
.avatars h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.95rem;
    color: var(--accent-3);
    margin-bottom: 12px;
    font-weight: 800;
}
.avatar-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}
.avatar-slot {
    background: linear-gradient(135deg, rgba(93,229,255,0.28), rgba(136,255,163,0.24));
    border: 2px dashed var(--accent);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 10px 0 #0c1127, 0 12px 24px rgba(0,0,0,0.45);
    display: grid;
    place-items: center;
}
.avatar-slot img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    background: #0c132a;
}
.note {
    margin-top: 10px;
    color: #c7d9ff;
    font-size: 0.95rem;
}

/* Games */
.games {
    margin: 26px 0 12px 0;
    text-align: left;
}
.games h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.95rem;
    color: var(--accent-3);
    margin-bottom: 12px;
    font-weight: 800;
}
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.game-card {
    padding: 18px;
    border-radius: 12px;
    border: 2px solid var(--accent);
    background: rgba(12, 22, 46, 0.92);
    box-shadow: 0 10px 0 #0c1127, 0 14px 28px rgba(0,0,0,0.45);
}
.game-card h4 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.85rem;
    color: var(--accent-3);
    margin-bottom: 8px;
    font-weight: 800;
}
.game-card p {
    color: #d5e7ff;
    font-size: 1.02rem;
    line-height: 1.5;
    font-weight: 700;
}
.game-card.quiz { border-color: #5de5ff; }
.game-card.platform { border-color: #7bf772; }

/* Points */
.points {
    margin: 18px 0 0 0;
    text-align: left;
}
.points h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.95rem;
    color: var(--accent-3);
    margin-bottom: 10px;
    font-weight: 800;
}
.points ul {
    list-style: none;
    padding: 0;
}
.points li {
    margin-bottom: 8px;
    color: #c7d9ff;
    padding-left: 18px;
    position: relative;
    font-weight: 800;
    font-size: 1.02rem;
}
.points li::before {
    content: "★";
    position: absolute;
    left: 0;
    color: var(--accent-3);
}

/* Auth form */
.auth {
    margin: 26px 0 18px 0;
    text-align: left;
}
.auth-tabs {
    display: grid;
    gap: 12px;
}
.auth-tab-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
}
.auth-tab {
    background: #0c132a;
    border: 2px solid var(--accent);
    border-radius: 10px;
    padding: 10px;
    color: #e8f2ff;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.75rem;
    cursor: pointer;
    box-shadow: 0 8px 0 #0c1127;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.auth-tab.active {
    border-color: var(--accent-3);
    box-shadow: 0 10px 0 #0c1127, 0 0 0 3px rgba(255,222,89,0.4);
}
.auth h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.95rem;
    color: var(--accent-3);
    margin-bottom: 12px;
    font-weight: 800;
}
.auth-form {
    display: grid;
    gap: 10px;
    background: rgba(12, 22, 46, 0.9);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 12px 0 #0c1127, 0 16px 32px rgba(0,0,0,0.45);
}
.auth-form label {
    font-weight: 800;
    color: #e8f2ff;
}
.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="number"] {
    background: linear-gradient(135deg, rgba(20,40,87,0.85), rgba(49,247,161,0.22));
    border: 3px solid var(--accent);
    border-radius: 14px;
    padding: 14px 16px;
    color: #e8f2ff;
    font-weight: 800;
    font-size: 1rem;
    box-shadow: 0 10px 0 #0c1127, 0 0 0 5px rgba(93,229,255,0.18);
}
.auth-form input[type="text"]::placeholder,
.auth-form input[type="password"]::placeholder,
.auth-form input[type="number"]::placeholder {
    color: #bcd7ff;
    font-weight: 800;
}

.captcha-section {
    margin: 16px 0;
    padding: 16px;
    background: linear-gradient(135deg, rgba(255,222,89,0.15), rgba(123,247,114,0.15));
    border: 2px solid var(--accent-3);
    border-radius: 12px;
    text-align: center;
}

.captcha-problem {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    color: var(--accent-3);
    margin: 8px 0;
    padding: 12px;
    background: rgba(255,222,89,0.2);
    border-radius: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.avatar-picks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}
.avatar-pick {
    background: linear-gradient(135deg, rgba(93,229,255,0.28), rgba(136,255,163,0.24));
    border: 2px solid var(--accent);
    border-radius: 10px;
    padding: 10px 8px;
    color: #0b1222;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    cursor: pointer;
    box-shadow: 0 8px 0 #0c1127;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: grid;
    gap: 6px;
    justify-items: center;
}
.avatar-pick.selected {
    border-color: var(--accent-3);
    box-shadow: 0 10px 0 #0c1127, 0 0 0 3px rgba(255,222,89,0.4);
}
.avatar-pick:active {
    transform: translateY(2px);
    box-shadow: 0 6px 0 #0c1127;
}
.avatar-pick img {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    border: 2px solid #0c1127;
    object-fit: cover;
    background: #0c132a;
}
.auth-status {
    margin-top: 4px;
    color: #c7d9ff;
    font-weight: 800;
}

/* Dashboard */
.dashboard-card {
    text-align: left;
    display: grid;
    gap: 20px;
}
.profile {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: center;
}
.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 12px;
    border: 3px solid var(--accent);
    box-shadow: 0 10px 0 #0c1127, 0 14px 30px rgba(0,0,0,0.45);
    object-fit: cover;
    background: #0c132a;
}
.profile-avatar.small {
    width: 64px;
    height: 64px;
    border-width: 2px;
}
.build-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 16px;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
}
.upload-card, .game-preview, .quiz-card {
    background: rgba(12, 22, 46, 0.92);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 12px 0 #0c1127, 0 16px 32px rgba(0,0,0,0.45);
}
.upload-card h3, .game-preview h3, .quiz-card h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    color: var(--accent-3);
    margin-bottom: 10px;
    font-weight: 800;
}
.upload-form {
    display: grid;
    gap: 12px;
}
.upload-form label {
    font-weight: 800;
    color: #e8f2ff;
}
.upload-form input[type="file"] {
    background: #0c132a;
    border: 2px dashed var(--accent);
    border-radius: 10px;
    padding: 10px;
    color: #e8f2ff;
}
.dropzone {
    margin-top: 8px;
    border: 2px dashed var(--accent);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    color: #e8f2ff;
    background: rgba(9, 16, 35, 0.8);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    box-shadow: 0 10px 0 #0c1127;
}
.dropzone:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 0 #0c1127;
}
.dropzone.dragover {
    border-color: var(--accent-3);
    box-shadow: 0 12px 0 #0c1127, 0 0 0 4px rgba(255,222,89,0.3);
}
.dropzone p {
    margin: 0;
    font-weight: 800;
}
.dropzone .small {
    color: #c7d9ff;
    font-size: 0.9rem;
    font-weight: 700;
}
.template-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin: 8px 0;
}
.template-btn {
    background: linear-gradient(135deg, #142857 0%, #1f7eff 40%, #31f7a1 100%);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 12px;
    color: #0c1021;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 10px 0 #0c1127, 0 0 0 4px rgba(93,229,255,0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
#quiz-title {
    padding: 10px;
    font-size: large;
     border-radius: 10px;
}
.template-btn.disabled {
    filter: grayscale(1);
    opacity: 0.6;
    cursor: default;
    box-shadow: 0 8px 0 #0c1127;
}
.template-btn.pulse {
    animation: pulse 1.2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 10px 0 #0c1127, 0 0 0 4px rgba(93,229,255,0.18); }
    50% { box-shadow: 0 12px 0 #0c1127, 0 0 0 8px rgba(255,222,89,0.28); }
    100% { box-shadow: 0 10px 0 #0c1127, 0 0 0 4px rgba(93,229,255,0.18); }
}
.create-panel {
    margin-top: 12px;
    padding-top: 6px;
    border-top: 1px solid rgba(93,229,255,0.3);
}
.step {
    margin-top: 6px;
    color: #e8f2ff;
    font-weight: 800;
}
.game-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.game-type {
    display: grid;
    gap: 4px;
    align-content: start;
    padding: 10px;
    background: rgba(9, 16, 35, 0.8);
    border: 2px solid #2f4fe0;
    border-radius: 10px;
    box-shadow: 0 8px 0 #0c1127;
}
.game-type input {
    margin-right: 6px;
}
.game-type span {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    color: var(--accent-3);
}
.game-type small {
    color: #c7d9ff;
    font-size: 0.85rem;
}
.game-preview .game-grid {
    margin-top: 8px;
}
.game-preview .game-card {
    min-height: 130px;
}

.quiz-card {
    margin-top: 12px;
}
.quiz-output {
    margin-top: 12px;
    background: rgba(9, 16, 35, 0.8);
    border: 2px solid var(--accent);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 8px 0 #0c1127;
}
.quiz-output.ready {
    border-color: var(--accent-3);
    box-shadow: 0 10px 0 #0c1127, 0 0 0 4px rgba(255,222,89,0.2);
}
.quiz-output h4 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    color: var(--accent-3);
}
.quiz-meta {
    color: #c7d9ff;
    font-weight: 800;
    margin-bottom: 8px;
}
.quiz-question {
    margin-top: 12px;
    padding: 10px;
    border: 1px solid rgba(93,229,255,0.4);
    border-radius: 10px;
    background: rgba(12, 22, 46, 0.9);
}
.quiz-question h5 {
    color: var(--accent-3);
    font-size: 0.95rem;
    margin-bottom: 6px;
    font-weight: 800;
}
.quiz-question ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.quiz-question li {
    background: #0c132a;
    border: 1px solid rgba(93,229,255,0.3);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 4px;
    color: #e8f2ff;
    font-weight: 800;
}
.quiz-question li.correct {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 2px rgba(123,247,114,0.3);
}
.quiz-question .hint {
    margin-top: 4px;
    color: #c7d9ff;
    font-size: 0.9rem;
}
.quiz-play {
    margin-top: 12px;
    padding: 12px;
    border: 2px solid var(--accent);
    border-radius: 12px;
    background: rgba(9, 16, 35, 0.8);
    box-shadow: 0 10px 0 #0c1127;
}
.quiz-bar {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    color: #c7d9ff;
    font-weight: 700;
}
.quiz-options {
    display: grid;
    gap: 8px;
    margin: 10px 0;
}
.option-btn {
    background: #0c132a;
    border: 2px solid rgba(93,229,255,0.4);
    border-radius: 10px;
    color: #e8f2ff;
    padding: 12px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    box-shadow: 0 6px 0 #0c1127;
    font-weight: 800;
    letter-spacing: 0.3px;
}
.option-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #0c1127;
}
.option-btn:disabled {
    cursor: default;
    opacity: 0.9;
}
.option-btn.correct {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 2px rgba(123,247,114,0.3);
}
.option-btn.wrong {
    border-color: #ff7a1f;
    box-shadow: 0 0 0 2px rgba(255,122,31,0.3);
}
.open-answer {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 2px solid rgba(93,229,255,0.5);
    background: #0c132a;
    color: #e8f2ff;
    font-weight: 800;
    margin-bottom: 8px;
    box-shadow: inset 0 0 0 2px #05080e;
}
.quiz-feedback {
    color: #c7d9ff;
    font-weight: 800;
}
.digital-score {
    font-family: 'Press Start 2P', cursive;
    color: #6bff7a;
    font-size: 1.05rem;
    letter-spacing: 1px;
    text-shadow: 0 0 12px rgba(107,255,122,0.6), 0 4px 0 #0c1127;
}
.quiz-result {
    margin-top: 10px;
    background: radial-gradient(120% 120% at 50% 0%, rgba(255,222,89,0.15), rgba(12,22,46,0.95));
    border: 2px solid var(--accent);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 10px 0 #0c1127, 0 0 0 4px rgba(93,229,255,0.12);
    color: #e8f2ff;
    text-align: center;
}
.score-big {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.3rem;
    color: #ffde59;
    text-shadow: 0 4px 0 #0c1127;
    margin-bottom: 8px;
}
.game-over-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    letter-spacing: 2px;
    color: #ff7a1f;
    text-shadow: 0 4px 0 #0c1127;
    margin-bottom: 12px;
}

.result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 12px;
}
.cartridge {
    margin-top: 10px;
    padding: 16px 14px;
    border: 3px solid #2c3038;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 60%),
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08), transparent 55%),
        #0f141d;
    box-shadow: inset 0 0 0 2px #000, 0 10px 0 #05080e, 0 0 0 6px rgba(0,0,0,0.3);
    color: #e8f2ff;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}
.cartridge:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 2px #000, 0 14px 0 #05080e, 0 0 0 6px rgba(255,222,89,0.18); }
.cartridge.played {
    border-color: #2f4fe0;
    box-shadow: inset 0 0 0 2px #000, 0 10px 0 #0c1127, 0 0 0 6px rgba(47,79,224,0.15);
}
.cart-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.85rem;
    font-weight: 800;
    margin-top: 60px;
    margin-bottom: 12px;
    letter-spacing: 1px;
    background: linear-gradient(180deg, #f1f1f1 0%, #d2d2d2 100%);
    color: #0b1222;
    border-radius: 10px;
    border: 2px solid #b0b0b0;
    padding: 14px 10px;
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.08), 0 8px 0 #05080e;
    text-align: center;
}
.cart-owner {
    position: absolute;
    top: 14px;
    left: 64px;
    color: #e8f2ff;
    font-weight: 800;
    font-size: 0.9rem;
}
.cart-scores {
    background: rgba(255,255,255,0.04);
    border: 2px solid #1f2735;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 12px;
    box-shadow: inset 0 0 0 2px #000, 0 4px 0 #05080e;
}
.cart-score-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    color: #ffde59;
    margin-bottom: 6px;
}
.trophy-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.trophy-list li {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    color: #e8f2ff;
    font-size: 0.9rem;
    margin: 2px 0;
}
.trophy {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
    box-shadow: 0 0 0 2px #0c1127;
}
.trophy.gold { background: linear-gradient(135deg, #ffde59, #ffb300); }
.trophy.silver { background: linear-gradient(135deg, #d7e1ff, #a9b8d8); }
.trophy.bronze { background: linear-gradient(135deg, #d59b6a, #b87333); }
.cart-empty {
    margin: 0;
    color: #c7d9ff;
    font-weight: 800;
    font-size: 0.9rem;
}
.cart-sticker {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #2c3038;
    box-shadow: 0 4px 0 #05080e;
    background: #0c132a;
}
.cart-sticker img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.delete-circle {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ff5252;
    color: #0b1222;
    border: 2px solid #fff;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 0 #a61c1c;
}
.delete-circle:hover { transform: scale(1.05); }
.start-btn.danger {
    background: linear-gradient(90deg, #ff7a7a 0%, #ff3b3b 100%);
    box-shadow: 0 10px 0 #b22525, 0 0 0 4px rgba(255,122,122,0.25);
}
.cartridge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    margin-top: 8px;
}
.created-games h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    color: var(--accent-3);
    margin-bottom: 10px;
    font-weight: 800;
}
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: grid;
    place-items: center;
    z-index: 1000;
}
.modal.hidden { display: none; }
.modal-content {
    background: rgba(12, 22, 46, 0.95);
    border: 3px solid var(--accent);
    border-radius: 16px;
    padding: 16px;
    width: min(900px, 90vw);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    position: relative;
}
.upload-card.loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(93,229,255,0.15), rgba(255,122,31,0.18));
    opacity: 0.9;
    pointer-events: none;
}
.upload-card.loading {
    position: relative;
}
.create-modal-content {
    width: min(720px, 94vw);
}
.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff7a1f;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: #0b1222;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 0 #c65300;
}

.hidden {
    display: none;
}

@media (max-width: 900px) {
    .build-grid {
        grid-template-columns: 1fr;
    }
    .profile {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }
}

/* Footer */
footer {
    margin-top: 30px;
    padding: 18px;
    text-align: center;
    color: #a9b8d8;
    font-size: 0.95rem;
    border-top: 2px solid rgba(93,229,255,0.3);
}

/* Responsive */
@media (max-width: 768px) {
    body { padding: 16px; }
    header h1 { font-size: 1.2rem; }
    .welcome-message { padding: 26px 18px; }
.start-btn { width: 100%; }
}

@media (max-width: 640px) {
    main {padding:0px}
    body { padding: 0px; border:unset; border-radius:0px }
    .container { border-width: 2px; padding:0px;border-radius: 0px;border:unset; }
    header.profile-bar { flex-direction: column; align-items: flex-start; }
    .profile-bar-left { width: 100%; }
    .start-btn { width: 100%; text-align: center; }
    .section-header { flex-direction: column; align-items: stretch; }
    .cartridge-grid { grid-template-columns: 1fr; }
    .cartridge { padding: 14px 12px; }
    .cart-label { font-size: 0.78rem; }
    .cart-owner { position: static; margin: 6px 0 0 0; }
    .modal-content, .create-modal-content { width: 100vw;height: 100vh; border:unset;border-radius:0px }
    .quiz-bar { flex-direction: column; align-items: flex-start; gap: 4px; }
    .dropzone { min-height: 120px; }
    .quiz-play { padding: 10px; }
    .welcome-message { padding: 18px 14px; }
    .hero-cta { grid-template-columns: 1fr; }
    .result-actions { flex-direction: row; flex-wrap: wrap; justify-content: center; }
}
.loading::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 900;
    pointer-events: none;
}

/* Animated quiz loading bar */
.quiz-loading {
    margin-top: 20px;
    text-align: center;
}

.loading-bar-container {
    width: 100%;
    height: 12px;
    background: linear-gradient(135deg, #e8f4fd, #f0f8ff);
    border-radius: 20px;
    border: 2px solid #4FC3F7;
    margin: 15px 0;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(79, 195, 247, 0.2);
}

.loading-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, 
        #FF6B6B 0%, 
        #4ECDC4 25%, 
        #45B7D1 50%, 
        #96CEB4 75%, 
        #FECA57 100%);
    border-radius: 18px;
    width: 0%;
    transition: width 0.8s ease-out;
    animation: shimmer 2s ease-in-out infinite alternate;
}

@keyframes shimmer {
    0% { opacity: 0.8; transform: scaleY(0.9); }
    100% { opacity: 1; transform: scaleY(1.1); }
}

.loading-message {
    font-size: 16px;
    font-weight: bold;
    color: #2E7D32;
    margin: 10px 0;
    animation: bounce 1.5s ease-in-out infinite;
}

@keyframes bounce {
    0%, 50%, 100% { transform: translateY(0); }
    25% { transform: translateY(-8px); }
    75% { transform: translateY(-4px); }
}

/* AI Teacher Chat Bubble */
.ai-teacher-bubble {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 350px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    z-index: 1001;
    animation: slideInFromRight 0.5s ease-out;
    border: 3px solid #fff;
}

@keyframes slideInFromRight {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

.ai-teacher-bubble .teacher-avatar {
    font-size: 24px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -10px;
    left: 15px;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.ai-teacher-bubble .teacher-message {
    padding: 25px 20px 20px 20px;
    color: white;
    margin-left: 40px;
}

.ai-teacher-bubble .teacher-name {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.ai-teacher-bubble .teacher-reasoning {
    font-size: 15px;
    line-height: 1.4;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 12px;
    border-left: 4px solid #4ecdc4;
}

.ai-teacher-bubble .bubble-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-teacher-bubble .bubble-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Speech bubble tail */
.ai-teacher-bubble::after {
    content: '';
    position: absolute;
    bottom: -15px;
    right: 30px;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 15px solid #764ba2;
}

@media (max-width: 768px) {
    .ai-teacher-bubble {
        max-width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
        top: 80px;
    }
    
    .ai-teacher-bubble::after {
        right: 50%;
        transform: translateX(50%);
    }
}
