/* Minimal, smooth UI with theme variables */
:root {
  --bg: #0f172a;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #22c55e;
  --ring: rgba(34, 197, 94, 0.35);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #2563eb;
    --ring: rgba(37, 99, 235, 0.25);
  }
}

:root[data-theme="light"] {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --ring: rgba(37, 99, 235, 0.25);
}

:root[data-theme="dark"] {
  --bg: #0b0f1a;
  --card: #0f172a;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #22c55e;
  --ring: rgba(34, 197, 94, 0.35);
}

:root[data-theme="midnight"] {
  --bg: #1c1c27;
  --card: #272736;
  --text: #e1e1e6;
  --muted: #9090a0;
  --primary: #5e81f4;
  --ring: rgba(94, 129, 244, 0.35);
}

:root[data-theme="ocean"] {
  --bg: #e6f7ff;
  --card: #ffffff;
  --text: #0b2d40;
  --muted: #5e8aa0;
  --primary: #007a7a;
  --ring: rgba(0, 122, 122, 0.25);
}

:root[data-theme="grape"] {
  --bg: #f3e8ff;
  --card: #ffffff;
  --text: #2f0b40;
  --muted: #725e80;
  --primary: #862e9c;
  --ring: rgba(134, 46, 156, 0.25);
}

:root[data-theme="custom"] {
  --bg: var(--bg-custom, #0b0f1a);
  --card: color-mix(in srgb, var(--bg-custom) 70%, var(--primary-custom) 4%);
  --text: var(--text-custom, #e5e7eb);
  --muted: color-mix(in srgb, var(--text-custom) 60%, transparent);
  --primary: var(--primary-custom, #22c55e);
  --ring: color-mix(in srgb, var(--primary-custom) 35%, transparent);
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  color-scheme: dark light;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
}

#app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.title {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 700;
}

.controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.select-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.select {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.5rem;
  border: 1px solid var(--muted);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

.select:focus {
  outline: 2px solid var(--primary);
  border-color: var(--primary);
}

.custom-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.custom-controls input[type="color"] {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: none;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* ---- Card / Screen ---- */
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  transition: background 0.3s ease;
}

/* ---- Auth ---- */
.auth-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .auth-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.input {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid color-mix(in srgb, var(--muted) 40%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 60%, var(--card) 40%);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: var(--bg);
  cursor: pointer;
  outline: none;
  transition: opacity 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.btn:hover {
  opacity: 0.85;
}

.btn:focus-visible {
  box-shadow: 0 0 0 4px var(--ring);
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.btn-ghost:hover {
  background: color-mix(in srgb, var(--primary) 15%, transparent);
}

/* ---- Game ---- */
.game-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .game-layout {
    grid-template-columns: 3fr 2fr 3fr;
  }
}

.col-left {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.col-center {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.col-right {
  min-height: 200px;
}

.tap-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.circle {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle,
      color-mix(in srgb, var(--primary) 70%, white) 0%,
      var(--primary) 100%);
  border: none;
  cursor: pointer;
  outline: none;
  box-shadow: 0 0 0 0 var(--ring);
  transition: transform 0.05s ease, box-shadow 0.1s ease;
  user-select: none;
}

.circle:active {
  transform: scale(0.95);
  box-shadow: 0 0 0 12px var(--ring);
}

.my-total-wrap {
  position: absolute;
  text-align: center;
  pointer-events: none;
}

.my-total-wrap .label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--bg);
  opacity: 0.8;
}

.my-total {
  font-size: 4rem;
  font-weight: 700;
  color: var(--bg);
  line-height: 1.1;
}

/* --- LIGHTNING ROUNDS STYLES --- */
.circle.waiting {
  background: radial-gradient(circle, #ef4444 0%, #b91c1c 100%) !important;
  /* Red */
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
  animation: pulse-red 2s infinite;
}

.circle.active {
  background: radial-gradient(circle, #4ade80 0%, #22c55e 100%) !important;
  /* Green */
  box-shadow: 0 0 40px rgba(34, 197, 94, 0.8);
  transform: scale(1.05);
  cursor: pointer;
}

.circle.clicked {
  background: #6b7280 !important;
  /* Gray */
  transform: scale(0.95);
  box-shadow: none;
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* Reaction Toast */
.reaction-toast {
  position: fixed;
  transform: translate(-50%, -50%) scale(0.5);
  opacity: 0;
  pointer-events: none;
  z-index: 2000;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reaction-toast.show {
  transform: translate(-50%, -120%) scale(1.2);
  opacity: 1;
}

.reaction-toast .time {
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: -5px;
}

.reaction-toast .points {
  font-size: 3rem;
  line-height: 1;
}

.reaction-toast.fast .points {
  color: #4ade80;
  text-shadow: 0 0 20px #22c55e;
}

.reaction-toast.medium .points {
  color: #facc15;
}

.reaction-toast.slow .points {
  color: #fb923c;
}

.reaction-toast.false-start span {
  color: #ef4444;
  font-size: 2rem;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

.stat {
  background: color-mix(in srgb, var(--bg) 60%, var(--card) 40%);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.stat .label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.stat .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.row {
  display: flex;
  gap: 1rem;
}

.row .btn {
  flex-grow: 1;
}

/* Transition Bar */
#transition-bar {
  width: 100%;
  height: 10px;
  background-color: color-mix(in srgb, var(--muted) 30%, transparent);
  border-radius: 5px;
  overflow: hidden;
  /* Ensures the inner bar stays contained */
}

/* Re-style the bar itself, not a pseudo-element */
#transition-bar {
  width: 0%;
  /* Controlled by JS */
  height: 100%;
  background-color: var(--primary);
  border-radius: 5px;
  transition: width 0.25s linear;
}

.transition-text {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: -8px;
}

/* Leaderboard */
.leaderboard-container {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid color-mix(in srgb, var(--muted) 30%, transparent);
  border-radius: 8px;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
}

.tbl th,
.tbl td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid color-mix(in srgb, var(--muted) 30%, transparent);
}

.tbl th {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 60%, var(--card) 40%);
  position: sticky;
  top: 0;
}

.tbl tr:last-child td {
  border-bottom: none;
}

.tbl td.rk {
  font-weight: 700;
  color: var(--primary);
  width: 3rem;
}

.tbl td.nm {
  font-weight: 500;
}

.tbl td.sc {
  font-weight: 700;
  text-align: right;
  width: 6rem;
}

/* User Controls */
.actions-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  /* This is the fix! */
}

.actions-row .input {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.actions-row .btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.balance-display {
  font-size: 0.9rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--card) 50%, var(--bg) 50%);
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.balance-display span {
  color: var(--text);
}

/* Wallet Deposit */
.wallet-section {
  margin-top: 16px;
  padding: 12px;
  background: color-mix(in srgb, var(--card) 92%, black);
  border-radius: 12px;
}

.wallet-section h3 {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
}

.wallet-section .input {
  flex: 1;
}

.hint {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Prize Tiers (Original style, now separate) */
.prize-tiers {
  margin-top: 1rem;
  padding: 12px;
  background: color-mix(in srgb, var(--card) 92%, black);
  border-radius: 12px;
}

.prize-tiers h4 {
  margin: 0 0 8px 0;
  color: var(--muted);
}

.prize-tiers ul {
  margin: 0;
  padding-left: 20px;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}

/* Past Results Screen */
.past-results-header {
  display: flex;
  justify-content: space-between;
  /* Corrected from 'between' */
  align-items: center;
  margin-bottom: 1.5rem;
}

.past-results-header h2 {
  margin: 0;
}

.past-results-container {
  max-height: 60vh;
  overflow-y: auto;
  border: 1px solid color-mix(in srgb, var(--muted) 30%, transparent);
  border-radius: 8px;
}

/* Tutorial Overlay */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.tutorial-content {
  background-color: var(--card);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid color-mix(in srgb, var(--muted) 20%, transparent);
}

.tutorial-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--muted) 20%, transparent);
  margin-bottom: 1.5rem;
}

.tutorial-header h3 {
  margin: 0;
  color: var(--primary);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.tutorial-body {
  position: relative;
  min-height: 200px;
  margin-bottom: 20px;
}

.tutorial-message {
  font-size: 1.1rem;
  line-height: 1.6;
  text-align: center;
  padding: 20px;
  background: color-mix(in srgb, var(--card) 95%, black);
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
}

.tutorial-highlight {
  position: absolute;
  border: 3px solid var(--primary);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(34, 197, 94, 0.1), 0 0 30px rgba(34, 197, 94, 0.3);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 10001;
}

.tutorial-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid color-mix(in srgb, var(--muted) 20%, transparent);
}

.tutorial-progress {
  font-size: 0.9rem;
  color: var(--muted);
}

.tutorial-actions {
  display: flex;
  gap: 0.5rem;
}

.tutorial-pulse {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 var(--ring);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
  }
}

/* Improved Notification Styles */
.wallet-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 320px;
  background-color: var(--card);
  border: 1px solid color-mix(in srgb, var(--muted) 30%, transparent);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  animation: slide-in 0.3s ease-out;
}

