/* Orbitron and Inter Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Orbitron:wght@500;700;900&display=swap');

:root {
    --bg-dark: #0a0f1d;
    --bg-light: #161f38;
    --card-bg: rgba(22, 31, 56, 0.7);
    --card-border: rgba(52, 110, 175, 0.3);
    --accent-orange: #fa742e;
    --accent-blue: #346eaf;
    --accent-blue-light: #4c8be2;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --font-header: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
    --shadow-blue: 0 0 15px rgba(52, 110, 175, 0.4);
    --shadow-orange: 0 0 15px rgba(250, 116, 46, 0.4);
    --glow-text-blue: 0 0 8px rgba(52, 110, 175, 0.8);
    --glow-text-orange: 0 0 8px rgba(250, 116, 46, 0.8);
    --glow-card-blue: 0 0 20px rgba(52, 110, 175, 0.25);
    --glow-card-orange: 0 0 20px rgba(250, 116, 46, 0.25);
}

/* Reset and Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

body {
    background: radial-gradient(circle at center, var(--bg-light) 0%, var(--bg-dark) 100%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Decorative background elements */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background-image: 
        radial-gradient(1.5px 1.5px at 20px 30px, rgba(255,255,255,0.15), rgba(0,0,0,0)),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.12), rgba(0,0,0,0)),
        radial-gradient(2.5px 2.5px at 130px 80px, rgba(52, 110, 175, 0.2), rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 160px 120px, rgba(250, 116, 46, 0.15), rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 250px 250px;
    opacity: 0.5;
}

/* Navigation Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 5%;
    background: rgba(10, 15, 29, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--accent-blue);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-blue));
    border-radius: 50%;
    position: relative;
    box-shadow: var(--shadow-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-header);
    font-weight: 900;
    font-size: 1.5rem;
    color: #fff;
}

.logo-text {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(90deg, var(--accent-orange), var(--accent-blue-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}

.hud-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.trophy-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(52, 110, 175, 0.1);
    border: 1px solid var(--accent-blue);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-family: var(--font-header);
    font-size: 0.9rem;
    color: var(--accent-blue-light);
    box-shadow: 0 0 10px rgba(52, 110, 175, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.trophy-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-blue);
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

/* App Containers */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    padding-bottom: 5rem;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease-out;
}

.hero h1 {
    font-family: var(--font-header);
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: var(--glow-text-orange);
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto;
    background: rgba(22, 31, 56, 0.5);
    padding: 1.25rem 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Sector Grid Setup */
.grid-title {
    font-family: var(--font-header);
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-left: 4px solid var(--accent-orange);
    padding-left: 0.75rem;
}

.sector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.75rem;
}

/* Styled Cards */
.sector-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.75rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
}

.sector-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 10%, rgba(250, 116, 46, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

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

.sector-card.completed {
    border-color: var(--accent-blue);
}

.sector-card.completed:hover {
    box-shadow: var(--glow-card-blue);
}

.sector-badge {
    align-self: flex-start;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    background: rgba(52, 110, 175, 0.2);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue-light);
    margin-bottom: 1rem;
}

.sector-num {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    font-family: var(--font-header);
    font-weight: 900;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.05);
}

.sector-card h3 {
    font-family: var(--font-header);
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.sector-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-top: auto;
}

.card-status {
    color: var(--accent-orange);
    font-family: var(--font-header);
    font-weight: 700;
}

.sector-card.completed .card-status {
    color: var(--accent-blue-light);
}

.trophy-icon {
    font-size: 1.2rem;
    display: none;
}

.sector-card.completed .trophy-icon {
    display: inline-block;
    color: var(--accent-blue-light);
}

/* Gameplay View Styles */
.gameplay-view {
    display: none;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    min-height: calc(100vh - 200px);
}

.gameplay-sidebar {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: 80vh;
    overflow-y: auto;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-family: var(--font-header);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.btn-back:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-4px);
    border-color: var(--accent-orange);
}

.progress-tracker {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
}

.progress-step.active {
    background: rgba(250, 116, 46, 0.08);
    border-color: rgba(250, 116, 46, 0.3);
}

.progress-step.completed {
    background: rgba(52, 110, 175, 0.08);
    border-color: rgba(52, 110, 175, 0.3);
}

.progress-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4b5563;
}

.progress-step.active .progress-indicator {
    background: var(--accent-orange);
    box-shadow: 0 0 8px var(--accent-orange);
}

