/* =========================================================
   GLOBAL RESET + DESIGN SYSTEM
========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

input,
textarea,
select,
button {
  font-size: 16px;
  -webkit-appearance: none;
}

:root {
  --bg: #070716;
  --panel: #10102a;
  --panel-2: #141432;

  --primary: #8b5cf6;
  --secondary: #a78bfa;
  --glow: #c4b5fd;

  --text: #e2e8f0;
  --muted: #94a3b8;

  --danger: #ff3c5f;
  --success: #22c55e;

  --pixel: "Press Start 2P", monospace;
  --ui: "Segoe UI", sans-serif;
}

/* =========================================================
   BACKGROUND (RETRO VOID UNIVERSE)
========================================================= */
body {
  min-height: 100vh;
  font-family: var(--pixel);
  color: var(--text);

  background: radial-gradient(circle at center, #14142e, var(--bg));
  overflow-x: hidden;
  position: relative;
}

/* CRT scanlines */
body::before {
  content: "";
  position: fixed;
  inset: 0;

  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.03) 3px
  );

  pointer-events: none;
  z-index: 999;
}

/* vignette dark edges */
body::after {
  content: "";
  position: fixed;
  inset: 0;

  background: transparent;

  pointer-events: none;
  z-index: 998;
}

/* =========================================================
   PAGE LAYOUT SYSTEM
========================================================= */
.container {
  width: 92%;
  max-width: 520px;

  margin: 40px auto;

  background: rgba(16, 16, 42, 0.92);
  border: 4px solid rgba(79, 103, 129, 0.8);

  padding: 20px;

  box-shadow:
    10px 10px 0 rgba(0,0,0,0.75),
    0 0 30px rgba(139, 92, 246, 0.2);

  position: relative;
  z-index: 10;
}

/* larger layouts (inbox/chat pages) */
.container.large {
  max-width: 900px;
}

/* =========================================================
   HEADERS / TITLES (GAME UI STYLE)
========================================================= */
h1, h2 {
  text-align: center;
  margin-bottom: 12px;

  text-shadow:
    0 0 12px var(--primary),
    4px 4px 0 rgba(0,0,0,0.8);
}

.subtitle {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 20px;
}

/* =========================================================
   INPUT SYSTEM (TERMINAL STYLE)
========================================================= */
input,
textarea,
select {
  width: 100%;
  margin-top: 12px;

  padding: 14px;

  background: #0f0f22;
  border: 3px solid rgba(79, 103, 129, 0.9);

  color: var(--text);
  font-family: var(--ui);

  outline: none;

  transition: 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
  transform: translateY(-1px);
}

