/* ============================================
   ARCADE MAINFRAME - Shared Stylesheet
   ============================================ */

:root {
    --bg-primary: #020502;
    --bg-secondary: #050d05;
    --bg-input: #0a0a0a;
    --bg-logo: #000;
    --green-bright: #00ff66;
    --green-mid: #00aa44;
    --green-dark: #008833;
    --red-error: #ff4444;
    --orange-warn: #ff8800;
    --white-bright: #ffffff;
    --text-dim: #888888;
    --font-main: 'Courier New', Courier, monospace;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    color: var(--green-bright);
    font-family: var(--font-main);
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 90vh;
}

/* ---- CRT Scanline Background ---- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 102, 0.015),
        rgba(0, 255, 102, 0.015) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 9999;
}

/* ---- Header & Nav ---- */
.arcade-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 30px;
    border-bottom: 2px dashed var(--green-bright);
}

.logo-full {
    width: 100%;
    text-align: center;
    margin-bottom: 8px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.nav-link {
    color: var(--green-bright);
    text-decoration: none;
}

.nav-link:hover {
    text-shadow: 0 0 8px rgba(0,255,102,0.6);
}

.player-info {
    margin-right: 15px;
}

/* ---- Page Titles ---- */
h1 {
    color: var(--green-bright);
    text-align: center;
    letter-spacing: 3px;
    border-bottom: 2px dashed var(--green-bright);
    padding-bottom: 15px;
    margin-bottom: 30px;
    font-size: 24px;
    text-shadow: 0 0 8px rgba(0,255,102,0.4);
}

/* ---- Login / Signup Container ---- */
.screen-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Game Card Animations ---- */
.game-card {
    background: var(--bg-secondary);
    border: 2px dashed var(--green-bright);
    padding: 15px;
    box-shadow: 0 0 15px rgba(0,255,102,0.2);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, border-style 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-style: solid;
    box-shadow: 0 8px 35px rgba(0,255,102,0.6), inset 0 0 20px rgba(0,255,102,0.1);
}

.game-card .logo-box {
    transition: transform 0.3s ease;
}

.game-card:hover .logo-box {
    transform: scale(1.05);
}

/* ---- Launch Button Flicker ---- */
.launch-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0,255,102,0.2), transparent);
    transition: none;
}

.launch-btn:hover::before {
    animation: btnGlitch 0.6s ease infinite;
}

.launch-btn {
    position: relative;
    overflow: hidden;
}

@keyframes btnGlitch {
    0%   { left: -100%; }
    50%  { left: 200%; }
    100% { left: 200%; }
}

/* ---- Stats Bar Pulse ---- */
.stats-bar {
    background: var(--bg-secondary);
    border: 1px dashed var(--green-dark);
    padding: 10px 15px;
    margin-bottom: 25px;
    font-size: 13px;
    color: var(--text-dim);
    animation: statsPulse 3s ease-in-out infinite;
}

@keyframes statsPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(0,255,102,0.1), inset 0 0 5px rgba(0,255,102,0.05); }
    50%      { box-shadow: 0 0 15px rgba(0,255,102,0.3), inset 0 0 10px rgba(0,255,102,0.15); }
}

.stats-bar .stat-value {
    color: var(--green-bright);
    font-weight: bold;
    animation: statGlow 2s ease-in-out infinite alternate;
}

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

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

@keyframes statGlow {
    from { text-shadow: none; }
    to   { text-shadow: 0 0 8px rgba(0,255,102,0.7); }
}

/* ---- Game Grid (index) ---- */
.arcade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    flex: 1;
}

.game-card {
    background: var(--bg-secondary);
    border: 2px dashed var(--green-bright);
    padding: 15px;
    box-shadow: 0 0 15px rgba(0,255,102,0.2);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-style 0.2s, box-shadow 0.2s;
}

.game-card:hover {
    border-style: solid;
    box-shadow: 0 0 25px rgba(0,255,102,0.5);
}

