/* Wolfagestein 3D Cyber Theme Stylesheet */
:root {
    --gold-accent: #eab308;
    --gold-accent-glow: rgba(234, 179, 8, 0.25);
    --gold-bright: #fef08a;
    --red-accent: #ef4444;
    --red-glow: rgba(239, 68, 68, 0.3);
    --dark-bg: #030712;
    --card-bg: rgba(17, 24, 39, 0.85);
    --border-color: rgba(234, 179, 8, 0.15);
    --border-hover: rgba(234, 179, 8, 0.45);
    --text-light: #f3f4f6;
    --text-muted: #9ca3af;
}

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

body.wolfstein-body {
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    padding-top: 40px;
    padding-bottom: 40px;
}

/* Ambient Cyberpunk Glows */
.wolfstein-atmosphere {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
    animation: orbFloat 12s infinite alternate ease-in-out;
}

.orb-gold {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--gold-accent) 0%, transparent 70%);
    top: -100px;
    right: -100px;
}

.orb-red {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--red-accent) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
}

@keyframes orbFloat {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.15) translate(40px, 30px); }
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(234, 179, 8, 0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(234, 179, 8, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.wolfstein-shell {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Header style */
.wolfstein-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(234, 179, 8, 0.1);
    padding-bottom: 20px;
}

.wolfstein-kicker {
    color: var(--gold-accent);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 3px;
    margin-bottom: 4px;
    text-shadow: 0 0 8px var(--gold-accent-glow);
}

.wolfstein-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, var(--gold-accent), #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
}

.wolfstein-copy {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.wolfstein-backlink {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid rgba(234, 179, 8, 0.25);
    background: rgba(234, 179, 8, 0.05);
    color: var(--gold-accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.wolfstein-backlink:hover {
    background: var(--gold-accent);
    color: #000;
    box-shadow: 0 0 15px var(--gold-accent-glow);
}

/* Stage shell wrapper */
.wolfstein-stage-wrapper {
    position: relative;
    width: 100%;
    min-height: 520px;
    background: rgba(10, 11, 15, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 24px;
    backdrop-filter: blur(15px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
}

.wolfstein-screen {
    display: none;
    width: 100%;
    height: 100%;
}

.wolfstein-screen.active {
    display: block;
}

/* Character Select Screen */
.setup-card {
    max-width: 500px;
    margin: 0 auto;
    background: rgba(17, 24, 39, 0.5);
    border: 1px solid rgba(234, 179, 8, 0.1);
    border-radius: 20px;
    padding: 30px;
}

.setup-header {
    text-align: center;
    margin-bottom: 24px;
}

.setup-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(234, 179, 8, 0.1);
    color: var(--gold-accent);
    border: 1px solid rgba(234, 179, 8, 0.2);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.setup-header h2 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 6px;
}

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

.guest-warning-banner {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.4;
}

.guest-warning-banner a {
    color: var(--gold-accent);
    text-decoration: underline;
    font-weight: 600;
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.select-wrap {
    position: relative;
    width: 100%;
}

.select-wrap select {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(234, 179, 8, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    font-size: 0.95rem;
    appearance: none;
    outline: none;
    transition: all 0.3s;
}

.select-wrap select:focus {
    border-color: var(--gold-accent);
    box-shadow: 0 0 10px var(--gold-accent-glow);
}

.select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold-accent);
    font-size: 0.75rem;
    pointer-events: none;
}

.input-wrap-row {
    display: flex;
    gap: 12px;
}

.input-wrap {
    position: relative;
    flex: 1;
}

.input-wrap input {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(234, 179, 8, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s;
}

.input-wrap input:focus {
    border-color: var(--gold-accent);
    box-shadow: 0 0 10px var(--gold-accent-glow);
}

.wolfstein-btn {
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    outline: none;
}

.wolfstein-btn-primary {
    background: linear-gradient(135deg, var(--gold-accent), #f97316);
    color: #000;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(234, 179, 8, 0.3);
}

.wolfstein-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(234, 179, 8, 0.5);
    background: linear-gradient(135deg, var(--gold-bright), var(--gold-accent));
}

.wolfstein-btn-secondary {
    background: rgba(234, 179, 8, 0.08);
    color: var(--gold-accent);
    border: 1px solid rgba(234, 179, 8, 0.25);
}

.wolfstein-btn-secondary:hover {
    background: rgba(234, 179, 8, 0.18);
    border-color: var(--gold-accent);
}

/* Fighter Preview Box */
.fighter-preview-box {
    background: rgba(10, 11, 15, 0.9);
    border: 1px solid rgba(234, 179, 8, 0.15);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    margin-bottom: 20px;
    position: relative;
}

.fighter-preview-box img {
    max-height: 100px;
    max-width: 100px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 8px rgba(234, 179, 8, 0.3));
    margin-bottom: 10px;
    transition: transform 0.3s;
}

.fighter-preview-box img:hover {
    transform: scale(1.1);
}

.preview-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold-accent);
    letter-spacing: 0.5px;
}

.preview-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(234, 179, 8, 0.1);
    border-top: 3px solid var(--gold-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.verify-status {
    font-size: 0.8rem;
    text-align: center;
    margin-top: 12px;
    font-weight: 600;
}

/* 3D Game Play Screen */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.canvas-viewport {
    position: relative;
    border: 4px solid #111827;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    overflow: hidden;
    width: 640px;
    height: 400px;
    background: #000;
    cursor: crosshair;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Pointer Lock Prompt screen overlay */
.pointer-lock-prompt {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    cursor: pointer;
    transition: opacity 0.3s;
}

.pointer-lock-prompt span {
    font-size: 1.25rem;
    font-weight: 800;
    color: #000;
    background: var(--gold-accent);
    padding: 16px 28px;
    border-radius: 12px;
    box-shadow: 0 0 20px var(--gold-accent-glow);
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pulsePrompt 1.5s infinite alternate;
}

@keyframes pulsePrompt {
    0% { transform: scale(1); box-shadow: 0 0 15px rgba(234,179,8,0.4); }
    100% { transform: scale(1.05); box-shadow: 0 0 30px rgba(234,179,8,0.7); }
}

/* CRT Shader elements */
.crt-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
    z-index: 5;
}

.vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.85);
    pointer-events: none;
    z-index: 6;
}

/* Damage flash screen */
.damage-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(239, 68, 68, 0.35);
    opacity: 0;
    pointer-events: none;
    z-index: 7;
    transition: opacity 0.05s ease-out;
}

/* Retro Status HUD Bar */
.status-hud {
    width: 640px;
    background: #0f172a;
    border: 3px solid #1e293b;
    border-radius: 8px;
    display: flex;
    justify-content: space-around;
    padding: 10px;
    color: #cbd5e1;
    font-family: monospace;
    font-size: 1rem;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

.hud-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 2px solid #334155;
    flex: 1;
}

.hud-block:last-child {
    border-right: none;
}

.hud-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: #94a3b8;
    margin-bottom: 2px;
    letter-spacing: 1px;
}

