/* ============================================
   WHO DEALT IT?! - AAA Quality Fart Detective Game
   styles.css - Main Stylesheet
   © happystoner5420 Games
   ============================================ */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'GameFont';
    src: local('Impact'), local('Arial Black'), local('Helvetica');
}

:root {
    --color-bg: #0a0a12;
    --color-primary: #4eff91;
    --color-secondary: #ffcc00;
    --color-danger: #ff4444;
    --color-stink-green: #7fff00;
    --color-stink-yellow: #ccff00;
    --color-stink-brown: #8B4513;
    --color-panel-bg: rgba(15, 15, 30, 0.95);
    --color-panel-border: rgba(78, 255, 145, 0.3);
    --color-text: #e0e0e0;
    --color-text-bright: #ffffff;
    --glow-green: 0 0 20px rgba(78, 255, 145, 0.5);
    --glow-yellow: 0 0 20px rgba(255, 204, 0, 0.5);
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a12 100%);
}

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* === SCREENS === */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 2;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: screenFadeIn 0.5s ease-out;
}

@keyframes screenFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* === MAIN MENU === */
.menu-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.menu-bg canvas {
    width: 100%;
    height: 100%;
}

.menu-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 20px;
}

.title-container {
    text-align: center;
    animation: titlePulse 3s ease-in-out infinite;
}

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

.game-title {
    font-family: Impact, 'Arial Black', sans-serif;
    display: flex;
    flex-direction: column;
    line-height: 0.9;
    text-shadow: 0 0 30px rgba(78, 255, 145, 0.8),
                 0 0 60px rgba(78, 255, 145, 0.4),
                 0 4px 8px rgba(0, 0, 0, 0.8);
}

.title-who {
    font-size: 5rem;
    color: var(--color-secondary);
    text-shadow: 0 0 30px rgba(255, 204, 0, 0.8),
                 0 0 60px rgba(255, 204, 0, 0.4),
                 3px 3px 0 #8B6914;
    letter-spacing: 15px;
}

.title-dealt {
    font-size: 7rem;
    color: var(--color-primary);
    text-shadow: 0 0 40px rgba(78, 255, 145, 0.8),
                 0 0 80px rgba(78, 255, 145, 0.4),
                 3px 3px 0 #2a8f4f;
    letter-spacing: 10px;
}

.title-it {
    font-size: 8rem;
    color: var(--color-danger);
    text-shadow: 0 0 40px rgba(255, 68, 68, 0.8),
                 0 0 80px rgba(255, 68, 68, 0.4),
                 3px 3px 0 #8f2a2a;
    letter-spacing: 5px;
    animation: titleShake 0.5s ease-in-out infinite;
}

@keyframes titleShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px) rotate(-1deg); }
    75% { transform: translateX(3px) rotate(1deg); }
}

.subtitle {
    font-size: 1.3rem;
    color: var(--color-stink-yellow);
    text-transform: uppercase;
    letter-spacing: 5px;
    margin-top: 10px;
    text-shadow: 0 0 15px rgba(204, 255, 0, 0.6);
}

.stink-lines {
    font-size: 2rem;
    margin-top: 10px;
    animation: stinkFloat 2s ease-in-out infinite;
}

@keyframes stinkFloat {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.7; }
    50% { transform: translateY(-10px) scale(1.2); opacity: 1; }
}

/* === MENU BUTTONS === */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 320px;
}

.menu-btn {
    padding: 16px 30px;
    font-size: 1.2rem;
    font-family: Impact, 'Arial Black', sans-serif;
    font-weight: bold;
    letter-spacing: 3px;
    text-transform: uppercase;
    border: 2px solid;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.3s ease;
    opacity: 0;
}

.menu-btn:hover::before {
    opacity: 1;
    animation: btnShine 0.5s ease;
}

@keyframes btnShine {
    from { left: -50%; }
    to { left: 150%; }
}

.menu-btn:active {
    transform: scale(0.96);
}