.logo-box {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-logo);
    border: 1px solid var(--green-bright);
    margin-bottom: 15px;
    overflow: hidden;
}

.logo-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-placeholder {
    color: var(--green-mid);
    font-size: 13px;
}

.game-name {
    font-size: 18px;
    font-weight: bold;
    color: var(--white-bright);
    margin-bottom: 10px;
}

.game-info {
    font-size: 13px;
    color: var(--green-mid);
    line-height: 1.4;
    margin-bottom: 15px;
    flex-grow: 1;
}

.launch-btn {
    background: var(--bg-logo);
    color: var(--green-bright);
    border: 1px solid var(--green-bright);
    padding: 10px;
    text-decoration: none;
    font-family: var(--font-main);
    font-weight: bold;
    display: block;
    text-transform: uppercase;
}

.launch-btn:hover {
    background: var(--green-bright);
    color: var(--bg-logo);
}

/* ---- Auth Form Container (CRT Screen) ---- */

.auth-container {
    width: 520px;
    max-width: 92%;
    margin: 40px auto;
    padding: 0;
    border: 3px solid var(--green-bright);
    background: var(--bg-primary);
    position: relative;
    animation: authSlideIn 0.8s ease both, authScreenOn 0.6s ease both;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 2px;
    box-shadow: inset 0 0 60px rgba(0,255,102,0.08), 0 0 40px rgba(0,255,102,0.2);
    pointer-events: none;
}

.auth-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,255,102,0.02) 2px,
        rgba(0,255,102,0.02) 4px
    );
    pointer-events: none;
}

@keyframes authSlideIn {
    from { opacity: 0; transform: translateY(-40px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes authScreenOn {
    0%   { box-shadow: none, inset 0 0 0 rgba(0,255,102,0.8); filter: brightness(3); }
    40%  { box-shadow: inset 0 0 60px rgba(0,255,102,0.08), 0 0 60px rgba(0,255,102,0.5); filter: brightness(1.3); }
    100% { box-shadow: inset 0 0 60px rgba(0,255,102,0.08), 0 0 40px rgba(0,255,102,0.2); filter: brightness(1); }
}

.auth-container > .auth-header {
    background: var(--bg-secondary);
    border-bottom: 2px dashed var(--green-bright);
    padding: 20px 25px;
}

.auth-container > .auth-header h1 {
    margin: 0;
    border: none;
    padding: 0;
    font-size: 22px;
    text-align: left;
    letter-spacing: 4px;
}

.auth-container > .auth-body {
    padding: 30px 25px;
    position: relative;
    z-index: 1;
}

.auth-system-info {
    background: rgba(0,255,102,0.04);
    border-left: 2px solid var(--green-dark);
    padding: 10px 15px;
    margin-bottom: 25px;
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.8;
}

.auth-system-info span {
    color: var(--green-bright);
}

.auth-container h1::before {
    content: '>';
    animation: cursorBlink 1s step-end infinite;
    display: inline-block;
    margin-right: 4px;
}

.auth-container .form-group {
    margin-bottom: 20px;
}

label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--green-bright);
    margin-bottom: 8px;
    font-size: 13px;
    letter-spacing: 2px;
}

.btn-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 6px 14px;
    background: var(--bg-input);
    border: 1px dashed rgba(0,255,102,0.3);
    color: #00ff66;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.btn-label::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background: rgba(0,255,102,0.15);
    border: 1px solid #00ff66;
    flex-shrink: 0;
}

.label-icon {
    display: inline-block;
    width: 24px;
    height: 20px;
    background: rgba(0,255,102,0.08);
    border: 1px solid var(--green-dark);
    text-align: center;
    line-height: 18px;
    font-size: 12px;
    flex-shrink: 0;
}

.auth-container input[type="text"],
.auth-container input[type="password"],
.auth-container input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--green-dark);
    color: #00ff44;
    font-family: var(--font-main);
    font-size: 15px;
    letter-spacing: 1px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.auth-container input[type="text"]:focus,