.progress-step.completed .progress-indicator {
    background: var(--accent-blue-light);
    box-shadow: 0 0 8px var(--accent-blue-light);
}

.progress-step-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.progress-step.active .progress-step-text {
    color: var(--accent-orange);
}

.progress-step.completed .progress-step-text {
    color: #fff;
}

/* Instructions Block */
.instruction-box {
    flex-grow: 1;
    background: rgba(10, 15, 29, 0.5);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
    overflow-y: auto;
}

.instruction-box h4 {
    font-family: var(--font-header);
    margin-bottom: 0.75rem;
    color: #fff;
    font-size: 1rem;
    text-transform: uppercase;
}

.instruction-box p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.instruction-box ul {
    margin-left: 1.2rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.instruction-box li {
    margin-bottom: 0.4rem;
}

/* Main Simulator Workspace */
.gameplay-workspace {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.workspace-header {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.25rem 2rem;
}

.workspace-header h2 {
    font-family: var(--font-header);
    font-size: 1.5rem;
    color: #fff;
    text-shadow: var(--glow-text-orange);
}

/* Briefing Panel (No random black sections anymore!) */
.briefing-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sim-container {
    display: none; /* Controlled dynamically in app.js */
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid var(--accent-orange);
    box-shadow: var(--shadow-orange);
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.sim-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.workspace-controls {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Buttons */
.btn-primary {
    font-family: var(--font-header);
    font-weight: 700;
    background: linear-gradient(90deg, var(--accent-orange), var(--accent-blue));
    color: #fff;
    border: none;
    padding: 0.8rem 1.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(250, 116, 46, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-orange);
}

.btn-secondary {
    font-family: var(--font-header);
    font-weight: 700;
    background: transparent;
    color: #fff;
    border: 2px solid var(--accent-blue);
    padding: 0.8rem 1.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-blue);
    background: rgba(52, 110, 175, 0.1);
}

/* Quiz Interface */
.quiz-container {
    display: none;
    max-width: 750px;
    margin: 3rem auto;
    background: var(--card-bg);
    border: 1px solid var(--accent-orange);
    box-shadow: var(--glow-card-orange);
    border-radius: 20px;
    padding: 2.5rem;
}

.quiz-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(250, 116, 46, 0.2);
    padding-bottom: 1rem;
}

.quiz-header h2 {
    font-family: var(--font-header);
    color: #fff;
    font-size: 1.8rem;
    text-shadow: var(--glow-text-orange);
}

.quiz-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.quiz-question {
    margin-bottom: 2.25rem;
}

.quiz-question h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1rem;
}

.quiz-options {
    display: grid;
    gap: 0.75rem;
}

.quiz-option-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 1.25rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-option-label:hover {
    background: rgba(250, 116, 46, 0.05);
    border-color: var(--accent-orange);
}

.quiz-option-label input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    outline: none;
    position: relative;
}

.quiz-option-label input[type="radio"]:checked {
    border-color: var(--accent-orange);
}

.quiz-option-label input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-orange);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.quiz-option-label.selected {
    background: rgba(250, 116, 46, 0.08);
    border-color: var(--accent-orange);
}

.quiz-feedback {
    display: none;
    text-align: center;
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 12px;
}

.quiz-feedback.success {
    display: block;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid #10b981;
    color: #34d399;
}

.quiz-feedback.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #f87171;
}

/* Graduation Gate */
.grad-container {
    display: none;
    max-width: 1100px;
    margin: 2rem auto;
    background: var(--card-bg);
    border: 1px solid var(--accent-orange);
    box-shadow: var(--glow-card-orange);
    border-radius: 24px;
    padding: 3rem;
}

.grad-title {
    text-align: center;
    margin-bottom: 2rem;
}

.grad-title h2 {
    font-family: var(--font-header);
    font-size: 2.3rem;
    color: #fff;
    text-shadow: var(--glow-text-orange);
    margin-bottom: 0.5rem;
}

.grad-title p {
    color: var(--text-muted);
}

.grad-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 3rem;
    align-items: center;
}

/* Dynamic Certificate Design (Matches Orange & Blue theme, Auto-adjust layout) */
.cert-preview-wrapper {
    background: rgba(10, 15, 29, 0.8);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#certificate-container {
    width: 100%;
    aspect-ratio: 1.414; /* A4 Landscape */
    background: linear-gradient(135deg, #0e1424 0%, #060913 100%);
    border: 12px double var(--accent-orange);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 2.25rem 2rem;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(250, 116, 46, 0.25);
}

#certificate-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(52, 110, 175, 0.15) 0%, transparent 80%);
    pointer-events: none;
}