.notification-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  margin: -4px -4px 0 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.notification-close:hover {
  background: color-mix(in srgb, var(--muted) 20%, transparent);
  color: var(--text);
}

.notification-warning {
  border-left: 4px solid #f97316;
}

.notification-error {
  border-left: 4px solid #ef4444;
}

.notification-success {
  border-left: 4px solid #22c55e;
}

.notification-info {
  border-left: 4px solid #3b82f6;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Withdrawal Modal Styles --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 9000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal-content {
  background-color: var(--card);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid color-mix(in srgb, var(--muted) 20%, transparent);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--muted) 20%, transparent);
}

.modal-header h3 {
  margin: 0;
  color: var(--primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: color-mix(in srgb, var(--muted) 20%, transparent);
  color: var(--text);
}

.modal-body {
  margin-bottom: 1.5rem;
}

.modal-footer {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.withdraw-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.withdraw-input-group label {
  font-weight: 600;
  color: var(--text);
}

.withdraw-amount {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.withdraw-amount .input {
  flex: 1;
}

.currency-symbol {
  color: var(--muted);
  font-weight: 600;
}

.withdraw-info {
  background: color-mix(in srgb, var(--card) 95%, black);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--muted) 20%, transparent);
}

.withdraw-info p {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.withdraw-info p:last-child {
  margin-bottom: 0;
}

.minimum-amount {
  color: var(--primary);
  font-weight: 600;
}


/* === SLIDE-OUT PANEL STYLES === */
/* --- Wallet Slide-Out Panel --- */
.wallet-panel {
  position: fixed;
  top: 0;
  right: -100%;
  /* Start off-screen */
  width: 100%;
  max-width: 380px;
  /* Max width for larger screens */
  height: 100%;
  height: 100dvh;
  background: var(--card);
  border-left: 1px solid color-mix(in srgb, var(--muted) 20%, transparent);
  box-shadow: -10px 0 25px -5px rgba(0, 0, 0, 0.1);
  z-index: 9500;
  transition: right 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
}

.wallet-panel.open {
  right: 0;
  /* Slide in */
}

.wallet-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--muted) 20%, transparent);
}

