/* WayfinderMath - Main Stylesheet */

/* CSS Variables */
:root {
    --primary-color: #3d6741;
    --primary-dark: #2d4f31;
    --secondary-color: #4a7c2a;
    --accent-color: #b8912e;
    --danger-color: #c9534f;

    --addition-color: #4a7c2a;
    --subtraction-color: #3d6741;
    --multiplication-color: #6b5535;
    --division-color: #b8912e;

    --bg-color: #f5f0e6;
    --bg-light: #ebe5d8;
    --bg-card: #ffffff;
    --text-color: #2d2d2d;
    --text-muted: #555555;

    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, var(--bg-color) 0%, var(--bg-light) 100%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3 {
    margin-bottom: 1rem;
    font-weight: 600;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 1.8rem;
}

h3 {
    font-size: 1.3rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #4cae4c;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c9302c;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.9rem;
}

/* Header */
.app-header {
    background: rgba(61, 103, 65, 0.97);
    padding: 1rem 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.logo-icon {
    font-size: 2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #ffffff;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Main Content */
.app-main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Home Page */
.home-container {
    max-width: 1200px;
    margin: 0 auto;
}

.hero {
    padding: 2rem 1rem 3rem;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.hero-text {
    text-align: center;
    flex: 1;
    min-width: 280px;
}

.hero h1 {
    font-size: 2.8rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.hero-goat {
    flex-shrink: 0;
}

.hero-goat img {
    width: 280px;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
    animation: gentleBounce 3s ease-in-out infinite;
}

@keyframes gentleBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.student-welcome {
    text-align: center;
    margin-bottom: 2rem;
}

.student-welcome h2 {
    color: var(--accent-color);
}

/* Activity Selection */
.activity-selection {
    margin: 3rem 0;
}

.activity-selection h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.activity-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    border: 3px solid transparent;
    display: block;
    color: var(--text-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.activity-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.activity-card.addition {
    border-color: var(--addition-color);
}

.activity-card.addition:hover {
    background: linear-gradient(135deg, var(--bg-card), rgba(74, 124, 42, 0.12));
}

.activity-card.subtraction {
    border-color: var(--subtraction-color);
}

.activity-card.subtraction:hover {
    background: linear-gradient(135deg, var(--bg-card), rgba(61, 103, 65, 0.12));
}

.activity-card.multiplication {
    border-color: var(--multiplication-color);
}

.activity-card.multiplication:hover {
    background: linear-gradient(135deg, var(--bg-card), rgba(107, 85, 53, 0.12));
}

.activity-card.division {
    border-color: var(--division-color);
}

.activity-card.division:hover {
    background: linear-gradient(135deg, var(--bg-card), rgba(184, 145, 46, 0.12));
}

.activity-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.activity-card h3 {
    font-size: 1.5rem;
}

.activity-card p {
    color: var(--text-muted);
}

.activity-progress {
    margin-top: 1rem;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.activity-progress-bar {
    height: 100%;
    background: var(--secondary-color);
    transition: width 0.5s ease;
}

/* Instructions */
.how-to-play {
    margin: 3rem 0;
}

.how-to-play h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.instruction-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.instruction-number {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
    color: #ffffff;
}

/* Modal */
.profile-prompt-modal,
.game-menu-modal,
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    background: #fafafa;
    color: var(--text-color);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
}

.modal-actions,
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Game Page */
.game-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
}

.game-menu-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
}

.game-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.activity-label {
    background: var(--primary-color);
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
}

.score-display {
    font-size: 1.2rem;
    font-weight: 600;
}

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

.game-stats {
    display: flex;
    gap: 1rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.game-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* First Person View */
.first-person-view {
    flex: 1;
    position: relative;
    background: #000;
}

.first-person-view canvas {
    width: 100%;
    height: 100%;
}

/* Math Problem Overlay */
.math-problem-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 30px 50px;
    border-radius: var(--border-radius);
    border: 3px solid var(--primary-color);
}

.problem-display {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 3rem;
    font-weight: bold;
}

.operand {
    color: white;
}

.operator {
    color: var(--accent-color);
}

.equals {
    color: var(--text-muted);
}

.answer-display {
    min-width: 80px;
    text-align: center;
    color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 15px;
    border-radius: 8px;
}

.answer-display.blink-correct {
    animation: blinkCorrect 0.6s ease-in-out 4;
    color: #4ade80;
    font-size: 3.5rem;
}

.answer-display.correct-celebrate {
    color: #4ade80;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.8), 0 0 20px rgba(74, 222, 128, 0.5);
    animation: celebratePulse 0.5s ease-in-out infinite;
}

@keyframes celebratePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes blinkCorrect {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(1.15);
    }
}

/* Wrong Answer Flash */
.wrong-answer-flash {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(217, 83, 79, 0.5);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s;
}

.wrong-answer-flash.active {
    opacity: 1;
}

/* Turn Hint Alert */
.turn-hint {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    pointer-events: none;
    z-index: 50;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.turn-hint.visible {
    opacity: 1;
    visibility: visible;
}

.hint-arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    animation: hint-pulse 1s ease-in-out infinite;
}

@keyframes hint-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* Entrance Overlay */
.entrance-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, #1a1a2e 0%, #0a0a15 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 100;
    padding-bottom: 5%;
}

.building-entrance {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.building-roof {
    width: 500px;
    height: 60px;
    background: linear-gradient(to bottom, #4a5568, #2d3748);
    clip-path: polygon(0% 100%, 50% 0%, 100% 100%);
    position: relative;
    z-index: 2;
}

.building-roof::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 10px;
    background: #718096;
}

.building-facade {
    width: 460px;
    background: linear-gradient(to bottom, #4a5568 0%, #2d3748 100%);
    padding: 20px 30px 0;
    position: relative;
    border-left: 8px solid #718096;
    border-right: 8px solid #718096;
}

.building-sign {
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-color);
    text-shadow: 0 0 20px rgba(240, 173, 78, 0.5);
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 3px solid var(--accent-color);
    border-radius: 8px;
    margin-bottom: 20px;
    letter-spacing: 4px;
}

.doorway {
    position: relative;
    background: linear-gradient(to bottom, #0a0a15, #1a1a2e);
    border: 8px solid #8B4513;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    padding: 20px;
    min-height: 350px;
}

.door-frame {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    pointer-events: none;
}

.door {
    flex: 1;
    background: linear-gradient(to bottom, #654321, #4a3728);
    border: 4px solid #8B4513;
    position: relative;
}

.door-left {
    transform-origin: left;
    transform: perspective(500px) rotateY(45deg);
    border-radius: 8px 0 0 0;
}

.door-right {
    transform-origin: right;
    transform: perspective(500px) rotateY(-45deg);
    border-radius: 0 8px 0 0;
}

.door::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 15px;
    height: 15px;
    background: #d4af37;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.door-left::before {
    right: 15px;
}

.door-right::before {
    left: 15px;
}

.building-columns {
    display: flex;
    justify-content: space-between;
    width: 500px;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.column {
    width: 40px;
    height: 420px;
    background: linear-gradient(to right, #718096, #a0aec0, #718096);
    border-radius: 8px 8px 0 0;
    position: relative;
}

.column::before {
    content: '';
    position: absolute;
    top: 0;
    left: -5px;
    right: -5px;
    height: 20px;
    background: #a0aec0;
    border-radius: 4px;
}

.column::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    right: -8px;
    height: 30px;
    background: #718096;
}

.entrance-content {
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 5;
}

.entrance-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.entrance-message {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    color: var(--text-color);
}

.entrance-hint {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.btn-large {
    padding: 16px 40px;
    font-size: 1.3rem;
}

/* Animal Caught Overlay */
.animal-caught-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.animal-container {
    text-align: center;
}

.animal-container canvas {
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.petting-message {
    font-size: 1.5rem;
    margin: 1rem 0;
    color: var(--accent-color);
}

.petting-progress {
    width: 300px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.petting-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
    width: 0%;
    transition: width 0.1s linear;
}

/* Victory Overlay */
.victory-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.victory-content {
    text-align: center;
}

.victory-content h2 {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

.final-stats {
    font-size: 1.3rem;
    margin-bottom: 2rem;
}

.final-stats p {
    margin: 0.5rem 0;
}

.victory-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

/* Side Panel */
.game-side-panel {
    width: 300px;
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 15px;
}

/* Mini Map */
.mini-map-container {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 10px;
}

.mini-map-container h3 {
    margin-bottom: 10px;
    font-size: 1rem;
}

.mini-map-container canvas {
    width: 100%;
    aspect-ratio: 1;
    background: #000;
    border-radius: 8px;
}

/* Number Pad - Custom tall buttons */
.number-pad {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 15px;
}

.number-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.number-row:last-child {
    margin-bottom: 0;
}

.num-btn {
    flex: 1;
    aspect-ratio: 1 / 2;
    background: linear-gradient(180deg, #3a5a8a 0%, #2a4a7a 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 0 #1a3a5a;
    position: relative;
}

.num-btn:hover {
    background: linear-gradient(180deg, #4a6a9a 0%, #3a5a8a 100%);
}

.num-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #1a3a5a;
}

.num-label {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
}

.control-row {
    margin-top: 8px;
}

.clear-btn {
    background: linear-gradient(180deg, #8a5a3a 0%, #7a4a2a 100%);
    box-shadow: 0 4px 0 #5a3a1a;
}

.clear-btn:hover {
    background: linear-gradient(180deg, #9a6a4a 0%, #8a5a3a 100%);
}

.enter-btn {
    background: linear-gradient(180deg, #3a8a5a 0%, #2a7a4a 100%);
    box-shadow: 0 4px 0 #1a5a3a;
    flex: 3;
}

.enter-btn:hover {
    background: linear-gradient(180deg, #4a9a6a 0%, #3a8a5a 100%);
}

/* Rotation Controls */
.rotation-controls {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.rotate-btn {
    width: 70px;
    height: 70px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rotate-btn:hover {
    background: var(--primary-dark);
}

.rotate-btn:active {
    transform: scale(0.95);
}

/* Menu Stats */
.menu-stats {
    margin: 1.5rem 0;
    font-size: 1.2rem;
}

.menu-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Leaderboard Page */
.leaderboard-container {
    max-width: 1000px;
    margin: 0 auto;
}

.leaderboard-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.activity-tabs,
.time-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tab-btn,
.filter-btn {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tab-btn:hover,
.filter-btn:hover {
    background: #f5f5f5;
    border-color: var(--primary-color);
}

.tab-btn.active,
.filter-btn.active {
    border-color: var(--primary-color);
    background: rgba(61, 103, 65, 0.12);
}

.leaderboard-table-container {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

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

.leaderboard-table th,
.leaderboard-table td {
    padding: 15px;
    text-align: left;
}

.leaderboard-table th {
    background: rgba(61, 103, 65, 0.1);
    font-weight: 600;
}

.leaderboard-table tbody tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transition: var(--transition);
}

.leaderboard-table tbody tr:hover {
    background: rgba(61, 103, 65, 0.06);
}

.leaderboard-table tbody tr.local-score {
    background: rgba(61, 103, 65, 0.15);
}

.leaderboard-table tbody tr.local-score td:first-child::after {
    content: ' (You)';
    color: var(--accent-color);
}

.loading-indicator {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.no-scores {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.your-scores-section {
    margin-top: 3rem;
}

.your-scores-list {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* Profile Page */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #ffffff;
}

.profile-name-section h2 {
    margin-bottom: 0.5rem;
}

.mastery-section,
.stats-section,
.data-section {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.mastery-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.mastery-tab {
    padding: 8px 16px;
    background: #f0f0f0;
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
}

.mastery-tab:hover {
    background: #e8e8e8;
}

.mastery-tab.active {
    background: var(--primary-color);
    color: #ffffff;
}

.mastery-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.mastery-stat {
    text-align: center;
}

.mastery-label {
    display: block;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.mastery-progress {
    height: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.mastery-bar {
    height: 100%;
    background: var(--secondary-color);
    transition: width 0.5s ease;
}

.mastery-value {
    font-size: 1.5rem;
    font-weight: bold;
}

.mastery-grid {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 4px;
    margin-bottom: 1rem;
}

.mastery-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 500;
}

.mastery-header {
    background: transparent;
    color: var(--text-muted);
}

.mastery-new {
    background: rgba(0, 0, 0, 0.08);
}

.mastery-learning {
    background: rgba(184, 145, 46, 0.5);
}

.mastery-practicing {
    background: rgba(61, 103, 65, 0.45);
}

.mastery-mastered {
    background: rgba(74, 124, 42, 0.6);
}

.mastery-legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    padding: 1rem;
}

.stat-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.data-info {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.data-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-main {
        flex-direction: column;
    }

    .game-side-panel {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 10px;
    }

    .mini-map-container {
        flex: 1;
        min-width: 120px;
    }

    .number-pad {
        flex: 2;
        min-width: 200px;
    }

    .movement-controls {
        flex: 1;
        min-width: 100px;
    }

    .nav-links {
        gap: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-goat img {
        width: 200px;
    }

    .hero-content {
        gap: 1.5rem;
    }

    .problem-display {
        font-size: 2rem;
    }

    .num-label {
        font-size: 1.4rem;
    }

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

@media (max-width: 480px) {
    .nav-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-content {
        flex-direction: column-reverse;
        gap: 1rem;
    }

    .hero-goat img {
        width: 160px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

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

    .game-side-panel {
        flex-direction: column;
    }

    .mini-map-container,
    .number-pad,
    .movement-controls {
        width: 100%;
    }
}

/* ===========================================
   MOUNTAIN CLIMBING GAME STYLES
   =========================================== */

/* Mountain Game Layout */
.game-main.mountain-game {
    flex-direction: column;
}

.mountain-view {
    flex: 1;
    position: relative;
    background: linear-gradient(to bottom, #87CEEB 0%, #E0F4FF 100%);
    min-height: 200px;
    overflow: hidden;
}

.mountain-view canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Math Problem Section - Below Mountain View */
.math-problem-section {
    background: rgba(0, 0, 0, 0.85);
    padding: 15px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 3px solid var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.math-problem-section .problem-display {
    font-size: 2.5rem;
    gap: 12px;
}

/* Number Pad Section - Full Width at Bottom */
.number-pad-section {
    background: var(--bg-light);
    padding: 12px;
}

.number-pad-section .number-pad {
    max-width: 500px;
    margin: 0 auto;
    padding: 10px;
}

.number-pad-section .num-btn {
    aspect-ratio: 1.2 / 1;
    padding-top: 0;
    justify-content: center;
}

.number-pad-section .num-label {
    font-size: 1.6rem;
}

/* Mountain Entrance Overlay */
.entrance-overlay.mountain-entrance {
    background: linear-gradient(to bottom, #87CEEB 0%, #B0E0E6 30%, #98D8C8 60%, #4a7c2a 100%);
    align-items: center;
    padding-bottom: 0;
}

.mountain-start-scene {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    width: 100%;
    height: 100%;
}

.mountain-backdrop {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background:
        /* Snow-capped peak */
        linear-gradient(155deg, transparent 38%, #FFFFFF 38%, #FFFFFF 42%, transparent 42%),
        linear-gradient(-155deg, transparent 38%, #FFFFFF 38%, #FFFFFF 42%, transparent 42%),
        /* Main mountain - dark gray/blue */
        linear-gradient(155deg, transparent 25%, #2D3A4A 25%, #4A5568 50%, #2D3A4A 75%, transparent 75%),
        /* Secondary peaks */
        linear-gradient(140deg, transparent 30%, #3D4A5C 30%, #3D4A5C 70%, transparent 70%),
        linear-gradient(-140deg, transparent 35%, #2D3A4A 35%, #2D3A4A 65%, transparent 65%);
    background-size: 100% 100%;
    background-position: center bottom;
}

.mountain-start-scene .start-content {
    position: relative;
    z-index: 10;
    background: rgba(0, 0, 0, 0.75);
    padding: 2rem 3rem;
    border-radius: 20px;
    border: 3px solid var(--accent-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.mountain-start-scene h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.mountain-start-scene .entrance-message {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.mountain-start-scene .entrance-hint {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.goat-preview {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><ellipse cx="50" cy="55" rx="25" ry="18" fill="%23F5F5F5"/><ellipse cx="50" cy="35" rx="12" ry="12" fill="%23F5F5F5"/><ellipse cx="50" cy="40" rx="6" ry="5" fill="%23D0D0D0"/><circle cx="46" cy="33" r="2" fill="%232C2C2C"/><circle cx="54" cy="33" r="2" fill="%232C2C2C"/><ellipse cx="50" cy="42" rx="3" ry="2" fill="%23FFB6C1"/><path d="M42 25 Q40 15 44 20" stroke="%23C4A484" stroke-width="3" fill="none"/><path d="M58 25 Q60 15 56 20" stroke="%23C4A484" stroke-width="3" fill="none"/><rect x="38" y="62" width="6" height="15" fill="%23F5F5F5"/><rect x="48" y="62" width="6" height="15" fill="%23F5F5F5"/><rect x="38" y="75" width="6" height="4" fill="%234A4A4A"/><rect x="48" y="75" width="6" height="4" fill="%234A4A4A"/></svg>') center/contain no-repeat;
}

/* Mountain Victory Overlay */
.victory-content.mountain-victory {
    background: rgba(0, 0, 0, 0.85);
    padding: 2.5rem;
    border-radius: 20px;
    border: 3px solid var(--secondary-color);
}

.victory-content.mountain-victory h2 {
    color: var(--accent-color);
}

.victory-goat {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><ellipse cx="50" cy="55" rx="25" ry="18" fill="%23F5F5F5"/><ellipse cx="50" cy="35" rx="12" ry="12" fill="%23F5F5F5"/><ellipse cx="50" cy="40" rx="6" ry="5" fill="%23D0D0D0"/><path d="M44 32 Q46 28 48 32" stroke="%232C2C2C" stroke-width="2" fill="none"/><path d="M52 32 Q54 28 56 32" stroke="%232C2C2C" stroke-width="2" fill="none"/><ellipse cx="50" cy="42" rx="3" ry="2" fill="%23FFB6C1"/><path d="M42 25 Q40 15 44 20" stroke="%23C4A484" stroke-width="3" fill="none"/><path d="M58 25 Q60 15 56 20" stroke="%23C4A484" stroke-width="3" fill="none"/><rect x="38" y="62" width="6" height="15" fill="%23F5F5F5"/><rect x="48" y="62" width="6" height="15" fill="%23F5F5F5"/><rect x="38" y="75" width="6" height="4" fill="%234A4A4A"/><rect x="48" y="75" width="6" height="4" fill="%234A4A4A"/><text x="50" y="15" text-anchor="middle" font-size="20">🏆</text></svg>') center/contain no-repeat;
    animation: victoryBounce 0.5s ease-in-out infinite alternate;
}

@keyframes victoryBounce {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-10px);
    }
}

/* Climbing stat in header */
.climbing-stat {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
}

/* Responsive Styles for Mountain Game */
@media (max-width: 768px) {
    .math-problem-section .problem-display {
        font-size: 2rem;
        gap: 10px;
    }

    .number-pad-section .num-label {
        font-size: 1.4rem;
    }

    .mountain-start-scene .start-content {
        padding: 1.5rem 2rem;
        margin: 1rem;
    }

    .mountain-start-scene h2 {
        font-size: 1.8rem;
    }

    .goat-preview {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .game-header {
        padding: 8px 10px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .game-info {
        gap: 0.5rem;
        font-size: 0.9rem;
    }

    .activity-label {
        padding: 2px 8px;
        font-size: 0.85rem;
    }

    .score-display,
    .timer-display {
        font-size: 1rem;
    }

    .math-problem-section {
        padding: 12px 15px;
    }

    .math-problem-section .problem-display {
        font-size: 1.8rem;
        gap: 8px;
    }

    .math-problem-section .answer-display {
        min-width: 60px;
        padding: 3px 10px;
    }

    .number-pad-section {
        padding: 8px;
    }

    .number-pad-section .number-pad {
        padding: 8px;
    }

    .number-pad-section .number-row {
        gap: 5px;
        margin-bottom: 5px;
    }

    .number-pad-section .num-btn {
        aspect-ratio: 1.3 / 1;
        border-radius: 6px;
    }

    .number-pad-section .num-label {
        font-size: 1.3rem;
    }

    .mountain-start-scene .start-content {
        padding: 1.2rem 1.5rem;
    }

    .mountain-start-scene h2 {
        font-size: 1.5rem;
    }

    .mountain-start-scene .entrance-message {
        font-size: 1rem;
    }

    .btn-large {
        padding: 12px 30px;
        font-size: 1.1rem;
    }
}

/* Landscape mode optimizations for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .game-header {
        padding: 5px 15px;
    }

    .math-problem-section {
        padding: 8px 15px;
    }

    .math-problem-section .problem-display {
        font-size: 1.6rem;
    }

    .number-pad-section {
        padding: 5px 10px;
    }

    .number-pad-section .number-pad {
        max-width: 400px;
        padding: 5px;
    }

    .number-pad-section .number-row {
        gap: 4px;
        margin-bottom: 4px;
    }

    .number-pad-section .num-btn {
        aspect-ratio: 1.5 / 1;
    }

    .number-pad-section .num-label {
        font-size: 1.1rem;
    }
}

/* ===========================================
   STREAKS SECTION STYLES
   =========================================== */

/* Streak Summary Section (Home Page) */
.streak-summary {
    margin: 2rem 0;
    text-align: center;
}

.streak-summary h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-dark);
}

.streak-cards {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.streak-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem 2rem;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 3px solid transparent;
    transition: var(--transition);
}

.streak-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.streak-card.day-streak {
    border-color: #f97316;
}

.streak-card.week-streak {
    border-color: #eab308;
}

.streak-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.streak-value {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1.1;
}

.streak-label {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.streak-percentile {
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: 600;
    min-height: 1.2rem;
}

.streak-progress {
    margin-top: 1rem;
    text-align: left;
}

.streak-progress .progress-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.streak-progress .progress-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.streak-progress .progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.streak-card.day-streak .progress-fill {
    background: linear-gradient(90deg, #f97316, #fb923c);
}

.streak-card.week-streak .progress-fill {
    background: linear-gradient(90deg, #eab308, #facc15);
}

.streak-info {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Leaderboard Type Tabs */
.leaderboard-type-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.type-tab {
    padding: 12px 24px;
    background: var(--bg-card);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.type-tab:hover {
    background: #f5f5f5;
    border-color: var(--primary-color);
}

.type-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* No Streaks Message */
.no-streaks {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Responsive Streak Styles */
@media (max-width: 768px) {
    .streak-cards {
        gap: 1rem;
    }

    .streak-card {
        min-width: 160px;
        padding: 1.2rem 1.5rem;
    }

    .streak-icon {
        font-size: 2rem;
    }

    .streak-value {
        font-size: 2.5rem;
    }

    .leaderboard-type-tabs {
        justify-content: center;
    }

    .type-tab {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .streak-cards {
        flex-direction: column;
        align-items: center;
    }

    .streak-card {
        width: 100%;
        max-width: 280px;
    }
}
