/* ======================================================
   Bread's Lounge — Master Stylesheet
   Cozy Cosmic Pixel Lounge Aesthetic
   ====================================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;500;600;700&family=VT323&family=Share+Tech+Mono&display=swap');

/* ===========================
   CSS VARIABLES / TOKENS
   =========================== */
:root {
  /* Palette */
  --bg-deep: #060913;
  --bg-panel: rgba(8, 14, 35, 0.80);
  --bg-panel-dark: rgba(4, 8, 20, 0.92);
  --bg-input: rgba(5, 10, 25, 0.90);
  --border-glow: #f5a623;
  --border-dim: rgba(245, 166, 35, 0.30);
  --border-blue: rgba(100, 160, 255, 0.35);
  --accent-gold: #f5a623;
  --accent-amber: #ffcc55;
  --accent-neon: #a0d8ef;
  --accent-cyan: #00e5ff;
  --accent-purple: #c084fc;
  --text-main: #e8dcc8;
  --text-muted: #8a7f6f;
  --text-bright: #fff8ee;
  --text-admin: #f5a623;
  --text-system: #64b8ff;
  --text-bot: #a0ff88;
  --danger: #ff5555;
  --success: #55ff88;

  /* Spacing */
  --radius: 4px;
  --radius-lg: 8px;

  /* Font */
  --font-pixel: 'Pixelify Sans', 'VT323', monospace;
  --font-mono: 'Share Tech Mono', monospace;

  /* Transitions */
  --transition: 0.15s ease;
}

/* ===========================
   RESET & BASE
   =========================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-pixel);
  color: var(--text-main);
  background-color: var(--bg-deep);
  -webkit-font-smoothing: none;
  /* Keep crisp pixel look */
  font-size: 16px;
  overflow-y: auto;
}

/* Applied only on index.php to lock the app shell in place */
body.app-noscroll,
body.app-noscroll html {
  overflow: hidden;
}

/* ===========================
   STARFIELD CANVAS
   =========================== */
#starfield-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ===========================
   SCROLLBARS (Custom Pixel)
   =========================== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(4, 8, 20, 0.8);
  border-left: 2px solid var(--border-dim);
}

::-webkit-scrollbar-thumb {
  background: var(--border-glow);
  border: 2px solid rgba(245, 166, 35, 0.3);
  image-rendering: pixelated;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-amber);
}

::-webkit-scrollbar-corner {
  background: var(--bg-deep);
}

/* ===========================
   UTILITY CLASSES
   =========================== */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.gap-1 {
  gap: 0.5rem;
}

.gap-2 {
  gap: 1rem;
}

.hidden {
  display: none !important;
}

.relative {
  position: relative;
}

.text-center {
  text-align: center;
}

/* Glow text effects */
.glow-gold {
  color: var(--accent-gold);
  text-shadow: 0 0 8px var(--accent-gold), 0 0 20px rgba(245, 166, 35, 0.5);
}

.glow-cyan {
  color: var(--accent-cyan);
  text-shadow: 0 0 8px var(--accent-cyan), 0 0 20px rgba(0, 229, 255, 0.4);
}

.glow-purple {
  color: var(--accent-purple);
  text-shadow: 0 0 8px var(--accent-purple);
}

/* ===========================
   RPG PANEL / DIALOG BOXES
   =========================== */
.panel {
  position: relative;
  background: var(--bg-panel);
  border: 2px solid var(--border-glow);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  box-shadow:
    0 0 0 1px rgba(245, 166, 35, 0.1),
    0 0 20px rgba(245, 166, 35, 0.15),
    0 4px 30px rgba(0, 0, 0, 0.6);
}

/* Panel corner decorations */
.panel::before,
.panel::after {
  content: '◆';
  position: absolute;
  font-size: 8px;
  color: var(--accent-gold);
  opacity: 0.7;
}

.panel::before {
  top: 4px;
  left: 6px;
}

.panel::after {
  top: 4px;
  right: 6px;
}

.panel-dark {
  background: var(--bg-panel-dark);
  border-color: var(--border-dim);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
}

.panel-title {
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-gold);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border-dim);
  text-shadow: 0 0 6px var(--accent-gold);
}

