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

body {
    font-family: 'Press Start 2P', monospace;
    background: linear-gradient(45deg, #6A1B9A, #8E24AA);
    min-height: 100vh;
    color: #2D1B69;
    image-rendering: pixelated;
    overflow-x: hidden;
}

.game-container {
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    background: linear-gradient(180deg, #F3E5F5 0%, #E1BEE7 100%);
    box-shadow: 0 0 50px rgba(106, 27, 154, 0.3);
}

.game-header {
    background: linear-gradient(90deg, #6A1B9A, #8E24AA);
    color: #F3E5F5;
    padding: 10px 20px;  
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 8px rgba(45, 27, 105, 0.3);
    border-bottom: 4px solid #4A148C;
    position: relative;
}

.title {
    font-size: 14px;  
    text-shadow: 2px 2px 0px #4A148C;
    letter-spacing: 2px;
}

.meter {
    display: flex;
    align-items: center;
    gap: 8px;  
    font-size: 9px;  
}

.meters {
    display: flex;
    gap: 20px; 
    align-items: center;
}

.game-header::before {
    content: '🚗💨🚗💨🚗💨🚗💨🚗💨';
    position: absolute;
    bottom: -15px;
    left: 0;
    right: 0;
    font-size: 12px;
    animation: drive 10s linear infinite;
    opacity: 0.6;
}

@keyframes drive {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.meter label {
    margin: 0;
}

.meter-frustration {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-left: auto;
}

.frustration-labels {
    display: flex;
    justify-content: space-between;
    font-size: 7px;
}

.frustration-label {
    white-space: nowrap;
}

.frustration-bar {
    width: 150px;
    height: 12px;
    background: #2D1B69;
    border: 2px solid #F3E5F5;
    position: relative;
    border-radius: 2px;
}

.frustration-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #FFC107, #FF5722);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 1px;
}

.screen {
    display: none;
    min-height: calc(100vh - 80px);
    padding: 20px;
}

.screen.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

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


/* ========== FRONT PAGE ========== */
.front-page-content {
    background: #f6c1ff;
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 15px;
}

#pixel-canvas {
    width: 95%;
    max-width: 1100px;
    height: auto;
    max-height: 40vh;
    aspect-ratio: 2.5/1;
    border: 6px solid #4a148c;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    display: block;
    box-shadow: 0 12px 24px rgba(0,0,0,0.4);
}

.title-section {
    text-align: center;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.game-title {
    font-size: 42px;
    color: #52007a;
    letter-spacing: 8px;
    margin-bottom: 5px;
    text-shadow: 
        5px 5px 0 rgba(0,0,0,0.6),
        -2px -2px 0 #7c53f7;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { 
        text-shadow: 
            4px 4px 0 rgba(0,0,0,0.5),
            -2px -2px 0 #ba98ff;
    }
    50% { 
        text-shadow: 
            6px 6px 0 rgba(0,0,0,0.5),
            -3px -3px 0 #cb9dff,
            0 0 20px rgba(131, 73, 237, 0.5);
    }
}

.subtitle {
    font-size: 16px;
    color: #E1BEE7;
    letter-spacing: 2px;
    margin: 12px 0;
}

#cycling-word {
    color: #7300ff;
    display: inline-block;
    min-width: 180px;
}

.game-info {
    font-size: 16px;
    color: #8800ffd9;
    letter-spacing: 2px;
    margin: 15px 0;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.039);
}

.game-tagline {
    font-size: 10px;
    color: #7a28ff;
    letter-spacing: 1px;
    margin: 12px 0 20px 0;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.106);
}

.byline {
    font-size: 8px;
    opacity: 0.8;
    margin: 10px 0;
    font-style: italic;
}