.hud-value {
    font-size: 1.3rem;
    font-weight: 900;
    color: #f1f5f9;
}

.font-gold {
    color: var(--gold-accent) !important;
}

.font-red {
    color: var(--red-accent) !important;
}

.hud-face-block {
    flex: 1.3;
}

.hud-health-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hud-face-container {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1e293b;
    border: 1px solid #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    overflow: hidden;
}

.hud-face {
    animation: chew 0.5s ease-in-out infinite alternatePaused;
}

/* Guide modal overlay styles */
.guide-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.guide-modal.active {
    display: flex;
}

.guide-content {
    background: #0f172a;
    border: 2px solid var(--gold-accent);
    border-radius: 24px;
    width: 90%;
    max-width: 550px;
    padding: 32px;
    box-shadow: 0 0 35px var(--gold-accent-glow);
}

.guide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(234,179,8,0.15);
    padding-bottom: 12px;
}

.guide-header h2 {
    color: var(--gold-accent);
    font-size: 1.4rem;
}

.close-guide-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-guide-btn:hover {
    color: var(--red-accent);
}

.guide-body h3 {
    font-size: 1.05rem;
    color: #fff;
    margin-top: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.guide-body ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 16px;
}

.guide-body li {
    font-size: 0.88rem;
    color: var(--text-light);
    margin-bottom: 6px;
    line-height: 1.4;
}

.guide-body p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Wasted / Victory screens overlays */
.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 50;
    border-radius: 24px;
}

.overlay-screen.active {
    display: flex;
}

.overlay-card {
    background: #0a0b0f;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.card-fail {
    border: 2px solid var(--red-accent);
    box-shadow: 0 0 30px var(--red-glow);
}