/* ===========================
   BUTTONS
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  font-family: var(--font-pixel);
  font-size: 0.875rem;
  cursor: pointer;
  border: 2px solid var(--border-glow);
  border-radius: var(--radius);
  background: var(--bg-panel-dark);
  color: var(--accent-gold);
  text-shadow: 0 0 6px rgba(245, 166, 35, 0.6);
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-gold);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn:hover {
  background: rgba(245, 166, 35, 0.18);
  color: var(--accent-amber);
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.5);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 0 5px rgba(245, 166, 35, 0.3);
}

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
}

.btn-danger {
  border-color: var(--danger);
  color: var(--danger);
  text-shadow: 0 0 6px rgba(255, 85, 85, 0.6);
}

.btn-danger:hover {
  background: rgba(255, 85, 85, 0.18);
  box-shadow: 0 0 12px rgba(255, 85, 85, 0.5);
}

.btn-ghost {
  border-color: var(--border-blue);
  color: var(--accent-neon);
}

.btn-ghost:hover {
  background: rgba(100, 180, 255, 0.1);
  box-shadow: 0 0 12px rgba(100, 180, 255, 0.3);
}

.btn-full {
  width: 100%;
}

/* ===========================
   FORM ELEMENTS
   =========================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-label {
  font-size: 0.8rem;
  color: var(--accent-amber);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.form-input,
.form-textarea,
.form-select {
  background: rgba(4, 8, 20, 0.9);
  border: 2px solid var(--border-dim);
  border-radius: var(--radius);
  color: var(--text-main);
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  width: 100%;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.3);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-select option {
  background: #0a0f22;
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent-gold);
  margin-top: 2px;
}

/* Error / Success messages */
.form-error {
  color: var(--danger);
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--danger);
  background: rgba(255, 85, 85, 0.1);
  border-radius: var(--radius);
  display: none;
}

.form-error.visible {
  display: block;
}

.form-success {
  color: var(--success);
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--success);
  background: rgba(85, 255, 136, 0.1);
  border-radius: var(--radius);
  display: none;
}

.form-success.visible {
  display: block;
}

/* ===========================
   WELCOME PAGE
   =========================== */
.welcome-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  overflow-y: auto;
}

.welcome-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.welcome-logo h1 {
  font-family: 'VT323', monospace;
  font-size: clamp(2.5rem, 8vw, 5rem);
  color: var(--accent-gold);
  text-shadow:
    0 0 10px var(--accent-gold),
    0 0 30px rgba(245, 166, 35, 0.5),
    0 0 60px rgba(245, 166, 35, 0.2);
  letter-spacing: 4px;
  line-height: 1;
}

.welcome-logo .subtitle {
  font-size: 0.9rem;
  color: var(--accent-neon);
  letter-spacing: 3px;
  margin-top: 0.5rem;
}

.welcome-blurb {
  max-width: 620px;
  text-align: center;
  margin-bottom: 2.5rem;
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.8;
  padding: 1.2rem 1.5rem;
  border: 1px solid var(--border-dim);
  background: var(--bg-panel);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
}

.welcome-forms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  width: 100%;
  max-width: 780px;
}

@media (max-width: 640px) {
  .welcome-forms {
    grid-template-columns: 1fr;
  }
}

.form-panel {
  background: var(--bg-panel);
  border: 2px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(245, 166, 35, 0.08),
    0 0 30px rgba(245, 166, 35, 0.12),
    0 8px 40px rgba(0, 0, 0, 0.7);
}

.form-panel-title {
  font-size: 1.1rem;
  color: var(--accent-amber);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  text-shadow: 0 0 6px var(--accent-gold);
  border-bottom: 1px solid var(--border-dim);
  padding-bottom: 0.6rem;
}

/* ===========================
   APP LAYOUT (index.php)
   =========================== */
.app-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 100vh;
  height: 100vh;
  overflow: hidden;
}

@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    display: none;
  }

  .sidebar.mobile-open {
    display: flex;
  }
}

/* ===========================
   SIDEBAR
   =========================== */
.sidebar {
  display: flex;
  flex-direction: column;
  background: rgba(4, 8, 20, 0.92);
  border-right: 2px solid var(--border-glow);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 10;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
}

/* User profile section */
.sidebar-profile {
  padding: 1rem;
  border-bottom: 2px solid var(--border-dim);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: background var(--transition);
}

.sidebar-profile:hover {
  background: rgba(245, 166, 35, 0.05);
}

.profile-pfp {
  width: 44px;
  height: 44px;
  border: 2px solid var(--accent-gold);
  border-radius: var(--radius);
  object-fit: cover;
  image-rendering: pixelated;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.4);
}

.profile-info {
  min-width: 0;
  flex: 1;
}

