/* ─── PHANTOM — STYLE.CSS (PRODUCTION) ──────────────────────────
   Lethal-Sharpness rules applied to every small label:
   • font-weight: 900
   • font-size:   19px on labels / 13–14px on hints
   • text-shadow: none everywhere except the neon LOGO
─────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black: #000000;
  --purple: #B042FF;
  --purple-dim: #7a1fbf;
  --purple-glow: rgba(176, 66, 255, 0.40);
  --purple-glow-sm: rgba(176, 66, 255, 0.18);
  --text: #e0e0e0;
  --text-dim: #888888;
  --danger: #ff3c3c;
}

html, body {
  height: 100%;
  background: var(--black);
  color: var(--text);
  font-family: 'Courier New', Courier, monospace;
  font-size: 15px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

/* ── SCANLINE OVERLAY ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 3px,
    rgba(0,0,0,0.09) 3px, rgba(0,0,0,0.09) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ── ANNOUNCEMENT BAR ── */
#announcement-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--purple);
  color: #ffffff;
  font-size: 14px; font-weight: 900;
  letter-spacing: 0.08em;
  padding: 9px 40px 9px 16px;
  text-align: center;
  text-shadow: none;
  animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

#ann-close {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none;
  color: rgba(255,255,255,0.85);
  font-size: 1rem; font-weight: 900; cursor: pointer;
  padding: 4px 6px; line-height: 1;
}
#ann-close:hover { color: #ffffff; }

/* ── AD BANNER ── */
#ad-bar {
  flex-shrink: 0;
  background: #0d0010;
  border-top: 1px solid var(--purple-dim);
  border-bottom: 1px solid var(--purple-dim);
}
#ad-bar a {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px;
  color: var(--purple);
  text-decoration: none;
  font-size: 14px; font-weight: 900;
  letter-spacing: 0.06em;
  text-shadow: none;
  transition: color 0.2s;
}
#ad-bar a:hover { color: #ffffff; }
.ad-arrow { font-size: 0.95rem; font-weight: 900; }

/* ── SCREENS ── */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 20px;
  animation: fadeIn 0.4s ease;
  overflow-y: auto;
}
.screen.active { display: flex; }

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

/* ── LOGO — only place that keeps a glow ── */
@keyframes neonFlicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% {
    text-shadow:
      0 0 10px var(--purple),
      0 0 30px var(--purple),
      0 0 70px var(--purple),
      0 0 100px var(--purple-dim);
    opacity: 1;
  }
  20%, 24%, 55% { text-shadow: none; opacity: 0.82; }
}
.logo {
  font-size: clamp(3rem, 12vw, 4rem);
  font-weight: 900;
  letter-spacing: 0.28em;
  color: var(--purple);
  text-shadow:
    0 0 10px var(--purple),
    0 0 30px var(--purple),
    0 0 70px var(--purple-dim);
  margin-bottom: 6px;
  text-align: center;
  flex-shrink: 0;
  animation: neonFlicker 6s infinite;
}

.tagline {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.25em;
  color: #F5F5F5;
  margin-bottom: 28px;
  text-align: center;
  text-transform: uppercase;
  flex-shrink: 0;
  text-shadow: none;
}

/* ── CARDS ── */
.card {
  background: #0a0a0a;
  border-radius: 8px;
  padding: 28px 24px;
  width: 100%;
  max-width: 420px;
  position: relative;
  flex-shrink: 0;
  box-shadow:
    0 0 40px var(--purple-glow-sm),
    0 0 80px rgba(160,32,240,0.04);
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  padding: 1px;
  background: linear-gradient(145deg, var(--purple) 0%, #0a0a0a 55%, var(--purple-dim) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
          mask-composite: exclude;
  pointer-events: none;
}
.card h2 {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: var(--purple);
  text-transform: uppercase;
  margin-bottom: 20px;
  text-shadow: none;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.4;
}

/* ── INPUTS ── */
.input-group { margin-bottom: 20px; }

.input-group label {
  display: block;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-transform: uppercase;
  margin-bottom: 8px;
  text-shadow: none;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  background: #111;
  border: 1px solid #333;
  border-radius: 4px;
  color: #ffffff;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-shadow: none;
}
input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 10px var(--purple-glow);
}