/* =========================================================
   BUTTON SYSTEM (ARCADE PRESS STYLE)
========================================================= */
button {
  width: 100%;
  margin-top: 14px;

  padding: 14px;

  background: linear-gradient(180deg, var(--primary), #5b21b6);
  border: 4px solid var(--glow);

  color: white;

  font-family: var(--pixel);
  font-size: 10px;

  letter-spacing: 2px;
  text-transform: uppercase;

  cursor: pointer;

  box-shadow: 6px 6px 0 black;

  transition: 0.15s ease;
}

button:hover {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0 black;
}

button:active {
  transform: translate(6px, 6px);
  box-shadow: none;
}

/* secondary button */
button.secondary {
  background: linear-gradient(180deg, #334155, #1e293b);
  border-color: #64748b;
}

/* danger button */
button.danger {
  background: linear-gradient(180deg, var(--danger), #be123c);
  border-color: #ff8fab;
}

/* =========================================================
   MESSAGE / INBOX SYSTEM
========================================================= */
/* =========================
   BASE THOUGHT CARD SYSTEM
========================= */

.message {
  margin-top: 14px;
  padding: 16px;

  position: relative;
  overflow: hidden;

  background: #070711;

  border-left: 5px solid var(--primary);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);

  font-family: var(--ui);
  color: #e5e7eb;

  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    10px 10px 0 rgba(0,0,0,0.9);

  transform: translateY(10px);
  opacity: 0;

  animation: thoughtEnter 0.5s ease forwards;

  transition: all 0.25s ease;
}

/* =========================
   ENTRY ANIMATION (THOUGHT BIRTH)
========================= */

@keyframes thoughtEnter {
  0% {
    transform: translateY(20px) scale(0.98);
    opacity: 0;
    filter: blur(6px);
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
    filter: blur(0);
  }
}

/* =========================
   EMOTIONAL STATES (THOUGHT TYPES)
========================= */

.message.truth {
  border-left-color: #22c55e;
  box-shadow:
    0 0 18px rgba(34, 197, 94, 0.15),
    10px 10px 0 rgba(0,0,0,0.9);
}

.message.chaos {
  border-left-color: #facc15;
  color: #fff7cc;
  box-shadow:
    0 0 18px rgba(250, 204, 21, 0.12),
    10px 10px 0 rgba(0,0,0,0.9);
}

.message.dare {
  border-left-color: #ef4444;
  color: #ffe4e6;
  box-shadow:
    0 0 18px rgba(239, 68, 68, 0.15),
    10px 10px 0 rgba(0,0,0,0.9);
}

/* =========================
   “FOCUSED THOUGHT” INTERACTION
========================= */

.message:hover {
  transform: translateY(-3px) scale(1.01);

  box-shadow:
    0 0 25px rgba(139, 92, 246, 0.2),
    14px 14px 0 rgba(0,0,0,0.95);
}

/* =========================
   THOUGHT EDGE SIGNAL
========================= */

.message::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 100%;
  background: inherit;
  filter: brightness(1.4);
}

/* =========================
   MEMORY DECAY SYSTEM
========================= */

.message.old {
  opacity: 0.45;
  filter: blur(0.3px);
  transform: scale(0.99);
}

/* =========================
   OPTIONAL: SUBTLE INTERNAL GLOW
========================= */

.message::after {
  content: "";
  position: absolute;
  inset: 0;

  background: radial-gradient(
    circle at 30% 20%,
    rgba(139, 92, 246, 0.08),
    transparent 60%
  );

  pointer-events: none;
}

/* =========================
   TEXT INSIDE CARD
========================= */

.message b {
  color: #ffffff;
}

.message br {
  line-height: 1.6;
}

.message:hover {
  transform: translateX(3px);
  border-left-color: var(--secondary);
}

/* inbox list */
.inbox {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* =========================================================
   SEND PAGE SPECIAL UI (composer box)
========================================================= */
.composer {
  background: var(--panel);
  border: 4px solid var(--primary);
  padding: 15px;

  box-shadow: 8px 8px 0 black;
}

/* =========================================================
   NAV / HEADER BAR (if you use one)
========================================================= */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 10px;

  border-bottom: 3px solid var(--primary);
  margin-bottom: 20px;
}

/* =========================================================
   GLITCH / HOVER EFFECTS
========================================================= */
.glow-text {
  text-shadow: 0 0 10px var(--primary);
}

@keyframes glitch {
  0% { transform: translate(0); }
  25% { transform: translate(-2px, 2px); }
  50% { transform: translate(2px, -2px); }
  75% { transform: translate(-1px, -1px); }
  100% { transform: translate(0); }
}

.glitch:hover {
  animation: glitch 0.25s infinite;
}

/* =========================================================
   LOADING BAR (GAME STYLE)
========================================================= */
.loading {
  width: 100%;
  height: 8px;
  background: #0f0f22;
  border: 2px solid var(--border);
  margin-top: 10px;
  overflow: hidden;
}

.loading div {
  height: 100%;
  background: var(--primary);
  animation: load 2.5s infinite;
}

@keyframes load {
  0% { width: 0%; }
  50% { width: 100%; }
  100% { width: 0%; }
}

/* =========================================================
   MOBILE RESPONSIVE
========================================================= */
@media (max-width: 600px) {
  .container {
    margin: 20px auto;
    padding: 15px;
  }

  button {
    font-size: 9px;
    padding: 12px;
  }
}

/* =========================
   HOME NAV BUTTON (GLOBAL)
========================= */
.home-btn {
  position: fixed;
  top: 18px;
  left: 18px;

  padding: 10px 12px;

  background: linear-gradient(180deg, #8b5cf6, #5b21b6);
  border: 3px solid #c4b5fd;

  color: white;
  text-decoration: none;

  font-family: "Press Start 2P", monospace;
  font-size: 8px;

  box-shadow: 4px 4px 0 black;

  z-index: 9999;

  transition: 0.15s ease;
}

.home-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 black;
}

.home-btn:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

/* =========================
   MOBILE FIX (CRITICAL)
========================= */
@media (max-width: 600px) {

  body {
    padding: 10px;
    align-items: flex-start;
  }

  .container {
    width: 100%;
    max-width: 100%;
    margin: 40px 0 20px;
    padding: 15px;
    border-width: 3px;
  }

  h1 {
    font-size: 14px;
  }

  h2 {
    font-size: 12px;
  }

  input,
  textarea,
  select {
    font-size: 12px;
    padding: 12px;
  }

  button {
    font-size: 9px;
    padding: 12px;
  }

  .home-btn {
    font-size: 7px;
    padding: 8px 10px;
    top: 10px;
    left: 10px;
  }
}

/* =========================
   MODE COLOR STATES
========================= */

.container.truth-mode {
  border-color: #22c55e;
  box-shadow: 10px 10px 0 rgba(0,0,0,0.75),
              0 0 25px rgba(34,197,94,0.25);
}

.container.chaos-mode {
  border-color: #eab308;
  box-shadow: 10px 10px 0 rgba(0,0,0,0.75),
              0 0 25px rgba(234,179,8,0.25);
}

.container.dare-mode {
  border-color: #ef4444;
  box-shadow: 10px 10px 0 rgba(0,0,0,0.75),
              0 0 25px rgba(239,68,68,0.25);
}

/* Optional: glow input feedback */
.truth-mode input,
.truth-mode textarea {
  border-color: #22c55e;
}

.chaos-mode input,
.chaos-mode textarea {
  border-color: #eab308;
}

.dare-mode input,
.dare-mode textarea {
  border-color: #ef4444;
}

/* =========================
   SYSTEM FOOTER (GAME STYLE)
========================= */

.system-footer {
  margin-top: 30px;
  padding: 15px;

  border: 3px solid rgba(139, 92, 246, 0.5);
  background: rgba(16, 16, 42, 0.7);

  box-shadow: 6px 6px 0 black;
}

.footer-header {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  text-align: center;

  color: #a78bfa;
  margin-bottom: 15px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.footer-box {
  background: rgba(0,0,0,0.3);
  border: 2px solid rgba(79, 103, 129, 0.6);
  padding: 10px;

  font-family: "Segoe UI", sans-serif;
  font-size: 12px;
  color: #94a3b8;
}

.footer-box h4 {
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  margin-bottom: 6px;
  color: #e2e8f0;
}

.footer-signature {
  margin-top: 10px;
  text-align: center;

  font-family: "Press Start 2P", monospace;
  font-size: 8px;

  color: rgba(148, 163, 184, 0.6);
}

/* =========================
   HUD TOP BAR (GAME STYLE)
========================= */

.hud-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin: 10px 0 20px;

  padding: 10px;

  border: 3px solid rgba(139, 92, 246, 0.5);
  background: rgba(16, 16, 42, 0.6);

  box-shadow: 5px 5px 0 black;
}

.hud-item {
  font-family: "Press Start 2P", monospace;
  font-size: 8px;

  color: #a78bfa;
}

/* =========================
   MESSAGE CARD SYSTEM
========================= */

.card-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-card {
  padding: 12px;
  border: 2px solid rgba(139, 92, 246, 0.4);

  background: rgba(10, 10, 30, 0.6);

  box-shadow: 5px 5px 0 black;

  animation: cardDrop 0.4s ease;
  transition: 0.2s ease;

  font-family: "Segoe UI", sans-serif;
  color: #e2e8f0;
}

.message-card:hover {
  transform: translateY(-2px);
}

/* mode colors */
.message-card.truth {
  border-color: #22c55e;
}

.message-card.chaos {
  border-color: #eab308;
}

.message-card.dare {
  border-color: #ef4444;
}

/* animation */
@keyframes cardDrop {
  0% {
    transform: translateY(-10px) scale(0.95);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.card-title {
  font-weight: bold;
  margin-bottom: 6px;
}

.card-meta {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 6px;
}

.inbox-status {
    font-size: 10px;
    padding-top: 17px;
    padding-bottom: 17px;
}

/* =========================
   CARD ACTION BAR (INLINE BUTTONS)
========================= */

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap; /* mobile safety */
}

/* buttons inside card */
.card-actions button {
  flex: 1; /* makes equal width */
  min-width: 120px;

  padding: 8px 10px;

  font-size: 10px;
  font-family: "Press Start 2P", monospace;

  background: #1c1c1c;
  color: #fff;

  border: 2px solid #8b5cf6;
  cursor: pointer;

  transition: 0.2s ease;
}

/* hover effect */
.card-actions button:hover {
  background: #00ff00;
  transform: translateY(-2px);
}

/* specific button types */
.card-actions button:nth-child(1) {
  border-color: #a78bfa;
}

.card-actions button:nth-child(2) {
  border-color: #f59e0b;
}

.password-box {
  position: relative;
  width: 100%;
}

.password-box input {
  padding-right: 60px;
}

.eye-btn {
  position: absolute;

  right: 18px;
  top: 57%;

  transform: translateY(-50%);

  font-size: 18px;

  cursor: pointer;

  user-select: none;

  opacity: 0.7;

  transition: 0.2s ease;

  z-index: 100;
}

.eye-btn:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

.intro-box {
  padding: 18px;
  margin-bottom: 24px;

  background:
    linear-gradient(
      180deg,
      rgba(18,18,40,0.92),
      rgba(8,8,20,0.96)
    );

  border: 2px solid rgba(139,92,246,0.35);

  box-shadow:
    0 0 20px rgba(139,92,246,0.08),
    6px 6px 0 rgba(0,0,0,0.85);

  position: relative;

  overflow: hidden;
}

.intro-box::before {
  content: "";

  position: absolute;

  top: 0;
  left: 0;

  width: 100%;
  height: 2px;

  background:
    linear-gradient(
      90deg,
      transparent,
      #8b5cf6,
      transparent
    );
}

.intro-box h3 {
  font-size: 11px;

  margin-bottom: 14px;

  color: #c4b5fd;

  text-shadow: 0 0 10px rgba(139,92,246,0.4);
}

.intro-box p {
  font-family: "Segoe UI", sans-serif;

  font-size: 13px;

  line-height: 1.7;

  color: #cbd5e1;

  margin-bottom: 12px;
}

.intro-tags {
  display: flex;
  flex-wrap: wrap;

  gap: 8px;

  margin-top: 14px;
}

.intro-tags span {
  padding: 8px 10px;

  font-size: 9px;

  background: rgba(139,92,246,0.12);

  border: 1px solid rgba(139,92,246,0.3);

  color: #c4b5fd;

  font-family: "Press Start 2P", monospace;

  box-shadow: 3px 3px 0 rgba(0,0,0,0.7);
}