.profile-username {
  font-size: 0.95rem;
  color: var(--accent-gold);
  text-shadow: 0 0 6px rgba(245, 166, 35, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-pronouns {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Sidebar sections */
.sidebar-section {
  padding: 0.5rem 0;
}

.sidebar-section-label {
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-room {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-main);
  transition: background var(--transition), color var(--transition);
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-room:hover {
  background: rgba(245, 166, 35, 0.08);
  color: var(--accent-amber);
  border-left-color: var(--border-dim);
}

.sidebar-room.active {
  background: rgba(245, 166, 35, 0.15);
  color: var(--accent-gold);
  border-left-color: var(--accent-gold);
}

.sidebar-room .room-icon {
  opacity: 0.7;
  flex-shrink: 0;
}

/* Invite bell */
.invite-bell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--accent-cyan);
  border-top: 1px solid var(--border-dim);
  transition: background var(--transition);
}

.invite-bell:hover {
  background: rgba(0, 229, 255, 0.07);
}

.invite-badge {
  background: var(--accent-gold);
  color: var(--bg-deep);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.invite-badge.hidden {
  display: none;
}

/* Sidebar portal links */
.sidebar-portal {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--accent-purple);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.sidebar-portal:hover {
  background: rgba(192, 132, 252, 0.1);
  color: #d8b4fe;
}

.sidebar-bottom {
  margin-top: auto;
  border-top: 2px solid var(--border-dim);
  padding: 0.5rem;
}

/* ===========================
   MAIN CHAT AREA
   =========================== */
.chat-area {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

.chat-header {
  padding: 0.75rem 1.25rem;
  border-bottom: 2px solid var(--border-glow);
  background: rgba(4, 8, 20, 0.88);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
  backdrop-filter: blur(6px);
}

.chat-room-name {
  font-size: 1.1rem;
  color: var(--accent-gold);
  text-shadow: 0 0 6px rgba(245, 166, 35, 0.5);
  letter-spacing: 1px;
}

.chat-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Message list */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  scroll-behavior: smooth;
}

/* Individual message */
.message {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius);
  transition: background var(--transition);
  position: relative;
}

.message:hover {
  background: rgba(255, 255, 255, 0.03);
}

.message:hover .msg-delete-btn {
  opacity: 1;
}

.msg-pfp {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  image-rendering: pixelated;
  margin-top: 2px;
  flex-shrink: 0;
}

.msg-body {
  min-width: 0;
}

.msg-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 2px;
  flex-wrap: wrap;
}

.msg-username {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-gold);
  text-shadow: 0 0 5px rgba(245, 166, 35, 0.4);
}

.msg-username.admin {
  color: #ff9f43;
}

.msg-pronouns {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.msg-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: auto;
}

.msg-content {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-main);
  word-break: break-word;
}

.msg-embed {
  margin-top: 0.5rem;
  max-width: 320px;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  overflow: hidden;
}

.msg-embed img {
  width: 100%;
  display: block;
  image-rendering: auto;
}

/* Bot message */
.message.bot-msg {
  background: rgba(100, 255, 130, 0.05);
  border-left: 3px solid var(--text-bot);
}

.message.bot-msg .msg-content {
  color: var(--text-bot);
  text-shadow: 0 0 6px rgba(160, 255, 136, 0.4);
}

/* System message */
.message.system-msg {
  grid-template-columns: 1fr;
  font-size: 0.8rem;
  color: var(--text-system);
  text-align: center;
  padding: 0.5rem;
  font-style: italic;
  background: transparent;
}

/* Delete button */
.msg-delete-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  opacity: 0;
  font-size: 0.8rem;
  padding: 4px;
  transition: opacity var(--transition);
}