.btn-new-game {
    background: linear-gradient(180deg, #2d8f4e, #1a5c30);
    border-color: var(--color-primary);
    color: var(--color-text-bright);
    box-shadow: var(--glow-green), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-new-game:hover {
    background: linear-gradient(180deg, #3aad62, #228f3f);
    box-shadow: 0 0 30px rgba(78, 255, 145, 0.7), inset 0 1px 0 rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.btn-how-to {
    background: linear-gradient(180deg, #2a5a8f, #1a3a5c);
    border-color: #4a9fff;
    color: var(--color-text-bright);
    box-shadow: 0 0 15px rgba(74, 159, 255, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-how-to:hover {
    background: linear-gradient(180deg, #3670ad, #224a7a);
    box-shadow: 0 0 25px rgba(74, 159, 255, 0.5);
    transform: scale(1.05);
}

.btn-credits {
    background: linear-gradient(180deg, #8f6a2a, #5c421a);
    border-color: var(--color-secondary);
    color: var(--color-text-bright);
    box-shadow: var(--glow-yellow), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-credits:hover {
    background: linear-gradient(180deg, #ad833a, #7a5922);
    box-shadow: 0 0 25px rgba(255, 204, 0, 0.5);
    transform: scale(1.05);
}

.btn-exit {
    background: linear-gradient(180deg, #8f2a2a, #5c1a1a);
    border-color: var(--color-danger);
    color: var(--color-text-bright);
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-exit:hover {
    background: linear-gradient(180deg, #ad3a3a, #7a2222);
    box-shadow: 0 0 25px rgba(255, 68, 68, 0.5);
    transform: scale(1.05);
}

.btn-back {
    background: linear-gradient(180deg, #444466, #2a2a44);
    border-color: #6666aa;
    color: var(--color-text-bright);
    box-shadow: 0 0 10px rgba(102, 102, 170, 0.3);
    margin-top: 20px;
}

.btn-back:hover {
    background: linear-gradient(180deg, #555577, #333355);
    transform: scale(1.05);
}

.btn-exit-confirm {
    background: linear-gradient(180deg, #8f2a2a, #5c1a1a);
    border-color: var(--color-danger);
    color: var(--color-text-bright);
}

.btn-exit-confirm:hover {
    background: linear-gradient(180deg, #ad3a3a, #7a2222);
    transform: scale(1.05);
}

.btn-icon {
    font-size: 1.4rem;
}

.footer-text {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 10px;
}

/* === PANEL SCREENS === */
.screen-panel {
    background: var(--color-panel-bg);
    border: 2px solid var(--color-panel-border);
    border-radius: 16px;
    padding: 40px;
    max-width: 650px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(78, 255, 145, 0.1),
                0 20px 60px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.screen-panel h2 {
    font-family: Impact, 'Arial Black', sans-serif;
    font-size: 2.5rem;
    color: var(--color-primary);
    text-shadow: var(--glow-green);
    margin-bottom: 25px;
    letter-spacing: 5px;
}

/* === HOW TO PLAY === */
.instructions-content {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.instruction-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    border-left: 3px solid var(--color-primary);
}

.step-num {
    background: var(--color-primary);
    color: #000;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.instruction-item p {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-text);
}

.instruction-item strong {
    color: var(--color-secondary);
}

.instruction-item em {
    color: var(--color-stink-green);
}

.danger-text {
    color: var(--color-danger);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
    animation: dangerPulse 1s ease-in-out infinite;
}

@keyframes dangerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* === CREDITS === */
.credits-panel {
    background: linear-gradient(180deg, rgba(15, 15, 30, 0.97), rgba(30, 20, 10, 0.97));
}

.credits-logo {
    font-size: 4rem;
    margin-bottom: 10px;
    animation: logoSpin 4s ease-in-out infinite;
}

@keyframes logoSpin {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
}

.studio-name {
    font-family: Impact, 'Arial Black', sans-serif;
    font-size: 2rem;
    color: var(--color-secondary);
    text-shadow: var(--glow-yellow);
    letter-spacing: 3px;
}

.credits-tagline {
    color: var(--color-stink-green);
    font-style: italic;
    margin: 10px 0 25px;
    font-size: 1.1rem;
}

.credits-roles {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.credit-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.credit-role {
    color: var(--color-text);
    font-size: 0.95rem;
}

.credit-name {
    color: var(--color-secondary);
    font-weight: bold;
    font-size: 0.95rem;
}

.credits-special {
    color: var(--color-stink-yellow);
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.credits-copy {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
}

/* === EXIT SCREEN === */
.exit-panel {
    text-align: center;
}

.exit-msg {
    font-size: 1.5rem;
    color: var(--color-text-bright);
    margin-bottom: 10px;
}

.exit-warning {
    font-size: 1.2rem;
    color: var(--color-stink-green);
    margin-bottom: 30px;
    animation: stinkFloat 2s ease-in-out infinite;
}

.exit-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.exit-buttons .menu-btn {
    width: 320px;
}

/* === GAME SCREEN === */
#game-screen {
    flex-direction: column;
}

#game-screen.active {
    display: flex;
}

.game-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: linear-gradient(180deg, rgba(15, 15, 30, 0.95), rgba(15, 15, 30, 0.7));
    border-bottom: 2px solid rgba(78, 255, 145, 0.2);
    z-index: 5;
    flex-shrink: 0;
}

.stench-meter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.meter-label {
    font-family: Impact, 'Arial Black', sans-serif;
    color: var(--color-stink-yellow);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.meter-bar {
    width: 200px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(127, 255, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #7fff00, #ccff00, #ffcc00, #ff6600, #ff0000);
    border-radius: 8px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(127, 255, 0, 0.5);
}

.meter-value {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--color-stink-green);
    font-size: 1rem;
    min-width: 45px;
}

.game-round {
    font-family: Impact, 'Arial Black', sans-serif;
    color: var(--color-secondary);
    font-size: 1.2rem;
    letter-spacing: 3px;
    text-shadow: var(--glow-yellow);
}

.btn-return-menu {
    padding: 8px 18px;
    font-size: 0.9rem;
    font-family: Impact, 'Arial Black', sans-serif;
    letter-spacing: 2px;
    background: linear-gradient(180deg, #444466, #2a2a44);
    border: 2px solid #6666aa;
    border-radius: 8px;
    color: var(--color-text-bright);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-return-menu:hover {
    background: linear-gradient(180deg, #555577, #333355);
    transform: scale(1.05);
}

/* === SCENE AREA === */
.scene-area {
    flex: 1;
    width: 100%;
    position: relative;
    min-height: 0;
    overflow: hidden;
}

#scene-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.scene-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

/* === NARRATIVE AREA === */
.narrative-area {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(180deg, rgba(10, 10, 25, 0.9), rgba(15, 15, 30, 0.95));
    border-top: 2px solid rgba(78, 255, 145, 0.15);
    flex-shrink: 0;
    min-height: 90px;
    max-height: 130px;
    overflow-y: auto;
}

.narrative-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--color-text);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.narrative-text .highlight {
    color: var(--color-secondary);
    font-weight: bold;
}

.narrative-text .stink {
    color: var(--color-stink-green);
    font-weight: bold;
    text-shadow: 0 0 8px rgba(127, 255, 0, 0.5);
}

.narrative-text .danger {
    color: var(--color-danger);
    font-weight: bold;
}

.narrative-text .name {
    color: #ff9f43;
    font-weight: bold;
}

/* === CHOICES AREA === */
.choices-area {
    width: 100%;
    padding: 12px 30px 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    background: rgba(10, 10, 25, 0.95);
    border-top: 1px solid rgba(78, 255, 145, 0.1);
    flex-shrink: 0;
}

.choice-btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-weight: bold;
    background: linear-gradient(180deg, rgba(78, 255, 145, 0.15), rgba(78, 255, 145, 0.05));
    border: 2px solid rgba(78, 255, 145, 0.4);
    border-radius: 8px;
    color: var(--color-text-bright);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 140px;
    text-align: center;
}

.choice-btn:hover {
    background: linear-gradient(180deg, rgba(78, 255, 145, 0.3), rgba(78, 255, 145, 0.15));
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 255, 145, 0.2);
}

.choice-btn:active {
    transform: translateY(0);
}

.choice-btn.suspect-btn {
    background: linear-gradient(180deg, rgba(255, 159, 67, 0.2), rgba(255, 159, 67, 0.08));
    border-color: rgba(255, 159, 67, 0.5);
}

.choice-btn.suspect-btn:hover {
    background: linear-gradient(180deg, rgba(255, 159, 67, 0.35), rgba(255, 159, 67, 0.15));
    border-color: #ff9f43;
    box-shadow: 0 5px 15px rgba(255, 159, 67, 0.3);
}

.choice-btn.accuse-btn {
    background: linear-gradient(180deg, rgba(255, 68, 68, 0.25), rgba(255, 68, 68, 0.1));
    border-color: rgba(255, 68, 68, 0.5);
    animation: accusePulse 1.5s ease-in-out infinite;
}

.choice-btn.accuse-btn:hover {
    background: linear-gradient(180deg, rgba(255, 68, 68, 0.4), rgba(255, 68, 68, 0.2));
    border-color: var(--color-danger);
    box-shadow: 0 5px 20px rgba(255, 68, 68, 0.4);
}

@keyframes accusePulse {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 68, 68, 0.2); }
    50% { box-shadow: 0 0 20px rgba(255, 68, 68, 0.4); }
}

/* === RESULT SCREEN === */
.result-panel {
    max-width: 700px;
}

.result-panel h2 {
    font-size: 3rem;
    margin-bottom: 15px;
}

.result-panel .result-subtitle {
    font-size: 1.3rem;
    color: var(--color-text);
    margin-bottom: 20px;
}

.result-panel .guilty-name {
    font-family: Impact, 'Arial Black', sans-serif;
    font-size: 3.5rem;
    color: var(--color-secondary);
    text-shadow: var(--glow-yellow);
    margin: 10px 0;
    animation: titleShake 0.3s ease-in-out infinite;
}

.result-panel .result-story {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--color-text);
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border-left: 3px solid var(--color-stink-green);
}

.result-correct {
    border-color: var(--color-primary) !important;
}

.result-wrong {
    border-color: var(--color-danger) !important;
}

.result-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.result-buttons .menu-btn {
    min-width: 200px;
}

/* === STENCH WAVE OVERLAY === */
.stench-wave {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, 
        rgba(127, 255, 0, 0.15) 0%, 
        rgba(127, 255, 0, 0.05) 40%, 
        transparent 70%);
    z-index: 100;
    pointer-events: none;
    animation: stenchWave 2s ease-out forwards;
}

@keyframes stenchWave {
    0% { opacity: 0; transform: scale(0.3); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: scale(3); }
}

/* Green fog overlay for high stench */
.green-fog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99;
    transition: opacity 1s ease;
}

/* === TYPEWRITER EFFECT === */
.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: var(--color-primary);
    margin-left: 2px;
    animation: blink 0.7s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* === FART CLOUD ANIMATION === */
.fart-cloud {
    position: fixed;
    font-size: 3rem;
    z-index: 200;
    pointer-events: none;
    animation: fartCloudFloat 3s ease-out forwards;
}

@keyframes fartCloudFloat {
    0% { opacity: 1; transform: scale(0.5) translateY(0); }
    50% { opacity: 0.8; transform: scale(1.5) translateY(-50px); }
    100% { opacity: 0; transform: scale(2.5) translateY(-120px); }
}

/* === SCREEN SHAKE === */
.screen-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translate(0); }
    10% { transform: translate(-5px, -3px); }
    20% { transform: translate(5px, 3px); }
    30% { transform: translate(-3px, 5px); }
    40% { transform: translate(3px, -5px); }
    50% { transform: translate(-5px, 3px); }
    60% { transform: translate(5px, -3px); }
    70% { transform: translate(-3px, -5px); }
    80% { transform: translate(3px, 5px); }
    90% { transform: translate(-5px, -3px); }
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(78, 255, 145, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(78, 255, 145, 0.5);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .title-who { font-size: 3rem; }
    .title-dealt { font-size: 4.5rem; }
    .title-it { font-size: 5.5rem; }
    .subtitle { font-size: 0.9rem; letter-spacing: 3px; }
    .menu-buttons { width: 280px; }
    .menu-btn { padding: 13px 20px; font-size: 1rem; }
    .screen-panel { padding: 25px; }
    .screen-panel h2 { font-size: 1.8rem; }
    .meter-bar { width: 120px; }
    .narrative-area { padding: 10px 15px; }
    .choices-area { padding: 10px 15px; }
    .choice-btn { padding: 10px 16px; font-size: 0.9rem; min-width: 110px; }
}

@media (max-width: 480px) {
    .title-who { font-size: 2.2rem; }
    .title-dealt { font-size: 3.2rem; }
    .title-it { font-size: 4rem; }
    .game-header { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
    .stench-meter { order: 1; flex: 1; }
    .game-round { order: 3; width: 100%; text-align: center; font-size: 1rem; }
    .btn-return-menu { order: 2; }
}