.cert-corner {
    position: absolute;
    width: 25px;
    height: 25px;
    border: 3px solid var(--accent-blue);
}
.cert-corner.top-left { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.cert-corner.top-right { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.cert-corner.bottom-left { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.cert-corner.bottom-right { bottom: 12px; right: 12px; border-left: none; border-top: none; }

.cert-header {
    text-align: center;
}

.cert-logo {
    font-family: var(--font-header);
    font-size: 1.4rem;
    font-weight: 900;
    background: linear-gradient(90deg, var(--accent-orange), var(--accent-blue-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
    letter-spacing: 2px;
}

.cert-presentation {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cert-badge-ribbon {
    position: absolute;
    bottom: 2.5rem;
    right: 2.5rem;
    width: 75px;
    height: 75px;
    background: radial-gradient(circle at center, var(--accent-orange) 0%, #060913 100%);
    border: 3px solid var(--accent-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-10deg);
    box-shadow: 0 0 15px rgba(250, 116, 46, 0.4);
}

.cert-badge-ribbon span {
    font-family: var(--font-header);
    font-size: 0.6rem;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.2;
}

.cert-title {
    font-family: var(--font-header);
    font-size: 1.6rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(250, 116, 46, 0.5);
    margin-top: 0.5rem;
}

/* Auto-scalable Cadet Name Container */
.cert-name-container {
    width: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.75rem 0;
}

.cert-name {
    font-family: var(--font-header);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-orange);
    border-bottom: 2px solid var(--accent-blue);
    width: 100%;
    text-align: center;
    padding-bottom: 0.25rem;
    text-shadow: var(--glow-text-orange);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: font-size 0.2s ease;
}

.cert-message {
    font-size: 0.85rem;
    max-width: 80%;
    text-align: center;
    color: var(--text-main);
    line-height: 1.4;
}

.cert-sector {
    font-weight: 700;
    color: var(--accent-blue-light);
}

.cert-footer {
    display: flex;
    justify-content: space-between;
    width: 90%;
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.75rem;
}

.cert-footer-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cert-date, .cert-signature-title {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.cert-signature {
    font-family: 'Orbitron', sans-serif;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    width: 130px;
    text-align: center;
}

/* Certificate Claim Form */
.cert-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.form-group input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-orange);
    box-shadow: 0 0 10px rgba(250, 116, 46, 0.3);
}

/* Email Config drawer / integration panel */
.dev-config-panel {
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.dev-config-toggle {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    display: block;
    margin-bottom: 0.5rem;
}

.dev-config-fields {
    display: none;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex-direction: column;
    gap: 0.75rem;
}

.dev-config-fields input {
    padding: 0.5rem;
    font-size: 0.8rem;
}

/* Success Modal Overlay */
.success-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 29, 0.95);
    z-index: 200;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.success-modal {
    background: var(--card-bg);
    border: 2px solid var(--accent-orange);
    box-shadow: var(--shadow-orange);
    border-radius: 20px;
    padding: 3rem;
    max-width: 500px;
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(250, 116, 46, 0.15);
    border: 2px solid var(--accent-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: var(--accent-orange);
}

.success-modal h2 {
    font-family: var(--font-header);
    color: #fff;
    margin-bottom: 1rem;
}

.success-modal p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Trophies Cabinet Modal */
.trophies-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 29, 0.85);
    z-index: 200;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.trophies-content {
    background: var(--card-bg);
    border: 2px solid var(--accent-blue);
    box-shadow: 0 0 30px rgba(52, 110, 175, 0.3);
    border-radius: 20px;
    padding: 2.5rem;
    width: 90%;
    max-width: 600px;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    font-size: 1.5rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #fff;
}

.trophies-content h2 {
    font-family: var(--font-header);
    margin-bottom: 1.5rem;
    text-shadow: var(--glow-text-blue);
}

.trophy-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.trophy-slot {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    position: relative;
}

.trophy-slot.unlocked {
    background: rgba(250, 116, 46, 0.1);
    border: 1px solid var(--accent-orange);
    box-shadow: 0 0 10px rgba(250, 116, 46, 0.2);
}

.trophy-slot .tooltip {
    visibility: hidden;
    width: 140px;
    background-color: var(--bg-dark);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 110%;
    left: 50%;
    margin-left: -70px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.65rem;
    border: 1px solid var(--accent-blue);
    pointer-events: none;
}

.trophy-slot:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

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

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Breakpoints */

/* Tablets and smaller desktops */
@media (max-width: 1024px) {
    .gameplay-view {
        grid-template-columns: 1fr;
    }
    .gameplay-sidebar {
        max-height: none;
    }
    .grad-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablets */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    .logo-icon {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
    .logo-text {
        font-size: 1.2rem;
    }
    .hud-stats {
        width: 100%;
        text-align: center;
    }
    .trophy-badge {
        font-size: 0.85rem;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .hero p {
        font-size: 1rem;
    }
    .container {
        padding: 0 1rem;
    }
    .quiz-container {
        padding: 1.5rem;
    }
    .grad-container {
        padding: 1.5rem;
    }
    .trophy-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .sector-grid {
        grid-template-columns: 1fr;
    }
    .gameplay-sidebar {
        padding: 1rem;
    }
    .instruction-box {
        padding: 1rem;
    }
    .cert-preview-wrapper {
        margin-bottom: 2rem;
    }
}

/* Large phones and small tablets (480px - 640px) */
@media (max-width: 640px) {
    :root {
        font-size: 14px;
    }
    
    body {
        font-size: 14px;
    }
    
    header {
        padding: 0.75rem;
        flex-direction: row;
        justify-content: space-between;
        gap: 0.5rem;
    }
    
    .logo-container {
        gap: 0.5rem;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .logo-text {
        font-size: 1rem;
        display: none;
    }
    
    .hud-stats {
        width: auto;
    }
    
    .trophy-badge {
        font-size: 0.75rem;
        padding: 0.5rem 0.8rem;
    }
    
    .hero {
        margin-bottom: 2rem;
    }
    
    .hero h1 {
        font-size: 1.4rem;
        margin-bottom: 0.75rem;
    }
    
    .hero p {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .grid-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .sector-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .sector-card {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .sector-num {
        font-size: 1.2rem;
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .sector-card h3 {
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }
    
    .sector-subtitle {
        font-size: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .card-status {
        font-size: 0.75rem;
    }
    
    .trophy-icon {
        font-size: 1rem;
    }
    
    /* Gameplay View Mobile */
    .gameplay-view {
        grid-template-columns: 1fr;
        gap: 1rem;
        min-height: auto;
    }
    
    .gameplay-sidebar {
        max-height: none;
        background: transparent;
        border: none;
        padding: 1rem 0;
        gap: 1rem;
    }
    
    .btn-back {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .progress-tracker {
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: 12px;
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .progress-step {
        padding: 0.5rem 0.6rem;
        font-size: 0.75rem;
        gap: 0.5rem;
    }
    
    .progress-step-text {
        font-size: 0.75rem;
    }
    
    .progress-indicator {
        width: 10px;
        height: 10px;
    }
    
    .instruction-box {
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: 12px;
        padding: 1rem;
        max-height: none;
    }
    
    .instruction-box h3 {
        font-size: 0.95rem;
    }
    
    .instruction-box p,
    .instruction-box li {
        font-size: 0.85rem;
    }
    
    .workspace-header {
        padding: 0;
        margin-bottom: 1rem;
    }
    
    .workspace-header h2 {
        font-size: 1.2rem;
    }
    
    .briefing-panel {
        gap: 1rem;
    }
    
    .lesson-card {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .lesson-card h4 {
        font-size: 0.95rem;
    }
    
    .lesson-card p {
        font-size: 0.85rem;
    }
    
    .workspace-controls {
        margin-top: 1rem !important;
        gap: 0.75rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Quiz Mobile */
    .quiz-container {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .quiz-header h2 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .quiz-header p {
        font-size: 0.8rem;
    }
    
    .quiz-question {
        padding: 1rem;
        margin-bottom: 1rem;
        gap: 0.75rem;
    }
    
    .quiz-question h4 {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }
    
    .quiz-options {
        gap: 0.6rem;
    }
    
    .quiz-option-label {
        padding: 0.7rem;
        font-size: 0.85rem;
        border-radius: 8px;
    }
    
    .quiz-feedback {
        padding: 1rem;
        font-size: 0.85rem;
        margin-top: 1rem;
    }
    
    /* Graduation/Certificate Mobile */
    .grad-container {
        padding: 1rem;
        margin: 1rem auto;
        border-radius: 16px;
    }
    
    .grad-title h2 {
        font-size: 1.3rem;
    }
    
    .grad-title p {
        font-size: 0.9rem;
    }
    
    .grad-grid {
        gap: 1.5rem;
    }
    
    .cert-preview-wrapper {
        margin-bottom: 1.5rem;
        padding: 0.75rem;
    }
    
    #certificate-container {
        padding: 1.5rem 1rem;
        aspect-ratio: 1.414;
    }
    
    .cert-logo {
        font-size: 1rem;
        margin-bottom: 0.15rem;
        letter-spacing: 1px;
    }
    
    .cert-presentation {
        font-size: 0.65rem;
    }
    
    .cert-title {
        font-size: 1.2rem;
        letter-spacing: 1px;
        margin-top: 0.25rem;
    }
    
    .cert-name {
        font-size: 1.3rem;
    }
    
    .cert-message {
        font-size: 0.75rem;
        max-width: 85%;
    }
    
    .cert-badge-ribbon {
        width: 60px;
        height: 60px;
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    .cert-badge-ribbon span {
        font-size: 0.5rem;
    }
    
    .cert-corner {
        width: 18px;
        height: 18px;
        border-width: 2px;
    }
    
    .cert-footer {
        font-size: 0.7rem;
    }
    
    .cert-signature {
        font-size: 0.7rem;
        width: 100px;
    }
    
    .cert-form-wrapper {
        width: 100%;
    }
    
    .form-group {
        gap: 0.4rem;
    }
    
    .form-group label {
        font-size: 0.85rem;
    }
    
    .form-group input {
        padding: 0.7rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .dev-config-panel {
        margin-top: 1rem;
        padding-top: 0.75rem;
    }
    
    .dev-config-toggle {
        font-size: 0.7rem;
    }
    
    .dev-config-fields {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .dev-config-fields input {
        padding: 0.4rem;
        font-size: 0.75rem;
    }
    
    /* Modals Mobile */
    .success-modal {
        padding: 1.5rem;
        margin: 1rem;
        border-radius: 16px;
    }
    
    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .success-modal h2 {
        font-size: 1.2rem;
    }
    
    .success-modal p {
        font-size: 0.9rem;
    }
    
    .trophies-content {
        padding: 1.5rem;
        margin: 1rem;
        width: 95%;
        max-width: 100%;
        border-radius: 16px;
    }
    
    .trophies-content h2 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .trophy-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .trophy-slot {
        font-size: 1.2rem;
    }
    
    .close-btn {
        font-size: 1.2rem;
    }
}

/* Extra small phones (below 480px) */
@media (max-width: 480px) {
    :root {
        font-size: 13px;
    }
    
    header {
        padding: 0.5rem;
    }
    
    .logo-icon {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .trophy-badge {
        font-size: 0.65rem;
        padding: 0.4rem 0.6rem;
    }
    
    .hero h1 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .hero p {
        font-size: 0.85rem;
    }
    
    .grid-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .sector-grid {
        gap: 0.75rem;
    }
    
    .sector-card {
        padding: 0.85rem;
        gap: 0.6rem;
    }
    
    .sector-num {
        font-size: 1rem;
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .sector-card h3 {
        font-size: 0.95rem;
    }
    
    .sector-subtitle {
        font-size: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .progress-tracker {
        padding: 0.75rem;
        gap: 0.4rem;
    }
    
    .progress-step {
        padding: 0.4rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .instruction-box {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    
    .workspace-header h2 {
        font-size: 1rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.6rem 0.9rem;
        font-size: 0.85rem;
    }
    
    .quiz-container {
        padding: 0.75rem;
    }
    
    .quiz-question {
        padding: 0.85rem;
        margin-bottom: 0.85rem;
    }
    
    .quiz-option-label {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
    
    .grad-container {
        padding: 0.75rem;
        margin: 0.75rem auto;
    }
    
    .grad-title h2 {
        font-size: 1.1rem;
    }
    
    #certificate-container {
        padding: 1rem 0.75rem;
    }
    
    .cert-name {
        font-size: 1.1rem;
    }
    
    .cert-badge-ribbon {
        width: 50px;
        height: 50px;
        bottom: 1rem;
        right: 1rem;
    }
    
    .trophy-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    
    .trophy-slot {
        font-size: 1rem;
    }
    
    .sim-container {
        min-height: 300px;
    }
}