.wallet-panel-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text);
}

.btn-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.75rem;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-close:hover {
  background: color-mix(in srgb, var(--muted) 20%, transparent);
  color: var(--text);
}

.wallet-panel-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex-grow: 1;
}

/* Override styles for the moved wallet section */
.wallet-panel-body .wallet-section {
  margin-top: 0;
  padding: 0;
  background: none;
  border-radius: 0;
}

/* === ICON BUTTON STYLE === */
/* Style for the 'three dots' button in the header */
.btn-icon {
  font-family: inherit;
  font-size: 1.5rem;
  /* Make icon larger */
  font-weight: 700;
  line-height: 1;
  padding: 0.5rem 0.75rem;
  /* Make it more square-ish */
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: color-mix(in srgb, var(--muted) 20%, transparent);
  color: var(--text);
}

.btn-icon:focus-visible {
  box-shadow: 0 0 0 4px var(--ring);
}

/* === HEADER LOGO STYLES === */
.title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  /* 12px */
}

.header-logo {
  height: 36px;
  /* 36px tall */
  width: 36px;
  /* 36px wide */
}

/* Make title margin consistent */
.title-wrap .title {
  margin: 0;
}

/* === NEW CHAT STYLES === */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: color-mix(in srgb, var(--bg) 60%, var(--card) 40%);
  border-radius: 8px;
  margin-bottom: 1rem;
  max-height: 400px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-message {
  padding: 0.75rem;
  border-radius: 12px;
  max-width: 85%;
  word-wrap: break-word;
}

.own-message {
  align-self: flex-end;
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
}

.other-message {
  align-self: flex-start;
  background: color-mix(in srgb, var(--card) 80%, var(--bg) 20%);
  border: 1px solid color-mix(in srgb, var(--muted) 20%, transparent);
}

.chat-message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
}

.chat-username {
  font-weight: 600;
  color: var(--primary);
}

.chat-timestamp {
  color: var(--muted);
  font-size: 0.7rem;
}

.chat-message-content {
  font-size: 0.9rem;
  line-height: 1.4;
}

.no-messages {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 2rem;
}

.chat-input-container {
  display: flex;
  gap: 0.5rem;
}

.chat-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--muted) 40%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 60%, var(--card) 40%);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: var(--primary);
}

/* === UPDATED MOBILE STYLES === */
/* These rules apply to phones (screens 768px wide or less) */
@media (max-width: 768px) {
  #app {
    /* Fix 1: Remove padding AND max-width to kill the "carpet" */
    padding: 0;
    max-width: none;
  }

  .header {
    /* Add padding back to the header so it's not flush with the edge */
    /* We also add a border to separate it from the card below */
    padding: 1rem;
    border-bottom: 1px solid color-mix(in srgb, var(--muted) 30%, transparent);
  }

  .card {
    /* Make cards full-width on mobile with no rounded corners */
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
    /* Remove shadows on mobile */
  }

  /* Specific fix for auth card to make it look right */
  #auth-screen.card {
    /* Remove top/bottom borders on the auth card */
    border-top: none;
    border-bottom: none;
  }

  /* Fix for "long fields": Stack "First name" and "Last name" vertically */
  .grid-2 {
    grid-template-columns: 1fr;
  }

  /* === NEW FIX FOR WALLET PANEL OVERFLOW === */
  /* This stacks the deposit input and button vertically on mobile */
  .wallet-panel-body .row {
    flex-direction: column;
  }

  /* Chat mobile optimizations */
  .chat-message {
    max-width: 90%;
  }

  .chat-input-container {
    flex-direction: column;
  }
}

/* ... at the end of style.css ... */

/* Styles for the new InnBucks modal */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: color-mix(in srgb, var(--muted) 20%, transparent);
  color: var(--text);
}

/* Spinner for polling */
.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-spin 0.75s linear infinite;
  margin-bottom: -0.125em;
  margin-right: 0.5em;
}

@keyframes spinner-spin {
  to {
    transform: rotate(360deg);
  }
}


