/* ============================================
   STARTUP VALLEY v2 - Retro RPG Styles
   BET 603 Educational Game
   ============================================ */

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

:root {
    --bg-dark: #1a1c2c;
    --bg-medium: #2d3047;
    --bg-light: #424669;
    --accent-green: #38b764;
    --accent-green-light: #a8e6cf;
    --accent-yellow: #fecd1a;
    --accent-orange: #f77f00;
    --accent-red: #e84855;
    --accent-blue: #5bc0eb;
    --accent-purple: #9b5de5;
    --text-light: #f4f4f4;
    --text-dim: #8b8b8b;
    --gold: #ffd700;
    --pixel-shadow: #13111c;
}

body {
    font-family: 'Press Start 2P', cursive;
    background: var(--bg-dark);
    min-height: 100vh;
    color: var(--text-light);
    overflow: hidden;
}

/* ============================================
   SCREENS
   ============================================ */
#game-container {
    width: 100vw;
    height: 100vh;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.screen.active {
    display: flex;
}

/* Title Screen */
#title-screen {
    background: linear-gradient(180deg, var(--bg-dark) 0%, #2a4858 50%, var(--accent-green) 100%);
    text-align: center;
}

.title-art {
    margin-bottom: 20px;
}

.pixel-art {
    font-family: monospace;
    font-size: 10px;
    color: var(--accent-yellow);
    text-shadow: 2px 2px 0 var(--accent-orange);
    white-space: pre;
    line-height: 1.2;
}

#title-screen h2 {
    font-size: 11px;
    color: var(--accent-yellow);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 10px;
    margin-bottom: 30px;
}

.game-footer {
    position: absolute;
    bottom: 20px;
    font-size: 8px;
    color: var(--text-dim);
    opacity: 0.7;
}

/* How To Play */
#how-to-play-screen {
    background: var(--bg-dark);
}

#how-to-play-screen h2 {
    color: var(--accent-yellow);
    font-size: 16px;
    margin-bottom: 20px;
}

.instructions {
    max-width: 500px;
    width: 100%;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 12px;
    background: var(--bg-medium);
    border-radius: 4px;
}

.instruction-item .icon {
    font-size: 24px;
}

.instruction-item p {
    font-size: 8px;
    line-height: 1.6;
}

/* ============================================
   BUTTONS
   ============================================ */
.pixel-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 11px;
    padding: 14px 28px;
    background: var(--accent-green);
    color: var(--text-light);
    border: none;
    cursor: pointer;
    margin: 5px;
    box-shadow:
        0 4px 0 #2a8f50,
        0 6px 0 var(--pixel-shadow);
    transition: transform 0.1s;
}

.pixel-btn:hover {
    transform: translateY(-2px);
}

.pixel-btn:active {
    transform: translateY(2px);
    box-shadow:
        0 2px 0 #2a8f50,
        0 3px 0 var(--pixel-shadow);
}

.pixel-btn.secondary {
    background: var(--bg-light);
    box-shadow:
        0 4px 0 var(--bg-dark),
        0 6px 0 var(--pixel-shadow);
}

.pixel-btn:disabled {
    background: var(--text-dim);
    cursor: not-allowed;
    transform: none;
}

.icon-btn {
    font-size: 20px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
}

/* ============================================
   CHARACTER SELECTION
   ============================================ */
#character-select-screen {
    background: var(--bg-dark);
}

