/* =========================================
   GLOBAL RESET & UTILS (STABILITY LOCK)
   ========================================= */

html {
    width: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    width: 100%;
    min-height: 100vh; 
    position: relative;
    overflow-x: hidden; 
    touch-action: manipulation;
}

/* CRT Scanline Overlay */
body::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.1) 50%
    );
    background-size: 100% 4px; 
    z-index: 9999;
    pointer-events: none; 
    opacity: 0.6;
}

h1, h2, h3, p { margin: 0; }
a { text-decoration: none; color: inherit; }
* { box-sizing: border-box; }

/* The Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    z-index: 10000; 
    color: var(--text-main);
    backdrop-filter: blur(10px);
}

/* GLOBAL TOUCH FEEDBACK */
button:active, 
a.void-btn:active, 
a.cta-button:active,
.age-card:active {
    transform: scale(0.96) !important;
    opacity: 0.8;
    transition: transform 0.05s ease;
}

* { -webkit-tap-highlight-color: transparent; }

/* iOS INPUT ZOOM FIX */
@media screen and (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* THE LAST LINE INPUT STYLE */
#tkr-last-line {
    background: transparent;
    border: none;
    border-bottom: 2px solid #333;
    color: var(--text-main);
    font-family: 'Courier Prime', monospace;
    font-size: 1.2rem;
    padding: 10px 0;
    width: 100%;
    outline: none;
    transition: border-color 0.3s;
}
#tkr-last-line:focus {
    border-color: var(--accent-primary);
}

/* GLOBAL FOOTER */
.tkr-main-footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 20px;
    margin-top: 80px;
    text-align: center;
    background: var(--bg-app);
    position: relative;
    z-index: 10;
}

.tkr-footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.tkr-footer-logo {
    font-family: 'Courier Prime', monospace;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.tkr-footer-nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center; /* Ensures buttons align with text links */
}

.tkr-footer-nav a,
.tkr-footer-nav button {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s;
    opacity: 0.7;
}

.tkr-footer-nav a:hover,
.tkr-footer-nav button:hover {
    color: var(--accent-primary);
    opacity: 1;
}

/* GLITCH ANIMATIONS */
.glitching {
    animation: text-glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: var(--text-main);
}

@keyframes text-glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

/* --- PWA SMART BANNER --- */
.tkr-pwa-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px); /* Hidden initially */
    width: 90%;
    max-width: 400px;
    background: rgba(15, 15, 20, 0.95);
    border: 1px solid var(--accent-primary);
    border-radius: 16px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    z-index: 100000;
    backdrop-filter: blur(10px);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tkr-pwa-banner.visible {
    transform: translateX(-50%) translateY(0);
}

.pwa-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pwa-icon {
    font-size: 1.5rem;
    background: rgba(255,255,255,0.05);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.pwa-text strong {
    display: block;
    color: #fff;
    font-size: 0.9rem;
}

.pwa-text span {
    font-size: 0.75rem;
    color: #888;
}

.pwa-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-btn {
    background: var(--accent-primary);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.75rem;
    cursor: pointer;
}

.pwa-close {
    background: transparent;
    border: none;
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 5px;
}

/* Hide on Desktop */
@media (min-width: 1024px) {
    .tkr-pwa-banner { display: none; }
}

/* Mobile Tweak */
@media (max-width: 768px) {
    .tkr-main-footer { padding-bottom: 100px; }
}