/* ==========================================================================
  Tag Mania — Stylesheet
  Sign-in screen restyled to match the jymer1102 portfolio's design
  language (glow, borders, gradients, cursors). In-game elements
  (#game-container, canvas, #notification-box, #status-box, joystick)
  are copied from the original inline styles unchanged.
  ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(30, 86, 224, 0.85);
    --accent-bright: #4FA9FF;
    --accent-glow: rgba(30, 86, 224, 0.35);
    --bg-card-from: #131318;
    --bg-card-to: #17171d;
    --text-3: #6c6c75;
    --font-display: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius-lg: 16px;
    --ease: cubic-bezier(0.22, 0.8, 0.28, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #0d0d11;
    background-image:
        radial-gradient(circle at 15% 0%, rgba(30, 86, 224, 0.08), transparent 40%),
        radial-gradient(circle at 85% 20%, rgba(30, 86, 224, 0.05), transparent 35%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
}

/* Custom cursors — CSS file lives at frontend/css/style.css, images live
   at (root)/images/cursor/, so we go up two levels. */
html, body {
    cursor: url('../../images/cursor/custom-j-cursor.png') 0 0, default;
}
#start-btn, #color-picker, #username-input, label,
button, input, select, a, [role="button"],
.glow-input-wrapper, .glow-input-display,
#joystick-zone, #joystick-stick {
    cursor: url('../../images/cursor/custom-j-cursor-pointer.png') 0 0, pointer;
}

/* --------------------------------------------------------------------------
  Sign-in Card — glow, border, and gradient treatment matching
  .js-interactive-container / .split-card from the portfolio
  -------------------------------------------------------------------------- */
#login-screen {
    position: relative;
    overflow: hidden;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(160deg, var(--bg-card-from), var(--bg-card-to));
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    width: 90%;
    max-width: 350px;
    text-align: center;
    transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

#login-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 20%), var(--accent-glow), transparent 65%);
    opacity: 0;
    transition: opacity 0.35s var(--ease);
    pointer-events: none;
    z-index: 1;
}

#login-screen:hover::before,
#login-screen:focus-within::before {
    opacity: 1;
}

#login-screen:hover,
#login-screen:focus-within {
    border-color: var(--border-hover);
    box-shadow: 0 0 20px var(--accent-glow);
}

#login-screen > * {
    position: relative;
    z-index: 2;
}

#login-screen h1 {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: linear-gradient(120deg, #ffffff 0%, #ffffff 45%, var(--accent-bright) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.server-status-wrapper {
    font-family: var(--font-mono);
    font-size: 13px;
    color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-weight: bold;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 193, 7, 0.2);
    display: inline-block;
    transition: all 0.3s var(--ease);
}

#login-screen label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-3);
    font-weight: 500;
    text-align: left;
    width: 100%;
    display: block;
    margin-bottom: 6px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
  Username field — custom glow caret (matches the portfolio's contact
  form pattern). A real, invisible input captures keystrokes; a display
  div underneath shows the typed text plus a fake blinking caret that
  CAN glow, since native browser carets can't have a box-shadow.
  -------------------------------------------------------------------------- */
.glow-input-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.glow-input-hidden {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 14px;
    font-size: 16px;
    border: none;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    outline: none;
    opacity: 0;
    z-index: 2;
    cursor: text;
}

.glow-input-display {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    min-height: 48px;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #181822;
    color: #fff;
    pointer-events: none;
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.glow-input-display .placeholder-text {
    color: #5a5a6a;
}

.glow-input-hidden:focus + .glow-input-display {
    border-color: var(--border-hover);
    box-shadow: 0 0 20px var(--accent-glow);
}

.custom-caret {
    display: none;
    width: 2px;
    height: 1.2em;
    background-color: var(--accent-bright);
    box-shadow:
        0 0 6px var(--accent-bright),
        0 0 12px var(--accent-bright),
        0 0 20px var(--accent-glow);
    margin-left: 1px;
    animation: caretBlink 1s infinite;
}

.glow-input-wrapper.is-focused .custom-caret {
    display: inline-block;
}

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

#login-screen input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 100%;
    height: 48px;
    border-radius: 10px;
    cursor: url('../../images/cursor/custom-j-cursor-pointer.png') 0 0, pointer;
    background: none;
    margin-bottom: 28px;
}
#login-screen input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}
#login-screen input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
#login-screen input[type="color"]:hover::-webkit-color-swatch,
#login-screen input[type="color"]:focus::-webkit-color-swatch {
    border-color: var(--border-hover);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3), 0 0 20px var(--accent-glow);
}

#login-screen button {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
    cursor: url('../../images/cursor/custom-j-cursor-pointer.png') 0 0, pointer;
    border: 1px solid transparent;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
    transition: background 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
#login-screen button:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
    border-color: var(--border-hover);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.6), 0 0 20px var(--accent-glow);
}
#login-screen button:disabled {
    background: #2a2a35;
    color: #5a5a6a;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    border-color: transparent;
}
#login-screen button:focus-visible {
    outline: 2px solid var(--accent-bright);
    outline-offset: 4px;
}

/* ==========================================================================
  Everything below this line is unchanged in-game styling, copied as-is
  from the original inline <style> block.
  ========================================================================== */

#game-container {
    display: none !important;
    position: relative;
    width: 100vw;
    height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
}
canvas {
    border: 4px solid var(--border-hover);
    border-radius: 12px;
    display: block;
    box-shadow: 0 12px 36px rgba(0,0,0,0.7), 0 0 20px var(--accent-glow);
    margin: 0 auto;
}

#notification-box {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 123, 255, 0.95);
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 100;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

#status-box {
    position: absolute;
    top: 65px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(13, 13, 17, 0.9);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    border: 1px solid var(--border);
    z-index: 10;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

#status-box:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5), 0 0 20px var(--accent-glow);
}

#joystick-zone {
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.06);
    border: 2px solid var(--border);
    border-radius: 50%;
    touch-action: none;
    z-index: 5;
    position: absolute;
    bottom: 30px;
    left: calc(50% - 50px);
    transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

#joystick-zone:hover,
#joystick-zone:active {
    border-color: var(--border-hover);
    box-shadow: 0 0 20px var(--accent-glow);
}
#joystick-stick {
    width: 42px;
    height: 42px;
    background: #007bff;
    border-radius: 50%;
    position: absolute;
    top: 29px;
    left: 29px;
    box-shadow: 0 4px 12px rgba(0,123,255,0.5);
}