#character-select-screen h2 {
    color: var(--accent-yellow);
    font-size: 14px;
    margin-bottom: 20px;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.character-card {
    background: var(--bg-medium);
    border: 3px solid var(--bg-light);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.character-card:hover {
    border-color: var(--accent-yellow);
    transform: translateY(-3px);
}

.character-card.selected {
    border-color: var(--accent-green);
    background: var(--bg-light);
}

.character-emoji {
    font-size: 40px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
}

.character-card .character-name {
    font-size: 8px;
}

.character-bio {
    background: var(--bg-medium);
    padding: 20px;
    border-radius: 8px;
    max-width: 400px;
    text-align: center;
    margin-bottom: 20px;
    min-height: 120px;
}

.character-bio h3 {
    color: var(--accent-yellow);
    font-size: 12px;
    margin-bottom: 10px;
}

.character-bio p {
    font-size: 8px;
    line-height: 1.8;
    margin-bottom: 10px;
}

.character-strength,
.character-bonus {
    font-size: 8px;
    margin: 5px 0;
}

.character-strength strong,
.character-bonus strong {
    color: var(--accent-green);
}

/* ============================================
   GAME SCREEN
   ============================================ */
#game-screen {
    flex-direction: column;
    padding: 0;
    background: var(--bg-dark);
}

/* HUD */
#hud {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--bg-dark);
    border-bottom: 3px solid var(--bg-light);
    z-index: 100;
}

.hud-left,
.hud-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hud-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
}

.hud-icon {
    font-size: 14px;
}

#cash-display {
    color: var(--accent-green-light);
}

#coins-display {
    color: var(--gold);
}

.chapter-indicator {
    font-size: 8px;
    color: var(--accent-purple);
}

.location-indicator {
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Campus View */
#campus-container {
    flex: 1;
    width: 100%;
    position: relative;
    overflow: hidden;
}

#campus {
    width: 100%;
    height: 100%;
    position: relative;
    background: #f5e6d3;
    transition: background 0.3s;
}

/* Player Character */
.character {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -50%);
    transition: left 0.1s, top 0.1s;
    z-index: 50;
}

.character-sprite {
    font-size: 32px;
    filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.3));
}

.character-name {
    font-size: 6px;
    background: var(--bg-dark);
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 2px;
    white-space: nowrap;
}

.player .character-sprite::before {
    content: '😊';
}

/* NPCs */
.npc {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 40;
}

.npc:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.npc-sprite {
    font-size: 28px;
    filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.3));
}

.npc-sprite.recruited {
    filter: drop-shadow(0 0 5px var(--accent-green));
}

.npc-name {
    font-size: 6px;
    background: var(--bg-dark);
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 2px;
    white-space: nowrap;
    opacity: 0.9;
}

.npc-cofounder .npc-name { background: var(--accent-purple); }
.npc-customer .npc-name { background: var(--accent-blue); }
.npc-angel .npc-name, .npc-vc .npc-name { background: var(--gold); color: var(--bg-dark); }
.npc-mentor .npc-name { background: var(--accent-green); }

/* NPC Type Label */
.npc-type {
    font-size: 5px;
    padding: 1px 4px;
    border-radius: 2px;
    margin-top: 1px;
    white-space: nowrap;
    opacity: 0.8;
    background: var(--bg-medium);
    color: var(--text-dim);
}

.npc-cofounder .npc-type { color: var(--accent-purple); }
.npc-customer .npc-type { color: var(--accent-blue); }
.npc-angel .npc-type, .npc-vc .npc-type { color: var(--gold); }
.npc-mentor .npc-type { color: var(--accent-green); }

/* Interact Prompt */
.interact-prompt {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-dark);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 10px;
    border: 2px solid var(--accent-yellow);
    animation: promptPulse 1s ease infinite;
    z-index: 60;
}

.interact-prompt .key {
    background: var(--accent-yellow);
    color: var(--bg-dark);
    padding: 2px 8px;
    border-radius: 4px;
}

@keyframes promptPulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
}

/* Location Navigation */
#location-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg-medium);
    border-top: 3px solid var(--bg-light);
    flex-wrap: wrap;
}

.location-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 7px;
    padding: 8px 12px;
    background: var(--bg-dark);
    color: var(--text-light);
    border: 2px solid var(--bg-light);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.location-btn span:first-child {
    font-size: 16px;
}

.location-btn:hover:not(.locked) {
    border-color: var(--accent-yellow);
    background: var(--bg-medium);
}