/* ── CAPTCHA — solid white, no glow ── */
.captcha-row { display: flex; gap: 8px; align-items: center; }

.captcha-q {
  flex: 1;
  background: #0a0010;
  border: 1px solid var(--purple);
  border-radius: 4px;
  padding: 11px 14px;
  font-size: 1.5rem;
  font-weight: 900;
  color: #FFFFFF;
  text-shadow: none;
  filter: none;
  letter-spacing: 0.12em;
  user-select: none;
  white-space: nowrap;
}
.captcha-row input[type="number"] {
  width: 88px;
  flex-shrink: 0;
  text-align: center;
  padding: 11px 8px;
  font-size: 1.3rem;
  font-weight: 900;
  color: #FFFFFF;
  text-shadow: none;
  filter: none;
}

.btn-refresh {
  background: transparent;
  border: 1px solid #333;
  border-radius: 4px;
  color: #F5F5F5;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 900;
  padding: 8px 11px;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s, border-color 0.2s;
  text-shadow: none;
}
.btn-refresh:hover { color: var(--purple); border-color: var(--purple); }

/* ── ROOM CODE DISPLAY ── */
.code-display-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }

.room-code-display {
  flex: 1;
  background: #060606;
  border: 1px solid var(--purple-dim);
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.35em;
  color: var(--purple);
  text-shadow: none;
  text-align: center;
  user-select: all;
  cursor: default;
}

.btn-copy {
  background: transparent;
  border: 1px solid #333;
  border-radius: 4px;
  color: #F5F5F5;
  font-size: 1.1rem;
  font-weight: 900;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  text-shadow: none;
}
.btn-copy:hover, .btn-copy.copied { border-color: var(--purple); color: var(--purple); }

.code-hint {
  font-size: 14px;
  font-weight: 700;
  color: #F5F5F5;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.6;
  text-shadow: none;
}

/* ── DURATION PICKER ── */
.duration-grid { display: flex; flex-wrap: wrap; gap: 7px; }

.duration-btn {
  flex: 1 1 calc(33.33% - 7px);
  min-width: 64px;
  padding: 10px 4px;
  background: #111;
  border: 1px solid #333;
  border-radius: 4px;
  color: #F5F5F5;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  text-shadow: none;
}
.duration-btn:hover { border-color: var(--purple-dim); color: #ffffff; }
.duration-btn.active {
  border-color: var(--purple);
  color: var(--purple);
  background: rgba(160, 32, 240, 0.08);
  box-shadow: 0 0 8px var(--purple-glow-sm);
}

/* ── BUTTONS ── */
.btn {
  display: block;
  width: 100%;
  padding: 15px 12px;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s, box-shadow 0.2s, transform 0.15s;
  text-shadow: none;
}
.btn:hover  { transform: scale(1.035); }
.btn:active { transform: scale(0.96); }

.btn-primary {
  background: var(--purple);
  color: #ffffff;
  box-shadow: 0 0 20px var(--purple-glow);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  margin-top: 20px;
}
.btn-primary:hover    { opacity: 0.88; box-shadow: 0 0 36px var(--purple-glow); }
.btn-primary:active   { opacity: 0.72; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--purple);
  color: var(--purple);
  margin-top: 20px;
}
.btn-outline:hover { background: rgba(176, 66, 255, 0.10); }

.btn-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  margin-top: 0;
  box-shadow: 0 0 8px rgba(255,60,60,0.15);
}
.btn-danger:hover { background: rgba(255,60,60,0.08); }

.entry-choice-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.entry-choice-btns .btn { margin-top: 16px; }