.start-game-btn {
    background: linear-gradient(135deg, #6A1B9A, #8E24AA);
    border: 5px solid #2D1B69;
    color: #fff;
    font-size: 16px;
    padding: 18px 45px;
    letter-spacing: 3px;
    cursor: pointer;
    box-shadow: 
        6px 6px 0 #914cff,
        0 0 30px #7344ff99;
    transition: background 0.2s;
    font-family: 'Press Start 2P', monospace;
    position: relative;
    overflow: hidden;
    animation: pulse-out 4s ease-in-out infinite;
}

.start-game-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 70%
    );
    animation: shimmer 2.5s linear infinite;
    pointer-events: none;
}

@keyframes pulse-out {
    0%, 100% {
        transform: translate(0, 0);
        box-shadow: 
            6px 6px 0 #914cff,
            0 0 30px #7344ff99;
    }
    50% {
        transform: translate(-8px, -8px);
        box-shadow: 
            14px 14px 0 #914cff,
            0 0 60px #7344ffff,
            0 0 100px #7344ff88;
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.start-game-btn:hover {
    background: linear-gradient(135deg, #1d46ff, #003dd7);
    animation: pulse-out-hover 0.6s ease-in-out infinite;
}

@keyframes pulse-out-hover {
    0%, 100% {
        transform: translate(3px, 3px);
        box-shadow: 
            3px 3px 0 #0b00d4,
            0 0 40px rgba(11, 60, 255, 0.9);
    }
    50% {
        transform: translate(-6px, -6px);
        box-shadow: 
            12px 12px 0 #0b00d4,
            0 0 80px rgba(11, 60, 255, 1);
    }
}

.start-game-btn:active {
    transform: translate(6px, 6px);
    box-shadow: 0 0 0 #240cff;
    animation: none;
}

.card {
    background: #F3E5F5;
    border: 6px solid #2D1B69;
    border-radius: 0;
    padding: 30px;
    max-width: 1100px;
    margin: 0 auto;
    box-shadow: 8px 8px 0px #4A148C;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: #6A1B9A;
    z-index: -1;
    border-radius: 0;
}

h2 {
    text-align: center;
    font-size: 18px;
    margin-bottom: 10px;
    color: #6A1B9A;
    text-shadow: 1px 1px 0px #4A148C;
}

h3 {
    font-size: 10px;
    color: #6A1B9A;
    margin-bottom: 15px;
}

h4 {
    font-size: 9px;
    color: #6A1B9A;
    margin: 20px 0 10px 0;
}

.subtitle {
    text-align: center;
    font-size: 8px;
    color: #8E24AA;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 10px;
    color: #2D1B69;
}

input[type="text"] {
    width: 100%;
    padding: 10px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    background: #F9F9F9;
    border: 3px solid #2D1B69;
    border-radius: 0;
    color: #2D1B69;
}

input[type="text"]:focus {
    outline: none;
    background: #FFF;
    box-shadow: inset 0 0 10px rgba(106, 27, 154, 0.3);
}

.radio-group-horizontal {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="radio"] {
    transform: scale(1.3);
    accent-color: #6A1B9A;
    cursor: pointer;
}

.radio-option label {
    font-size: 9px;
    cursor: pointer;
    margin: 0;
}

.character-preview {
    background: #E1BEE7;
    border: 3px solid #2D1B69;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}

.pixel-character {
    font-size: 48px;
    margin-bottom: 10px;
}

.character-info {
    font-size: 8px;
}

#preview-name {
    color: #6A1B9A;
    margin-bottom: 5px;
    font-weight: bold;
}

.city-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.city-card {
    background: #E1BEE7;
    border: 4px solid #2D1B69;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.city-card:hover {
    background: #E8C5EA;
    transform: translateY(-2px);
}

.city-card.selected {
    background: #6A1B9A;
    color: #F3E5F5;
    box-shadow: 0 0 20px rgba(106, 27, 154, 0.5);
}

.city-image {
    font-size: 32px;
    margin-bottom: 10px;
}

.city-card h3 {
    font-size: 12px;
    margin-bottom: 15px;
    color: inherit;
    text-shadow: none;
}

.city-description {
    font-size: 7px;
    line-height: 1.6;
    color: inherit;
}

.selected-city-info {
    text-align: center;
    background: #E1BEE7;
    border: 3px solid #6A1B9A;
    padding: 20px;
    margin-top: 20px;
}

.selected-city-info h3 {
    text-align: center;
    margin-bottom: 15px;
}

.selected-city-info p {
    font-size: 9px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.button {
    background: linear-gradient(45deg, #6A1B9A, #8E24AA);
    color: #F3E5F5;
    border: 4px solid #2D1B69;
    padding: 15px 25px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    cursor: pointer;
    display: block;
    margin: 20px auto;
    text-transform: uppercase;
    box-shadow: 4px 4px 0px #4A148C;
    transition: all 0.1s ease;
    position: relative;
}

.button:hover {
    background: linear-gradient(45deg, #8E24AA, #6A1B9A);
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #4A148C;
}

.button:active {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px #4A148C;
}

.game-content-full {
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 120px);
}

.story-panel-full {
    background: #F3E5F5;
    border: 4px solid #2D1B69;
    padding: 30px;
    max-width: 1500px;
    width: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 8px 8px 0px #4A148C;
    position: relative; 
}

.scenario-title {
    position: absolute;
    top: 30px; 
    left: 30px;
    font-size: 16px;
    color: #250560;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 2px;
    border: 3px solid #6A1B9A;
}

@media (max-width: 768px) {
    .scenario-title {
        position: relative;
        top: auto;
        left: auto;
        display: block;
        margin: 0 auto 10px auto;
        font-size: 12px;
        padding: 8px 16px;
        border: 2px solid #6A1B9A;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .scenario-title {
        font-size: 10px;
        padding: 6px 12px;
    }
}
.year {
    background: #6A1B9A;
    color: #F3E5F5;
    padding: 10px 20px;
    font-size: 14px;
    border: 3px solid #2D1B69;
    display: inline-block;
    text-shadow: 1px 1px 0px #4A148C;
    margin-bottom: 5px;
}

.generation {
    font-size: 8px;
    color: #8E24AA;
}

.narrative-text {
    background: #E1BEE7;
    border: 3px solid #2D1B69;
    padding: 20px;
    margin-bottom: 20px;
    font-size: 11px;
    line-height: 1.8;
    border-radius: 2px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}
.year-display {
    text-align: center;
    margin-bottom: 10px;
    margin-top: -10px;
    position: relative; 
}

@media (max-width: 500px) {
    .scenario-title {
        font-size: 10px;
        padding: 6px 12px;
    }
}

.narrative-copy {
    padding-right: 10px;
}

.narrative-image {
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: contain;
    object-position: center;
    border: 2px solid #2D1B69;
    display: block;
    background: #F3E5F5;
    padding: 5px;
}

.narrative-text:has(.narrative-copy:only-child) {
    grid-template-columns: 1fr;
}

.fact-box-inline {
    background: #FFE082;
    border: 2px solid #F57C00;
    padding: 12px;
    margin-top: 15px;
    border-radius: 2px;
}

.fact-title {
    font-size: 7px;
    color: #E65100;
    margin-bottom: 6px;
    font-weight: bold;
    text-align: center;
}

#fact-content {
    font-size: 9px;
    line-height: 1.6;
    color: #2D1B69;
    margin-bottom: 6px;
}

.fact-link {
    font-size: 8px;
    color: #6A1B9A;
    text-decoration: none;
    display: inline-block;
}

.fact-link:hover {
    text-decoration: underline;
}

.choices-section {
    margin-top: auto;
    padding-top: 10px;
}

.choices {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.choice-button {
    background: linear-gradient(135deg, #7ae7ff, #01d0ff);
    border: 5px solid #0c061f;
    padding: 18px 25px;
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    color: #2D1B69;
    border-radius: 20px;
    line-height: 1.6;
    box-shadow: 8px 8px 0px rgba(0, 19, 160, 0.6);
}

.choice-button:hover {
    background: linear-gradient(135deg, #FF8FAB, #FFB399);
    transform: translateX(5px);
    box-shadow: 10px 10px 0px rgba(45, 27, 105, 0.8);
}

.choice-button.forced-choice {
    background: linear-gradient(135deg, #FFCCBC, #FFAB91);
    border-color: #D84315;
}

.choice-button:hover::before {
    opacity: 1;
    left: 8px;
}

.choice-button.forced-choice {
    background: linear-gradient(135deg, #FFCCBC, #FFAB91);
    border-color: #D84315;
    border-width: 4px;
    box-shadow: 8px 8px 0px rgba(216, 67, 21, 0.6);
}

.choice-button.forced-choice:hover {
    background: linear-gradient(135deg, #FFAB91, #FF8A65);
    box-shadow: 12px 12px 0px rgba(216, 67, 21, 0.8);
}

.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 27, 105, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.result-box {
    background: #F3E5F5;
    border: 6px solid #2D1B69;
    padding: 30px;
    max-width: 800px;
    width: 100%;
    box-shadow: 8px 8px 0px #4A148C;
    max-height: 90vh;
    overflow-y: auto;
}

.result-title {
    font-size: 12px;
    color: #6A1B9A;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 1px 1px 0px #4A148C;
}

.result-text {
    font-size: 11px;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #2D1B69;
}

.money-change {
    background: #E1BEE7;
    border: 3px solid #6A1B9A;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
}

.money-animation {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    animation: moneyPulse 0.5s ease-in-out;
}

@keyframes moneyPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.money-spent {
    color: #FF5722;
}

.money-gained {
    color: #4CAF50;
}

.stat-summary {
    background: #E1BEE7;
    border: 2px solid #6A1B9A;
    padding: 15px;
    margin-top: 15px;
    font-size: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.skip-button {
    background: rgba(45, 27, 105, 0.8);
    color: #F3E5F5;
    border: 2px solid #F3E5F5;
    padding: 8px 12px;
    font-family: 'Press Start 2P', monospace;
    font-size: 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.skip-button:hover {
    background: rgba(45, 27, 105, 1);
    transform: scale(1.05);
}

.resource-section {
    background: #E1BEE7;
    border: 3px solid #6A1B9A;
    padding: 25px;
    margin: 20px 0;
    font-size: 8px;
    line-height: 1.8;
}

.resource-section p {
    margin-bottom: 15px;
    font-size: 9px;
}

.resource-link {
    display: block;
    font-size: 8px;
    color: #6A1B9A;
    text-decoration: none;
    margin-bottom: 10px;
    padding: 8px 0;
    transition: all 0.2s ease;
}

.resource-link:hover {
    text-decoration: underline;
    transform: translateX(5px);
}

.share-section {
    background: #E1BEE7;
    border: 3px solid #6A1B9A;
    padding: 20px;
    margin: 25px 0;
}

.share-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.share-button {
    background: linear-gradient(135deg, #1DA1F2, #0d8bd9);
    color: white;
    border: 3px solid #2D1B69;
    padding: 12px 20px;
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 4px 4px 0px #4A148C;
}

.share-button.copy {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.share-button:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #4A148C;
}

.share-button:active {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px #4A148C;
}

@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .title {
        font-size: 12px;
    }

    .meters {
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }

    .narrative-text {
        grid-template-columns: 1fr;
    }

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

    .city-options {
        grid-template-columns: 1fr;
    }

    .card {
        margin: 10px;
        padding: 20px;
    }

    .game-title {
        font-size: 32px;
    }

    .radio-group-horizontal {
        flex-direction: column;
        gap: 10px;
    }

    .story-panel-full {
        padding: 20px;
    }
    
    #pixel-canvas {
        max-width: 100%;
    }
}
