  :root{
    --beam-near: rgba(255, 214, 90, 0.45);
    --beam-mid:  rgba(255, 214, 90, 0.16);
    --beam-far:  rgba(255, 214, 90, 0.02);
    --amber: 255, 214, 90;
  }

  * { box-sizing: border-box; }

  html, body {
    height: 100%;
    margin: 0;
    background: #05080c;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
  }

  .font-display { font-family: 'Playfair Display', serif; }

  /* ---------- Base night sky ---------- */
  .night-sky {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
      radial-gradient(ellipse 60% 40% at 20% 0%, rgba(255, 214, 90, 0.05), transparent 60%),
      radial-gradient(ellipse 120% 80% at 50% 100%, #0a0e14 0%, #05080c 60%);
  }

  .stars {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image:
      radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.5), transparent),
      radial-gradient(1px 1px at 30% 8%, rgba(255,255,255,0.35), transparent),
      radial-gradient(1.5px 1.5px at 55% 20%, rgba(255,255,255,0.4), transparent),
      radial-gradient(1px 1px at 70% 5%, rgba(255,255,255,0.3), transparent),
      radial-gradient(1px 1px at 85% 12%, rgba(255,255,255,0.45), transparent),
      radial-gradient(1.5px 1.5px at 15% 35%, rgba(255,255,255,0.25), transparent),
      radial-gradient(1px 1px at 40% 40%, rgba(255,255,255,0.3), transparent);
    background-repeat: no-repeat;
    opacity: 0.6;
  }

  /* ---------- Ambient glow (large, soft, no clip) ---------- */
  .light-glow {
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    filter: blur(60px);
    transition: opacity 0.6s ease;
  }

  /* ---------- Cinematic diagonal beam (clipped cone) ---------- */
  .light-beam {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    filter: blur(4px);
    mix-blend-mode: screen;
    transition: opacity 0.6s ease;
  }

  body.lamp-on .light-beam { opacity: 1; }
  body.lamp-on .light-glow { opacity: 1; }

  /* subtle flicker on ignition */
  body.lamp-flicker .light-beam,
  body.lamp-flicker .light-glow { animation: flicker 0.7s steps(1, end) 1; }
  @keyframes flicker {
    0%   { opacity: 0; }
    15%  { opacity: 0.8; }
    30%  { opacity: 0.1; }
    45%  { opacity: 0.9; }
    60%  { opacity: 0.2; }
    100% { opacity: 1; }
  }

  /* ---------- Lamp post (anchored between top and the road) ---------- */
  .lamp-post { position: absolute; top: 8%; bottom: 24%; left: 38%; z-index: 20; }

  .lamp-arm {
    position: absolute;
    top: 0;
    left: 0;
    width: 90px;
    height: 6px;
    background: linear-gradient(90deg, #1a1f28, #2b323e);
    border-radius: 3px;
    transform-origin: right center;
  }

  .lamp-pole {
    position: absolute;
    top: 0;
    left: -6px;
    width: 8px;
    height: 100%;
    background: linear-gradient(90deg, #10141b, #2b323e 40%, #10141b);
    border-radius: 3px;
  }

  .lamp-base {
    position: absolute;
    top: calc(100% - 4px);
    left: -20px;
    width: 40px;
    height: 14px;
    background: linear-gradient(180deg, #2b323e, #10141b);
    border-radius: 4px 4px 8px 8px;
    z-index: 2;
  }

  /* ---------- Street / road with one-point perspective ---------- */
  .road {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 24%;
    z-index: 15;
    background: linear-gradient(180deg, #2a2f38 0%, #21252c 100%);
    clip-path: polygon(39% 0%, 61% 0%, 100% 100%, 0% 100%);
    overflow: hidden;
  }
  .road::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #14171d 0%, #0a0c10 100%);
    clip-path: polygon(41% 5%, 59% 5%, 96% 97%, 4% 97%);
  }
  .lane-marking {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 24%;
    z-index: 16;
    pointer-events: none;
    clip-path: polygon(49.3% 6%, 50.7% 6%, 54% 96%, 46% 96%);
    background: repeating-linear-gradient(
      180deg,
      rgba(255, 214, 90, 0.4) 0%,
      rgba(255, 214, 90, 0.4) 10%,
      transparent 10%,
      transparent 20%
    );
  }
  .road-glow {
    position: absolute;
    inset: 0;
    z-index: 16;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
    background: radial-gradient(ellipse 55% 90% at 38% 0%, rgba(255,214,90,0.35), transparent 70%);
    filter: blur(6px);
  }
  body.lamp-on .road-glow { opacity: 1; }

  .lamp-glass-box {
    position: absolute;
    top: -40px;
    left: -16px;
    width: 40px;
    height: 40px;
    padding: 4px;
    border-radius: 7px;
    background: #0a0a0a;
    border: 2px solid #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
      0 4px 10px rgba(0,0,0,0.6),
      inset 0 0 0 1px rgba(255,255,255,0.04);
  }

  .bulb-core {
    width: 100%;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(180deg, #3a3a3d, #1c1c1f);
    transition: background 0.4s ease, box-shadow 0.4s ease;
  }

  body.lamp-on .bulb-core {
    background: linear-gradient(180deg, #fff8e4, #ffd97a);
    box-shadow:
      0 0 10px 3px rgba(255, 214, 90, 0.95),
      0 0 26px 10px rgba(255, 214, 90, 0.55),
      0 0 58px 22px rgba(255, 214, 90, 0.28);
  }

  /* ---------- Right panel login card ---------- */
  .login-card {
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(14px);
    transition:
      opacity 0.5s ease 0.1s,
      transform 0.5s ease 0.1s,
      box-shadow 0.5s ease 0.1s;
    background: linear-gradient(180deg, rgba(38, 30, 18, 0.75), rgba(16, 12, 9, 0.9));
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 214, 90, 0.14);
  }

  body.lamp-on .login-card {
    opacity: 1;
    transform: translateY(0);
    box-shadow:
      0 0 0 1px rgba(255, 214, 90, 0.12),
      0 25px 60px -15px rgba(0, 0, 0, 0.8),
      0 0 45px -8px rgba(255, 214, 90, 0.35);
    animation: cardFloat 6s ease-in-out 0.6s infinite;
  }

  @keyframes cardFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
  }

  .card-light {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(140deg,
      rgba(255, 214, 90, 0.4) 0%,
      rgba(255, 214, 90, 0.14) 32%,
      transparent 62%);
    mix-blend-mode: overlay;
    opacity: 0;
    transition: opacity 0.7s ease 0.2s;
  }
  body.lamp-on .card-light { opacity: 1; }

  .login-card > * { position: relative; z-index: 1; }

  .input-field {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
  }
  .input-field:focus {
    outline: none;
    border-color: rgba(255, 214, 90, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 214, 90, 0.08);
  }

  .btn-signin {
    background: linear-gradient(180deg, #f2c14e, #d99a2b);
    color: #1a1306;
    transition: filter 0.25s ease, transform 0.2s ease;
  }
  .btn-signin:hover { filter: brightness(1.08); transform: translateY(-1px); }

  .lamp-toggle-hint {
    animation: pulse-hint 2.4s ease-in-out infinite;
  }
  @keyframes pulse-hint {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
  }

  /* ---------- On / off switch ---------- */
  .lamp-switch {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
  }
  .switch-track {
    position: relative;
    width: 52px;
    height: 28px;
    border-radius: 999px;
    background: #1c2028;
    border: 1px solid rgba(255,255,255,0.1);
    transition: background 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  }
  .switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #7a7f89;
    transition: transform 0.35s ease, background 0.35s ease;
  }
  #lampToggle:checked ~ .switch-track {
    background: linear-gradient(180deg, #f2c14e, #d99a2b);
    border-color: rgba(255, 214, 90, 0.6);
    box-shadow: 0 0 14px rgba(255, 214, 90, 0.55);
  }
  #lampToggle:checked ~ .switch-track .switch-thumb {
    transform: translateX(24px);
    background: #1a1306;
  }
  .switch-label {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    transition: color 0.35s ease;
  }
  #lampToggle:checked ~ .switch-label { color: rgba(255, 214, 90, 0.85); }

  .site-credit {
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
  }
  .site-credit span { color: rgba(255, 214, 90, 0.65); }

  /* ---------- Fullscreen toggle ---------- */
  .fullscreen-btn {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 50;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(10, 13, 18, 0.55);
    border: 1px solid rgba(255, 214, 90, 0.18);
    backdrop-filter: blur(8px);
    color: rgba(255, 214, 90, 0.85);
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
  }
  .fullscreen-btn:hover {
    background: rgba(255, 214, 90, 0.12);
    border-color: rgba(255, 214, 90, 0.4);
    transform: translateY(-1px);
  }
  .fullscreen-btn svg { width: 18px; height: 18px; }
  .fullscreen-btn .icon-compress { display: none; }
  body.is-fullscreen .fullscreen-btn .icon-expand { display: none; }
  body.is-fullscreen .fullscreen-btn .icon-compress { display: block; }

  @media (max-width: 1023px) {
    .lamp-post { left: 50%; top: 6%; bottom: 24%; transform: translateX(-50%); }
    .road { height: 24%; }
  }

  @media (max-width: 639px) {
    .lamp-glass-box { width: 34px; height: 34px; top: -34px; }
    .lamp-post { top: 5%; bottom: 22%; }
    .road, .lane-marking { height: 22%; }
  }