.btn-back {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: #F5F5F5;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-align: center;
  margin-top: 14px;
  cursor: pointer;
  padding: 6px;
  transition: color 0.2s;
  text-shadow: none;
}
.btn-back:hover { color: var(--purple); }

.error-msg {
  font-size: 13px;
  font-weight: 700;
  color: var(--danger);
  min-height: 1.1em;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  text-shadow: none;
}

/* ── CHAT SCREEN ── */
#chat-screen {
  display: none;
  flex-direction: column;
  height: 100vh;
  padding: 0;
  overflow: hidden;
}
#chat-screen.active { display: flex; }

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #080808;
  border-bottom: 1px solid var(--purple-dim);
  padding: 10px 14px;
  flex-shrink: 0;
  gap: 8px;
}
.chat-header-left { display: flex; flex-direction: column; min-width: 0; }

.chat-title {
  font-size: 15px;
  font-weight: 900;
  color: var(--purple);
  text-shadow: none;
  letter-spacing: 0.2em;
  white-space: nowrap;
}
.chat-room-label {
  font-size: 12px;
  font-weight: 700;
  color: #F5F5F5;
  letter-spacing: 0.15em;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: none;
}

/* ── ROOM COUNTDOWN TIMER ── */
.room-timer { text-align: center; flex-shrink: 0; }

.timer-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: #F5F5F5;
  text-transform: uppercase;
  margin-bottom: 1px;
  text-shadow: none;
}
.timer-value {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--purple);
  text-shadow: none;
  font-variant-numeric: tabular-nums;
}
.timer-value.urgent {
  color: var(--danger);
  text-shadow: none;
  animation: timerPulse 1s ease-in-out infinite;
}
@keyframes timerPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

.chat-header-right { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  transition: opacity 0.2s;
  white-space: nowrap;
  text-shadow: none;
}
.btn-sm:hover { opacity: 0.85; }

.btn-ghost {
  background: transparent;
  border: 1px solid #333;
  color: #F5F5F5;
}

.btn-sm.btn-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  margin-top: 0;
  width: auto;
}

/* ── MESSAGES ── */
#messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  scrollbar-width: thin;
  scrollbar-color: var(--purple-dim) transparent;
}
#messages::-webkit-scrollbar { width: 4px; }
#messages::-webkit-scrollbar-track { background: transparent; }
#messages::-webkit-scrollbar-thumb { background: var(--purple-dim); border-radius: 2px; }

.msg {
  background: #0d0d0d;
  border: 1px solid #1a1a1a;
  border-left: 3px solid var(--purple-dim);
  border-radius: 4px;
  padding: 10px 12px;
  animation: msgIn 0.25s ease;
}
@keyframes msgIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }

.msg.own { border-left-color: var(--purple); background: #0f0a14; }

.msg-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}

.msg-user {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--purple);
  text-transform: uppercase;
  text-shadow: none;
}
.msg-time {
  font-size: 11px;
  font-weight: 700;
  color: #888888;
  text-shadow: none;
}
.msg-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
  line-height: 1.5;
  text-shadow: none;
}

.msg-system {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #888888;
  letter-spacing: 0.1em;
  padding: 4px 0;
  text-shadow: none;
}

/* ── TYPING INDICATOR ── */
#typing-bar {
  height: 20px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  background: var(--black);
}
#typing-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--purple-dim);
  letter-spacing: 0.08em;
  opacity: 0;
  transition: opacity 0.25s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: none;
}
#typing-text.visible { opacity: 1; }