.location-btn.active {
    border-color: var(--accent-green);
    background: var(--bg-light);
}

.location-btn.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Action Hint Panel */
#action-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: linear-gradient(90deg, var(--accent-purple), var(--bg-medium));
    border-top: 2px solid var(--accent-purple);
}

.hint-icon {
    font-size: 16px;
}

#hint-text {
    font-size: 8px;
    color: var(--text-light);
    line-height: 1.4;
}

/* Chapter Progress */
#chapter-progress {
    padding: 10px 15px;
    background: var(--bg-dark);
    border-top: 2px solid var(--bg-light);
}

.progress-title {
    display: flex;
    justify-content: space-between;
    font-size: 8px;
    margin-bottom: 8px;
}

#current-task {
    color: var(--accent-yellow);
}

#task-progress {
    color: var(--text-dim);
}

.progress-bar {
    height: 8px;
    background: var(--bg-medium);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-green-light));
    transition: width 0.3s;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-dark);
    border: 4px solid var(--accent-yellow);
    border-radius: 8px;
    padding: 25px;
    max-width: 450px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    font-size: 12px;
    color: var(--accent-yellow);
    margin-bottom: 15px;
    text-align: center;
}

/* Dialog Modal */
.dialog-content {
    border-color: var(--accent-blue);
}

.dialog-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.dialog-portrait {
    font-size: 40px;
    background: var(--bg-medium);
    padding: 10px;
    border-radius: 8px;
}

.dialog-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dialog-name {
    font-size: 12px;
    color: var(--accent-blue);
}

.dialog-role {
    font-size: 7px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--bg-light);
    color: var(--text-light);
    display: inline-block;
    width: fit-content;
}

.dialog-role.role-cofounder { background: var(--accent-purple); }
.dialog-role.role-customer { background: var(--accent-blue); }
.dialog-role.role-angel { background: var(--gold); color: var(--bg-dark); }
.dialog-role.role-vc { background: var(--gold); color: var(--bg-dark); }
.dialog-role.role-mentor { background: var(--accent-green); }

.dialog-text {
    font-size: 9px;
    line-height: 1.8;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-medium);
    border-radius: 4px;
}

.dialog-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dialog-option {
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    padding: 12px 15px;
    background: var(--bg-light);
    border: 2px solid var(--bg-medium);
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    color: var(--text-light);
    transition: all 0.2s;
    line-height: 1.6;
}

.dialog-option:hover {
    border-color: var(--accent-blue);
    background: var(--bg-medium);
}

.option-key {
    background: var(--accent-blue);
    color: var(--bg-dark);
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 8px;
}

/* Concept Modal */
.concept-content {
    border-color: var(--accent-purple);
}

.concept-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.concept-icon {
    font-size: 24px;
}

.concept-content h3 {
    color: var(--accent-purple);
    margin: 0;
}

.concept-description {
    font-size: 9px;
    line-height: 1.8;
    margin-bottom: 15px;
    padding: 15px;
    background: var(--bg-medium);
    border-radius: 4px;
}

.concept-formula {
    font-size: 10px;
    text-align: center;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 4px;
    margin-bottom: 15px;
    color: var(--accent-yellow);
}

.concept-example {
    font-size: 8px;
    line-height: 1.8;
    padding: 15px;
    background: var(--bg-light);
    border-left: 4px solid var(--accent-green);
    border-radius: 4px;
    margin-bottom: 20px;
}

.concept-example::before {
    content: '💡 Example: ';
    color: var(--accent-yellow);
}

/* Quiz Modal */
.quiz-content {
    border-color: var(--accent-orange);
}

.quiz-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.quiz-icon {
    font-size: 24px;
}

.quiz-content h3 {
    color: var(--accent-orange);
    margin: 0;
}

.quiz-question {
    font-size: 10px;
    line-height: 1.8;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-medium);
    border-radius: 4px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.quiz-option {
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    padding: 12px 15px;
    background: var(--bg-light);
    border: 2px solid var(--bg-medium);
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    color: var(--text-light);
    transition: all 0.2s;
    line-height: 1.6;
}

