:root {
    --primary: #ff0f39;
    --primary-dim: rgba(255, 15, 57, 0.2);
    --accent: #00f3ff;
    --bg: #050505;
}
body {
    margin: 0;
    overflow: hidden;
    background-color: var(--bg);
    color: white;
    font-family: 'Rajdhani', sans-serif;
    user-select: none;
}

#bg-canvas {
    position: fixed;
    top: 0; left: 0;
    z-index: 0;
    pointer-events: none;
}

.interface-layer {
    position: relative;
    z-index: 10;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.interface-layer.hidden-ui {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.glass-panel {
    background: rgba(10, 12, 16, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--primary-dim);
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
    max-width: 380px;
    width: 90%;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.pfp-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pfp-media {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 15px var(--primary);
    cursor: pointer;
    display: block;
    background: #000;
}

.spinner {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px dashed var(--primary);
    animation: spin 10s linear infinite;
    pointer-events: none;
    z-index: 1;
}
.spinner-outer { width: 140px; height: 140px; opacity: 0.5; border-width: 1px; }
.spinner-inner { width: 110px; height: 110px; border-style: solid; border-color: transparent var(--accent); animation-duration: 3s; border-width: 2px; }
@keyframes spin { 100% { transform: translate(-50%, -50%) rotate(360deg); } }

.tech-font { font-family: 'Share Tech Mono', monospace; }

.info-box {
    background: rgba(0, 0, 0, 0.4);
    border-left: 2px solid var(--primary);
    color: #d1d5db;
    padding: 10px 15px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    transition: all 0.3s ease;
}
.info-box i { width: 20px; text-align: center; color: var(--primary); }
.info-box span { font-family: 'Share Tech Mono', monospace; letter-spacing: 1px; color: var(--accent); }
.info-box a { text-decoration: none; color: var(--accent); transition: 0.3s; }
.info-box a:hover { color: white; text-shadow: 0 0 10px var(--accent); }

.action-btn {
    width: 100%;
    background: rgba(255, 15, 57, 0.1);
    border: 1px solid var(--primary);
    color: white;
    padding: 12px;
    text-transform: uppercase;
    font-family: 'Share Tech Mono', monospace;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
    letter-spacing: 2px;
}
.action-btn:hover {
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
}

.log-btn {
    margin-top: 10px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 0.75rem;
    letter-spacing: 2px;
    cursor: pointer;
}
.log-btn:hover { color: var(--accent); }

.game-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 100;
    background: #050505;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.game-overlay.active { opacity: 1; pointer-events: auto; }

.game-header {
    position: absolute; top: 20px;
    width: 100%; padding: 0 20px;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 110;
}
.game-canvas {
    background: #000;
    border: 2px solid var(--primary);
    box-shadow: 0 0 20px rgba(255,15,57,0.3);
    image-rendering: pixelated;
}
.game-msg {
    position: absolute;
    background: rgba(0,0,0,0.9);
    border: 1px solid var(--primary);
    padding: 20px;
    text-align: center;
    display: none;
    z-index: 120;
}
.game-msg.visible { display: block; }

.d-pad {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(3, 60px);
    gap: 5px;
    display: none;
}
@media (max-width: 768px) { .d-pad { display: grid; } }
.d-btn {
    width: 60px; height: 60px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--primary);
    color: white;
    font-size: 1.2rem;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}
.d-btn:active { background: var(--primary); }

.modal {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.95);
    display: none;
    align-items: center; justify-content: center;
}
.modal.open { display: flex; }

.term-container {
    width: 90%; max-width: 600px;
    height: 70vh;
    background: #0a0a0a;
    border: 1px solid #333;
    display: flex; flex-direction: column;
}
.term-header {
    background: #111; padding: 10px;
    border-bottom: 1px solid #333;
    display: flex; justify-content: space-between;
    color: #666; font-size: 0.8rem;
}
.term-body {
    padding: 20px; overflow-y: auto;
    color: var(--accent); font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    text-align: left;
}

.md-h1 { color: var(--primary); font-size: 1.1rem; border-bottom: 1px solid #333; margin-top: 15px; font-weight: bold; text-transform: uppercase; }
.md-h2 { color: white; margin-top: 15px; font-weight: bold; }
.md-list { padding-left: 10px; color: #888; }
.md-bold { color: #fff; font-weight: bold; }

.corner { position: absolute; width: 10px; height: 10px; border: 2px solid var(--primary); transition: 0.3s; }
.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.br { bottom: 0; right: 0; border-left: 0; border-top: 0; }