.auth-container input[type="password"]:focus,
.auth-container input[type="email"]:focus {
    outline: none;
    border-color: var(--green-bright);
    border-style: solid;
    box-shadow: 0 0 20px rgba(0,255,102,0.3), inset 0 0 10px rgba(0,255,102,0.08);
    transform: scale(1.01);
}

.auth-container input::placeholder {
    color: var(--green-dark);
    font-size: 13px;
}

/* ---- Remember Me Checkbox ---- */
.remember-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.remember-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--bg-input);
    border: 1px solid var(--green-dark);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.remember-checkbox:checked {
    background: rgba(0,255,102,0.15);
    border-color: var(--green-bright);
    box-shadow: 0 0 8px rgba(0,255,102,0.3);
}

.remember-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--green-bright);
    font-size: 12px;
}

.remember-label {
    color: var(--text-dim);
    font-size: 12px;
    letter-spacing: 1px;
    cursor: pointer;
}

/* ---- Submit Button ---- */
.auth-container button[type="submit"],
.auth-btn {
    width: 100%;
    padding: 14px 20px;
    margin-top: 5px;
    background: transparent;
    border: 2px solid var(--green-bright);
    color: var(--green-bright);
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.auth-container button[type="submit"]::before,
.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0,255,102,0.3), transparent);
}

.auth-container button[type="submit"]:hover::before,
.auth-btn:hover::before {
    animation: btnSweep 1s ease infinite;
}

.auth-container button[type="submit"]:hover,
.auth-btn:hover {
    background: rgba(0,255,102,0.12);
    box-shadow: 0 0 30px rgba(0,255,102,0.4), inset 0 0 15px rgba(0,255,102,0.1);
    transform: translateY(-1px);
}

.auth-container button[type="submit"]:active {
    transform: translateY(0);
    background: rgba(0,255,102,0.2);
}

@keyframes btnSweep {
    from { left: -100%; }
    to   { left: 200%; }
}

/* ---- Auth Footer Links ---- */
.auth-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed var(--green-dark);
    text-align: center;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 2;
}

.auth-footer a {
    color: var(--green-bright);
    text-decoration: none;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    padding: 4px 8px;
}

.auth-footer a:hover {
    text-shadow: 0 0 12px rgba(0,255,102,0.9);
    background: rgba(0,255,102,0.06);
}

/* ---- Feedback Messages ---- */
.error-list {
    color: var(--red-error);
    font-size: 13px;
    margin-bottom: 20px;
    list-style: none;
    padding: 0;
}

.error-list li::before {
    content: '⚠ ';
}

.success-msg {
    color: var(--orange-warn);
    text-align: center;
    margin-bottom: 20px;
    font-size: 14px;
    padding: 12px;
    border: 1px dashed var(--green-dark);
    background: rgba(0,255,102,0.03);
}

/* ---- Decorative Corner Markers ---- */
.auth-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .auth-container {
        margin-top: 20px;
        margin-bottom: 20px;
    }
    
    .auth-container > .auth-header h1 {
        font-size: 18px;
        letter-spacing: 2px;
    }
}

/* ---- Screen flicker animation for errors ---- */
@keyframes screenFlicker {
    0%, 95%, 100% { opacity: 1; filter: none; }
    96%   { opacity: 0.8; filter: brightness(2) hue-rotate(30deg); }
    97%   { opacity: 1; filter: none; }
}

.error-list.shake {
    animation: screenFlicker 0.4s ease;
}

/* ---- Footer ---- */
.arcade-footer {
    margin-top: 5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    color: #00ff66;
    font-size: 12px;
    border-top: 1px dashed rgba(0, 255, 102, 0.3);
    text-align: center;
    clear: both;
    width: 100%;
}

.arcade-footer p {
    margin: 0;
}