/* Chat input area */
.chat-input-area {
  padding: 0.75rem 1rem;
  border-top: 2px solid var(--border-glow);
  background: rgba(4, 8, 20, 0.92);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.chat-input {
  flex: 1;
  background: rgba(5, 10, 25, 0.9);
  border: 2px solid var(--border-dim);
  border-radius: var(--radius);
  color: var(--text-main);
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.chat-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.3);
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.chat-send-btn {
  background: rgba(245, 166, 35, 0.15);
  border: 2px solid var(--accent-gold);
  border-radius: var(--radius);
  color: var(--accent-gold);
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  font-size: 1.1rem;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-send-btn:hover {
  background: rgba(245, 166, 35, 0.3);
  box-shadow: 0 0 10px rgba(245, 166, 35, 0.5);
}

/* ===========================
   MODAL
   =========================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: rgba(6, 9, 19, 0.97);
  border: 2px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 0 0 1px rgba(245, 166, 35, 0.1), 0 0 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 166, 35, 0.15);
  transform: scale(0.95);
  transition: transform 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.visible .modal {
  transform: scale(1);
}

.modal-title {
  font-size: 1.1rem;
  color: var(--accent-amber);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-dim);
  padding-bottom: 0.6rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.2rem;
  justify-content: flex-end;
}

/* ===========================
   INVITE POPUP
   =========================== */
.invite-popup-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-end;
}

.invite-popup {
  background: rgba(6, 9, 19, 0.97);
  border: 2px solid var(--accent-cyan);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
  min-width: 280px;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(120%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.invite-popup-title {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 6px var(--accent-cyan);
}

.invite-popup-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ===========================
   TOAST NOTIFICATIONS
   =========================== */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
}

.toast {
  background: var(--bg-panel-dark);
  border: 2px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  max-width: 300px;
  animation: fadeInDown 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

.toast.success {
  border-color: var(--success);
  color: var(--success);
}

.toast.error {
  border-color: var(--danger);
  color: var(--danger);
}

.toast.info {
  border-color: var(--accent-neon);
  color: var(--accent-neon);
}

@keyframes fadeInDown {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* ===========================
   RULES PAGE
   =========================== */
.rules-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.rules-panel {
  background: var(--bg-panel);
  border: 2px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 740px;
  width: 100%;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 30px rgba(245, 166, 35, 0.1), 0 8px 40px rgba(0, 0, 0, 0.7);
}

.rules-title {
  font-family: 'VT323', monospace;
  font-size: 2.5rem;
  color: var(--accent-gold);
  text-shadow: 0 0 10px var(--accent-gold);
  letter-spacing: 3px;
  margin-bottom: 1.5rem;
  text-align: center;
}

.rules-section h2 {
  font-size: 1rem;
  color: var(--accent-amber);
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
  text-transform: uppercase;
}

.rules-section p,
.rules-section li {
  font-size: 0.875rem;
  color: var(--text-main);
  line-height: 1.8;
  margin-bottom: 0.5rem;
}

.rules-section ul {
  padding-left: 1.2rem;
}

.rules-section li {
  list-style: '◆  ';
}

.disclaimer-box {
  background: rgba(255, 85, 85, 0.07);
  border: 1px solid rgba(255, 85, 85, 0.4);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.7;
}

.rules-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* ===========================
   STARFALL PAGE
   =========================== */
.starfall-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2rem;
  background: rgba(0, 10, 0, 0.7);
}

.crt-monitor {
  position: relative;
  width: 100%;
  max-width: 900px;
  background: #000;
  border: 4px solid #1a3a1a;
  border-radius: 8px;
  box-shadow:
    0 0 0 2px #0a200a,
    0 0 40px rgba(0, 255, 80, 0.3),
    0 0 80px rgba(0, 200, 60, 0.1),
    inset 0 0 30px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

/* CRT scanlines */
.crt-monitor::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.12) 2px,
      rgba(0, 0, 0, 0.12) 4px);
  pointer-events: none;
  z-index: 10;
}

/* CRT flicker vignette */
.crt-monitor::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.5) 100%);
  pointer-events: none;
  z-index: 11;
}

.crt-titlebar {
  background: #0a200a;
  padding: 0.4rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 2px solid #1a4a1a;
  font-size: 0.75rem;
  color: #44ff44;
  font-family: var(--font-mono);
}

.crt-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.crt-dot.red {
  background: #ff5f57;
}

.crt-dot.yellow {
  background: #febc2e;
}

.crt-dot.green {
  background: #28c840;
}

#terminal {
  height: 520px;
  padding: 0.5rem;
  background: #0a0a0a;
}

.starfall-link-box {
  text-align: center;
}

.starfall-download-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 2rem;
  border: 2px solid #00ff44;
  border-radius: var(--radius);
  color: #00ff44;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 2px;
  text-shadow: 0 0 8px #00ff44;
  box-shadow: 0 0 16px rgba(0, 255, 68, 0.25);
  transition: all 0.2s ease;
  background: rgba(0, 40, 10, 0.5);
  animation: pulseGreen 2.5s ease-in-out infinite;
}

.starfall-download-link:hover {
  background: rgba(0, 255, 68, 0.15);
  box-shadow: 0 0 30px rgba(0, 255, 68, 0.5);
}

@keyframes pulseGreen {

  0%,
  100% {
    box-shadow: 0 0 16px rgba(0, 255, 68, 0.25);
  }

  50% {
    box-shadow: 0 0 30px rgba(0, 255, 68, 0.5);
  }
}

.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--accent-gold);
}