.card-fail h2 {
    font-size: 3rem;
    font-weight: 900;
    color: var(--red-accent);
    letter-spacing: 4px;
    margin-bottom: 10px;
    animation: shake 0.3s infinite alternate;
}

.card-success {
    border: 2px solid var(--gold-accent);
    box-shadow: 0 0 30px var(--gold-accent-glow);
}

.card-success h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gold-accent);
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.overlay-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.overlay-stats {
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    font-family: monospace;
    font-size: 1.05rem;
}

.overlay-stats div {
    margin-bottom: 6px;
}

.overlay-stats div:last-child {
    margin-bottom: 0;
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    100% { transform: translate(-1px, -1px) rotate(-1deg); }
}

/* Responsiveness logic for mobile views */
@media (max-width: 700px) {
    .canvas-viewport {
        width: 100%;
        height: auto;
        aspect-ratio: 1.6;
    }
    
    .status-hud {
        width: 100%;
        font-size: 0.85rem;
    }
    
    .hud-value {
        font-size: 1rem;
    }
}

/* Mobile virtual controller styles */
.mobile-controls-overlay {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

body.touch-controls-active .mobile-controls-overlay {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 15px;
}

.mobile-controls-overlay button {
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
}

/* Joystick Styles */
.joystick-container {
    width: 130px;
    height: 130px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

.joystick-base {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(234, 179, 8, 0.08);
    border: 3px solid rgba(234, 179, 8, 0.4);
    position: relative;
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.15), inset 0 0 10px rgba(234, 179, 8, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.joystick-base:hover {
    opacity: 0.85;
}

.joystick-base:active,
.joystick-base.joystick-active {
    opacity: 1;
}

.joystick-thumb {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gold-accent);
    border: 2px solid var(--gold-bright, #ffedd5);
    position: absolute;
    box-shadow: 0 0 12px var(--gold-accent-glow);
    touch-action: none;
}

/* Camera Touch Zone absolute positioning */
.camera-touch-zone {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    pointer-events: auto;
    z-index: 4;
    touch-action: none;
}

.btn-attack {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.2);
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.15s ease;
    box-shadow: 0 0 15px rgba(239,68,68,0.25);
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.btn-attack:active {
    background: var(--red-accent);
    box-shadow: 0 0 25px var(--red-accent);
    transform: scale(0.92);
}

/* Action Container */
.action-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    z-index: 6;
    pointer-events: auto;
}

.weapon-select-row {
    display: flex;
    gap: 5px;
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 4px;
}

.weapon-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(17, 24, 39, 0.8);
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.1s;
}

.weapon-btn.active-weapon {
    border-color: var(--gold-accent) !important;
    color: var(--gold-accent) !important;
    box-shadow: 0 0 8px var(--gold-accent);
}

.weapon-btn:active {
    transform: scale(0.9);
}

/* Fullscreen Button Styling */
.fullscreen-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(234, 179, 8, 0.25);
    border-radius: 8px;
    color: var(--gold-accent);
    font-weight: 700;
    padding: 8px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 110;
    backdrop-filter: blur(8px);
}

.fullscreen-btn:hover {
    background: rgba(234, 179, 8, 0.15);
    border-color: var(--gold-accent);
    transform: translateY(-1px);
    box-shadow: 0 0 10px var(--gold-accent-glow);
}

/* Fullscreen mode layout overrides */
#wolfsteinStageWrapper:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    aspect-ratio: auto;
    border-radius: 0;
    border: none;
}
#wolfsteinStageWrapper:fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    aspect-ratio: auto;
    border-radius: 0;
    border: none;
}
#wolfsteinStageWrapper:fullscreen .wolfstein-screen.active {
    width: 100vw !important;
    height: 100vh !important;
    margin: auto !important;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: relative;
    justify-content: center;
    align-items: center;
    background: #030712;
}
#wolfsteinStageWrapper:fullscreen .game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 10px;
    box-sizing: border-box;
    gap: 8px;
}
#wolfsteinStageWrapper:fullscreen .canvas-viewport {
    position: relative;
    aspect-ratio: 1.6;
    height: auto;
    width: 100%;
    max-height: calc(100vh - 100px);
    max-width: calc((100vh - 100px) * 1.6);
    box-sizing: border-box;
    flex: none;
}