.typing-dots { display: inline-flex; gap: 3px; margin-left: 5px; vertical-align: middle; }
.typing-dots span {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--purple-dim);
  animation: typingPulse 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingPulse { 0%, 60%, 100% { opacity: 0.2; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ── SEND AREA ── */
.send-area {
  background: #080808;
  border-top: 1px solid var(--purple-dim);
  padding: 10px 14px;
  flex-shrink: 0;
}
.send-row { display: flex; gap: 10px; }

#msg-input {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-weight: 500;
  background: #111;
  border: 1px solid #333;
  border-radius: 4px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  text-shadow: none;
}
#msg-input:focus { border-color: var(--purple); box-shadow: 0 0 8px var(--purple-glow); }
#msg-input:disabled { opacity: 0.4; }

.btn-send {
  background: var(--purple);
  border: none;
  border-radius: 4px;
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.1em;
  padding: 10px 16px;
  cursor: pointer;
  text-transform: uppercase;
  transition: opacity 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 10px var(--purple-glow);
  white-space: nowrap;
  text-shadow: none;
}
.btn-send:hover { opacity: 0.85; }
.btn-send:disabled { opacity: 0.4; cursor: not-allowed; }

.send-error {
  font-size: 13px;
  font-weight: 700;
  color: var(--danger);
  margin-top: 5px;
  min-height: 1em;
  text-shadow: none;
}

/* ── STATUS DOT ── */
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #333;
  display: inline-block;
  margin-right: 5px;
  transition: background 0.3s;
}
.status-dot.connected {
  background: var(--purple);
  box-shadow: 0 0 6px var(--purple);
}

/* ── SELF-DESTRUCT MODAL ── */
#destruct-modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 100;
  align-items: center; justify-content: center;
  padding: 20px;
}
#destruct-modal.open { display: flex; }

.modal-box {
  background: #0a0a0a;
  border: 1px solid var(--danger);
  border-radius: 6px;
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 0 30px rgba(255,60,60,0.20);
  text-align: center;
}
.modal-box h3 {
  color: var(--danger);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 12px;
  text-shadow: none;
}
.modal-box p {
  font-size: 14px;
  font-weight: 500;
  color: #F5F5F5;
  margin-bottom: 24px;
  line-height: 1.65;
  text-shadow: none;
}
.modal-btns { display: flex; gap: 12px; }
.modal-btns button {
  flex: 1;
  padding: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.1em;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  text-shadow: none;
}
.modal-cancel  { background: transparent; border: 1px solid #333; color: #F5F5F5; }
.modal-confirm { background: var(--danger); border: none; color: #ffffff; }

/* ── MOBILE (Motorola G45 ~390px) — sharpness preserved ── */
@media (max-width: 420px) {
  .logo    { margin-bottom: 4px; font-size: clamp(2.8rem, 11vw, 4rem); }
  .tagline { margin-bottom: 20px; font-size: 13px; letter-spacing: 0.2em; }

  .card    { padding: 22px 16px; }

  /* Lock label sharpness on small screens — NO shrinking below 19px */
  .input-group label,
  .card h2,
  .field-label,
  .setting-label {
    font-size: 19px;
    font-weight: 900;
    text-shadow: none;
    -webkit-font-smoothing: antialiased;
  }

  .room-code-display { font-size: 1.3rem; padding: 11px 12px; font-weight: 900; }
  .chat-header   { padding: 10px 12px; }
  #messages      { padding: 10px; gap: 7px; }
  .send-area     { padding: 10px 12px; }
  .timer-label   { display: none; }
  .timer-value   { font-size: 0.95rem; font-weight: 900; }
  .btn-sm        { padding: 6px 10px; font-size: 12px; font-weight: 900; }
  .duration-btn  { font-size: 13px; padding: 10px 4px; font-weight: 900; }

  input[type="text"],
  input[type="number"] { font-size: 1.05rem; font-weight: 700; padding: 12px 13px; }
  .btn { font-size: 1rem; font-weight: 900; padding: 14px 12px; }

  .captcha-q { font-size: 1.3rem; font-weight: 900; }
  .captcha-row input[type="number"] { width: 78px; font-size: 1.1rem; font-weight: 900; }

  .code-hint, .error-msg, .send-error, .msg-system, #typing-text { font-size: 13px; font-weight: 700; }
}