/* ===========================
   MINECRAFT PAGE
   =========================== */
.mc-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2rem;
  padding: 2rem;
}

.mc-bg-overlay {
  position: fixed;
  inset: 0;
  background:
    repeating-conic-gradient(#5a3d1a 0% 25%, #3d2a0f 0% 50%) 0 0 / 32px 32px,
    rgba(4, 8, 20, 0.70);
  background-blend-mode: multiply;
  z-index: 0;
}

.mc-panel {
  position: relative;
  z-index: 1;
  background: rgba(6, 4, 2, 0.92);
  border: 4px solid #7a5c2a;
  border-radius: 4px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  box-shadow:
    inset 0 0 0 2px #2a1a0a,
    0 0 0 2px #5a3d1a,
    0 0 30px rgba(0, 0, 0, 0.8);
  text-align: center;
}

.mc-title {
  font-family: 'VT323', monospace;
  font-size: 2.5rem;
  color: #7cfc00;
  text-shadow: 3px 3px 0 #1a5500, 0 0 15px rgba(124, 252, 0, 0.5);
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
}

.mc-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  border: 2px solid currentColor;
}

.mc-status-badge.online {
  color: #55ff55;
  border-color: #55ff55;
  background: rgba(85, 255, 85, 0.1);
}

.mc-status-badge.offline {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(255, 85, 85, 0.1);
}

.mc-status-badge.checking {
  color: var(--text-muted);
  border-color: var(--text-muted);
  background: transparent;
}

.mc-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.mc-status-badge.online .mc-status-dot {
  animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.mc-ip-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid #7a5c2a;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.mc-ip-box:hover {
  border-color: #9a7c3a;
  background: rgba(122, 92, 42, 0.15);
}

.mc-ip-box:hover .mc-copy-hint {
  opacity: 1;
}

.mc-ip-text {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: 1px;
}

.mc-copy-icon {
  color: #7a5c2a;
  font-size: 1.2rem;
  transition: color var(--transition);
}

.mc-ip-box:hover .mc-copy-icon {
  color: #bfa050;
}

.mc-copied-flash {
  position: absolute;
  inset: 0;
  background: rgba(124, 252, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7cfc00;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.1s ease;
  pointer-events: none;
}

.mc-copied-flash.show {
  opacity: 1;
}

.mc-players {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* ===========================
   NEIGHBORS (STAR MAP)
   =========================== */
.neighbors-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  overflow-y: auto;
  padding: 3rem 2rem;
}

.neighbors-title {
  font-family: 'VT323', monospace;
  font-size: 3rem;
  color: var(--accent-gold);
  text-shadow: 0 0 15px var(--accent-gold);
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: 3px;
}

.neighbors-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 3rem;
  letter-spacing: 2px;
}

.star-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.star-card {
  position: relative;
  text-align: center;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.star-card:hover {
  transform: translateY(-5px);
}

.star-card-constellation {
  font-size: 2.5rem;
  display: block;
  filter: drop-shadow(0 0 6px rgba(245, 166, 35, 0.6));
  margin-bottom: 0.5rem;
  animation: twinkleCard 3s ease-in-out infinite;
}

@keyframes twinkleCard {

  0%,
  100% {
    filter: drop-shadow(0 0 6px rgba(245, 166, 35, 0.6));
  }

  50% {
    filter: drop-shadow(0 0 12px rgba(245, 166, 35, 1));
  }
}

.star-card-name {
  font-size: 0.9rem;
  color: var(--accent-amber);
  display: block;
  margin-bottom: 0.25rem;
}

.star-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.star-card:hover .star-card-name {
  text-shadow: 0 0 8px var(--accent-gold);
  color: var(--accent-gold);
}

/* ===========================
   ADMIN PANEL
   =========================== */
.admin-section {
  background: rgba(255, 85, 35, 0.05);
  border: 1px solid rgba(255, 85, 35, 0.25);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 0.75rem;
}

.admin-section-title {
  font-size: 0.8rem;
  color: #ff9f43;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}

/* ===========================
   LOADING / SPINNER
   =========================== */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-dim);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===========================
   DIVIDER
   =========================== */
.divider {
  border: none;
  border-top: 1px solid var(--border-dim);
  margin: 1rem 0;
}

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* ===========================
   RESPONSIVE HELPERS
   =========================== */
@media (max-width: 480px) {
  .welcome-blurb {
    font-size: 0.8rem;
  }

  .chat-header {
    padding: 0.5rem 0.75rem;
  }

  .chat-messages {
    padding: 0.75rem;
  }
}