.quiz-option:hover:not(:disabled) {
    border-color: var(--accent-orange);
}

.quiz-option.correct {
    background: var(--accent-green);
    border-color: #2a8f50;
}

.quiz-option.incorrect {
    background: var(--accent-red);
    border-color: #c73847;
}

.option-letter {
    background: var(--accent-orange);
    color: var(--bg-dark);
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 8px;
}

.quiz-feedback {
    font-size: 12px;
    text-align: center;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.quiz-feedback.correct {
    background: var(--accent-green);
}

.quiz-feedback.incorrect {
    background: var(--accent-red);
}

.quiz-hint {
    font-size: 8px;
    padding: 10px;
    background: var(--bg-medium);
    border-left: 4px solid var(--accent-yellow);
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Reward Popup */
.reward-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reward-content {
    background: var(--bg-dark);
    border: 4px solid var(--gold);
    border-radius: 8px;
    padding: 20px 40px;
    text-align: center;
}

.reward-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.reward-text {
    font-size: 14px;
    color: var(--gold);
}

/* Menu Modal */
.menu-content {
    border-color: var(--accent-green);
}

.menu-section {
    margin-bottom: 20px;
}

.menu-section h4 {
    font-size: 10px;
    color: var(--accent-green);
    margin-bottom: 10px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 8px;
    border-bottom: 1px solid var(--bg-light);
}

.team-member,
.concept-item {
    font-size: 8px;
    padding: 8px;
    background: var(--bg-medium);
    margin-bottom: 5px;
    border-radius: 4px;
}

.menu-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Chapter Complete Modal */
.chapter-complete-content {
    border-color: var(--gold);
    text-align: center;
}

.chapter-complete-content h2 {
    font-size: 16px;
    color: var(--gold);
    margin-bottom: 15px;
}

.chapter-title {
    font-size: 14px;
    color: var(--accent-purple);
    margin-bottom: 15px;
}

.chapter-stats {
    font-size: 9px;
    margin-bottom: 15px;
}

.chapter-stats .stat {
    padding: 8px 0;
}

.chapter-unlocks {
    background: var(--bg-medium);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: left;
}

.chapter-unlocks h4 {
    font-size: 10px;
    color: var(--accent-yellow);
    margin-bottom: 10px;
}

.chapter-unlocks ul {
    list-style: none;
    font-size: 8px;
}

.chapter-unlocks li::before {
    content: '★ ';
    color: var(--gold);
}

/* Win Screen */
#win-screen {
    background: linear-gradient(180deg, var(--bg-dark) 0%, #1a3a4a 50%, var(--accent-green) 100%);
    text-align: center;
}

.win-content h1 {
    font-size: 24px;
    color: var(--gold);
    margin-bottom: 20px;
    animation: pulse 1s ease infinite;
}

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

.win-message {
    font-size: 10px;
    margin-bottom: 30px;
    max-width: 400px;
}

.final-stats {
    background: var(--bg-dark);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 3px solid var(--gold);
}

.concepts-mastered {
    background: var(--bg-dark);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: left;
    max-width: 400px;
}

.concepts-mastered h3 {
    font-size: 12px;
    color: var(--accent-purple);
    margin-bottom: 15px;
}

.concepts-mastered ul {
    list-style: none;
    font-size: 8px;
    line-height: 2;
}

.concepts-mastered li::before {
    content: '✓ ';
    color: var(--accent-green);
}

/* ============================================
   ANIMATIONS
   ============================================ */
.pop {
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 600px) {
    .pixel-art {
        font-size: 6px;
    }

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

    .location-btn {
        font-size: 6px;
        padding: 6px 8px;
    }

    .location-btn span:first-child {
        font-size: 14px;
    }

    #hud {
        flex-wrap: wrap;
        gap: 10px;
    }

    .hud-item {
        font-size: 8px;
    }
}
