/* Utility helpers */
.hidden {
  display: none !important;
}

:root {
  --bg: #0b0e14;
  --panel: #111522;
  --panel-2: #0f1320;
  --text: #e8ecf1;
  --muted: #9aa3b2;
  --brand: #6c5ce7;
  --green: #2ecc71;
  --red: #ff6b6b;
  --border: rgba(255, 255, 255, .08);
  --shadow: 0 6px 20px rgba(0, 0, 0, .35);
  --radius: 16px;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial;
  background: linear-gradient(180deg, #090c13, #0b0e14 20%, #0b0e14);
  color: var(--text);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(10, 13, 20, .7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: radial-gradient(65% 65% at 30% 30%, #9d8cff, var(--brand));
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.titles h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: .4px
}

.subtitle {
  font-size: 12px;
  color: var(--muted)
}

.actions {
  display: flex;
  gap: 8px
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text);
  transition: .15s transform ease, .15s opacity ease, .15s background ease, .15s border ease;
  cursor: pointer;
  background: transparent;
  font-size: 14px;
}

.btn:hover {
  transform: translateY(-1px);
  opacity: .95
}

.btn.primary {
  background: var(--brand);
  border-color: transparent;
  color: white
}

.btn.ghost:hover {
  border-color: #2a3350
}

.container {
  max-width: 1400px;
  margin: 24px auto;
  padding: 0 16px
}

/* Equity Grid - Landing Page */
.equity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.equity-card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.equity-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: 0 8px 30px rgba(108, 92, 231, 0.3);
}

.equity-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #9d8cff, var(--brand));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  color: white;
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.4);
}

.equity-name {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.equity-price {
  font-size: 28px;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 8px;
}

.equity-change {
  font-size: 14px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  display: inline-block;
}

.equity-change.positive {
  background: rgba(46, 204, 113, 0.2);
  color: var(--green);
}

.equity-change.negative {
  background: rgba(255, 107, 107, 0.2);
  color: var(--red);
}

/* Trading Page Layout */
.trading-container {
  max-width: 1600px;
}

.trading-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  margin-top: 24px;
}

.left-column {
  min-width: 0;
}

.right-column {
  min-width: 0;
}

/* Position Card - Simple */
.position-card-simple {
  background: linear-gradient(135deg, rgba(15, 19, 32, 0.95), rgba(17, 21, 34, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.position-simple-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.position-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.position-value {
  font-size: 32px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  flex: 1;
  text-align: center;
}

.position-value.positive {
  color: var(--green);
}

.position-value.negative {
  color: var(--red);
}

.position-live {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  background: rgba(108, 92, 231, 0.1);
  border: 1px solid rgba(108, 92, 231, 0.3);
  border-radius: 6px;
}

/* Order Book Card */
.order-book-card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card .head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 14px 8px 14px;
  border-bottom: 1px solid var(--border);
}

.sym {
  font-weight: 700;
  letter-spacing: 0.6px;
  font-size: 18px;
}

.ref {
  font-size: 22px;
  font-weight: 800;
}

.ref.up {
  color: var(--green);
}

.ref.down {
  color: var(--red);
}

.meta {
  display: flex;
  gap: 10px;
  padding: 6px 14px;
  color: var(--muted);
  font-size: 12px;
}

.order-actions {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

/* Ladder */
.ladder {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  table-layout: fixed;
}

.ladder th,
.ladder td {
  padding: 8px;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
  text-align: center;
}

.ladder th {
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}

.ladder td {
  text-align: center;
}

.ladder td.div {
  text-align: center;
  color: var(--muted);
}

.ladder th:first-child,
.ladder td:first-child,
.ladder th:last-child,
.ladder td:last-child {
  width: 70px;
}

.row-ask td {
  color: var(--red);
}

.row-bid td {
  color: var(--green);
}

.midrow td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.mid-action-left {
  text-align: left;
  padding-left: 20px !important;
}

.mid-action-right {
  text-align: right;
  padding-right: 20px !important;
}

.mid-divider {
  text-align: center;
  font-weight: 600;
  color: var(--muted);
  font-size: 11px;
}

.mid-add-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  border: 2px solid;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
}

.add-ask-btn {
  border-color: var(--red);
  color: var(--red);
}

.add-ask-btn:hover {
  background: var(--red);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.add-bid-btn {
  border-color: var(--green);
  color: var(--green);
}

.add-bid-btn:hover {
  background: var(--green);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

/* Trade buttons */
.action-cell {
  padding: 4px !important;
}

.trade-btn {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  opacity: 0;
  pointer-events: none;
}

.row-ask:hover .buy-btn,
.row-bid:hover .sell-btn {
  opacity: 1;
  pointer-events: auto;
}

.buy-btn {
  background: var(--green);
  color: white;
}

.buy-btn:hover {
  background: #27ae60;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(46, 204, 113, 0.4);
}

.sell-btn {
  background: var(--red);
  color: white;
}

.sell-btn:hover {
  background: #e74c3c;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

/* News Card */
.news-card,
.game-info-card {
  height: fit-content;
}

.scrollable-content {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.scrollable-content::-webkit-scrollbar {
  width: 6px;
}

.scrollable-content::-webkit-scrollbar-track {
  background: transparent;
}

.scrollable-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.scrollable-content::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.clickable {
  user-select: none;
}

.expand-icon {
  font-size: 14px;
  transition: transform 0.2s ease;
  color: var(--muted);
}

.expand-icon.expanded {
  transform: rotate(-180deg);
}

.game-instructions {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

/* My Orders */
.order-item {
  padding: 12px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.order-item.buy-order {
  border-left: 3px solid var(--green);
}

.order-item.sell-order {
  border-left: 3px solid var(--red);
}

.order-info {
  flex: 1;
  min-width: 0;
}

.order-side {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.order-side.buy {
  color: var(--green);
}

.order-side.sell {
  color: var(--red);
}

.order-details {
  font-size: 13px;
  color: var(--text);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.order-details span {
  white-space: nowrap;
}

.order-price {
  font-weight: 600;
}

.order-qty {
  color: var(--muted);
}

.cancel-order-btn {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--red);
  background: rgba(255, 107, 107, 0.1);
  color: var(--red);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.cancel-order-btn:hover {
  background: var(--red);
  color: white;
  transform: translateY(-1px);
}

.cancel-order-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.news-content,
.game-instructions {
  padding: 16px;
}

.game-instructions h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}

.game-instructions p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
  white-space: pre-wrap;
}

.news-item {
  padding: 16px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.news-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.news-time {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.news-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.news-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* Stat labels and values */
.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.stat-value.positive {
  color: var(--green);
}

.stat-value.negative {
  color: var(--red);
}

/* Blink animation */
.blink {
  animation: blink 0.5s;
}

@keyframes blink {
  0% {
    filter: brightness(1.4);
  }

  100% {
    filter: brightness(1);
  }
}

/* Modal */
.modal {
  border: none;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.panel {
  width: min(560px, 94vw);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  box-shadow: var(--shadow);
  color: var(--text);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-body {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.panel-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.icon-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 12px;
  color: var(--muted);
}

.field input,
.field select {
  background: #0e1220;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.row-2 {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.seg {
  display: flex;
  gap: 14px;
}

.small {
  font-size: 12px;
  color: var(--muted);
}

/* Quick Trade Modal */
.qt-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  margin-bottom: 20px;
}

.qt-side {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 8px;
  letter-spacing: 0.5px;
}

.qt-side.buy {
  background: rgba(46, 204, 113, 0.2);
  color: var(--green);
  border: 1px solid var(--green);
}

.qt-side.sell {
  background: rgba(255, 107, 107, 0.2);
  color: var(--red);
  border: 1px solid var(--red);
}

.qt-symbol {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.qt-price-label {
  font-size: 14px;
  color: var(--muted);
}

.qt-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand);
}

#qt-qty-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  appearance: none;
}

#qt-qty-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.4);
}

#qt-qty-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.6);
}

#qt-qty-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.4);
}

#qt-qty-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.6);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.qt-summary {
  padding: 16px;
  background: rgba(108, 92, 231, 0.05);
  border: 1px solid rgba(108, 92, 231, 0.2);
  border-radius: 10px;
  margin-top: 16px;
}

.qt-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.qt-summary-row span:first-child {
  color: var(--muted);
  font-weight: 500;
}

.qt-summary-row span:last-child {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

#qt-qty-display {
  font-weight: 700;
  color: var(--brand);
  font-size: 16px;
}

/* ---- Game Sections (Home Page) ---- */

.market-page-header {
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.market-page-header h2 {
  margin: 0 0 4px 0;
  font-size: 26px;
  font-weight: 700;
}

.market-page-header p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.game-section {
  margin-bottom: 48px;
}

.game-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.game-section-icon {
  font-size: 28px;
  line-height: 1;
}

.game-section-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text);
}

/* Market Simulation card */
.market-sim-card {
  grid-column: 1 / -1;
  max-width: 100%;
  padding-bottom: 16px;
}

.market-sim-stocks {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.market-sim-stock {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}

.market-sim-stock:hover {
  background: rgba(108, 92, 231, 0.1);
  border-color: rgba(108, 92, 231, 0.3);
  transform: translateX(4px);
}

.market-sim-stock-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.market-sim-stock-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

/* Coming Soon card */
.coming-soon-card {
  opacity: 0.7;
  cursor: default;
  position: relative;
  overflow: hidden;
}

.coming-soon-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, transparent 40%, rgba(225, 112, 85, 0.06) 100%);
  pointer-events: none;
}

.coming-soon-card:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: var(--shadow);
  opacity: 0.8;
}

.coming-soon-label {
  color: var(--muted) !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  letter-spacing: 1px;
  text-transform: uppercase;
  animation: pulse-soft 2.5s ease-in-out infinite;
}

@keyframes pulse-soft {

  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

.footer {
  margin: 26px auto 40px;
  max-width: 1400px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
  .trading-layout {
    grid-template-columns: 1fr;
  }

  .right-column {
    order: 2;
  }
}

@media (max-width: 768px) {
  .equity-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .position-stats {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

/* ---- 5Os Card Game ---- */

/* Playing cards */
.playing-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 90px;
  background: #1a1f35;
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--card-color, #c8d6e5);
  font-weight: 700;
  gap: 2px;
  transition: transform 0.2s;
}

.playing-card:hover {
  transform: translateY(-2px);
}

.playing-card .card-rank {
  font-size: 22px;
}

.playing-card .card-suit {
  font-size: 18px;
}

.playing-card.large {
  width: 80px;
  height: 112px;
}

.playing-card.large .card-rank {
  font-size: 28px;
}

.playing-card.large .card-suit {
  font-size: 22px;
}

/* Rules page */
.fiveos-rules {
  max-width: 700px;
  margin: 0 auto;
}

.fiveos-rules h2 {
  margin-bottom: 24px;
  font-size: 28px;
}

.rules-section {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.rules-section h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
}

.rules-section p,
.rules-section ol {
  margin: 4px 0;
  color: var(--muted);
  line-height: 1.6;
}

.rules-section ol {
  padding-left: 20px;
}

.rules-section strong {
  color: var(--text);
}

/* Join form */
.fiveos-join {
  text-align: center;
}

.join-form {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
}

/* Lobby */
.fiveos-lobby {
  max-width: 600px;
  margin: 0 auto;
}

.fiveos-lobby h2 {
  margin-bottom: 20px;
}

.lobby-players {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.lobby-name {
  flex: 1;
  font-weight: 600;
}

/* Team badges */
.team-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.team-badge.team-a {
  background: #6c5ce7;
  color: white;
}

.team-badge.team-b {
  background: #00cec9;
  color: #0e1220;
}

.team-badge.unassigned {
  background: var(--border);
  color: var(--muted);
}

/* Admin controls */
.admin-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.join-code-display {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.join-code-display .label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.join-code-display .code {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--brand);
}

/* Round */
.fiveos-round {
  max-width: 700px;
  margin: 0 auto;
}

.round-cards {
  margin-bottom: 24px;
}

.round-card-group {
  margin-bottom: 16px;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.round-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.round-card-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.card-slot {
  text-align: center;
}

.card-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Submit form */
.submit-form {
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 20px;
}

.submit-form h3 {
  margin: 0 0 16px 0;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.form-question {
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.form-question label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.form-question input {
  width: 100%;
  padding: 10px 12px;
  background: #0e1220;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 16px;
  margin-bottom: 8px;
  box-sizing: border-box;
}

.pos-toggle {
  display: flex;
  gap: 6px;
}

.pos-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s;
}

.pos-btn.active[data-pos="long"] {
  background: #00b894;
  color: white;
  border-color: #00b894;
}

.pos-btn.active[data-pos="short"] {
  background: #e17055;
  color: white;
  border-color: #e17055;
}

/* Submitted state */
.submitted-banner {
  padding: 16px 20px;
  background: rgba(0, 184, 148, 0.1);
  border: 1px solid rgba(0, 184, 148, 0.3);
  border-radius: 12px;
  margin-bottom: 20px;
  text-align: center;
}

.submitted-banner span {
  font-weight: 700;
  font-size: 16px;
}

.submitted-details {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* Past medians table */
.past-medians {
  margin-top: 20px;
}

.past-medians table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
}

.past-medians th,
.past-medians td {
  padding: 10px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.past-medians th {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Finished / results */
.fiveos-finished {
  max-width: 700px;
  margin: 0 auto;
}

.results-section {
  margin-bottom: 28px;
}

.results-section h3 {
  margin-bottom: 12px;
}

.actuals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.actual-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.actual-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.actual-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--brand);
}

.final-deck {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.team-results {
  display: flex;
  gap: 16px;
}

.team-result {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.team-result.team-winner {
  border-color: gold;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.2);
}

.team-pnl {
  font-size: 22px;
  font-weight: 800;
}

.winner-label {
  font-size: 14px;
  font-weight: 700;
  color: gold;
}

.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.lb-row.lb-first {
  border-color: gold;
}

.lb-rank {
  font-weight: 700;
  color: var(--muted);
  width: 32px;
}

.lb-name {
  flex: 1;
  font-weight: 600;
}

.lb-pnl {
  font-weight: 700;
  font-size: 16px;
}

/* Small buttons */
.btn.small {
  padding: 4px 10px;
  font-size: 12px;
}

.fiveos-loading {
  text-align: center;
  padding: 60px;
  color: var(--muted);
  font-size: 16px;
}

/* Charts */
.chart-container {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-top: 8px;
}

.chart-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.chart-tab {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s;
}

.chart-tab.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.chart-tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
}

.hl-tmpl-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
}

.hl-tmpl-btn:hover {
  border-color: var(--muted);
}

.hl-tmpl-check {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ---- Headline Game ---- */
.hl-loading {
  text-align: center;
  padding: 60px;
  color: var(--muted);
}

.hl-game {
  max-width: 960px;
  margin: 0 auto;
}

.hl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.hl-header h2 {
  margin: 0;
}

.hl-timer {
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--brand);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 20px;
}

.hl-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

.hl-left,
.hl-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hl-price-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  text-align: center;
}

.hl-price-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hl-price-display {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  margin: 4px 0;
  font-variant-numeric: tabular-nums;
}

.hl-price-change {
  font-size: 16px;
  font-weight: 600;
}

.hl-trade-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
}

.hl-pnl-row,
.hl-position-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.hl-pnl-label,
.hl-pos-label {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hl-pnl-value {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.hl-pos-value {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hl-slider-row {
  margin: 12px 0 8px;
}

.hl-slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
  height: 6px;
  cursor: pointer;
}

.hl-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.hl-trade-btns {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.hl-trade-btns .btn {
  flex: 1;
  font-size: 11px;
  padding: 8px 4px;
  white-space: nowrap;
}

.hl-btn-short {
  background: #d63031 !important;
}

.hl-btn-sell {
  background: #e17055 !important;
}

.hl-btn-flat {
  background: #636e72 !important;
}

.hl-btn-buy {
  background: #00b894 !important;
}

.hl-btn-long {
  background: #00cec9 !important;
}

.hl-news-section,
.hl-lb-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.hl-news-section h3,
.hl-lb-section h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.hl-news-feed {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hl-news-item {
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.hl-news-item.bullish {
  border-left-color: #00b894;
}

.hl-news-item.bearish {
  border-left-color: #ff6b6b;
}

.hl-news-time {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

.hl-news-caption {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.hl-news-detail {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

.hl-leaderboard {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hl-lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.hl-lb-first {
  background: rgba(108, 92, 231, 0.15);
}

.hl-lb-pos {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
}

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

  .hl-trade-btns {
    flex-wrap: wrap;
  }

  .hl-trade-btns .btn {
    flex: 1 1 30%;
  }
}

/* News strength badges (active game) */
.hl-news-strength {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  color: #0a0a0a;
}

.hl-str-strong {
  background: #e84393;
  color: #fff;
}

.hl-str-moderate {
  background: #fdcb6e;
}

.hl-str-weak {
  background: #636e72;
  color: #ddd;
}

/* Analysis cards (finished view) */
.hl-analysis-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hl-analysis-card {
  padding: 14px 16px;
  border-radius: 10px;
  border-left: 4px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.hl-analysis-card.bullish {
  border-left-color: #00b894;
}

.hl-analysis-card.bearish {
  border-left-color: #ff6b6b;
}

.hl-analysis-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.hl-analysis-time {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  font-family: monospace;
}

.hl-analysis-dir {
  font-size: 13px;
  font-weight: 700;
}

.hl-analysis-strength {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  color: #0a0a0a;
}

.hl-analysis-caption {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.hl-analysis-detail {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.5;
}

.hl-analysis-prob {
  font-size: 12px;
  color: var(--brand);
  margin-bottom: 8px;
}

.hl-analysis-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  padding: 10px 12px;
  background: rgba(108, 92, 231, 0.08);
  border-radius: 6px;
  border-left: 3px solid var(--brand);
}

/* ===== POKER AUCTION ===== */
.pa-loading {
  text-align: center;
  padding: 60px;
  color: var(--muted);
}

.pa-game {
  max-width: 960px;
  margin: 0 auto;
}

.pa-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.pa-header h2 {
  margin: 0;
  font-size: 22px;
}

.pa-round-info {
  font-size: 14px;
  color: var(--brand);
  font-weight: 700;
  background: rgba(108, 92, 231, 0.15);
  padding: 4px 12px;
  border-radius: 6px;
}

/* Cards */
.pa-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 76px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: #1e272e;
  font-weight: 800;
  margin: 3px;
  cursor: default;
  transition: transform 0.15s;
}

.pa-card:hover {
  transform: translateY(-3px);
}

.pa-card.red {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.4);
}

.pa-card.black {
  color: #dfe6e9;
  border-color: rgba(223, 230, 233, 0.3);
}

.pa-card-rank {
  font-size: 18px;
  line-height: 1;
}

.pa-card-suit {
  font-size: 20px;
  line-height: 1;
  margin-top: 2px;
}

.pa-card.small {
  width: 40px;
  height: 56px;
}

.pa-card.small .pa-card-rank {
  font-size: 13px;
}

.pa-card.small .pa-card-suit {
  font-size: 15px;
}

.pa-card.tiny {
  width: 30px;
  height: 42px;
  margin: 1px;
}

.pa-card.tiny .pa-card-rank {
  font-size: 11px;
}

.pa-card.tiny .pa-card-suit {
  font-size: 12px;
}

.pa-cards-display {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 8px 0;
}

/* Sections */
.pa-auction-section,
.pa-my-section,
.pa-teams-section,
.pa-listings-section {
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.pa-auction-section h3,
.pa-my-section h3,
.pa-teams-section h3,
.pa-listings-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

/* Team rows */
.pa-team-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.pa-team-row.pa-mine {
  background: rgba(108, 92, 231, 0.12);
}

.pa-team-name {
  flex: 1;
  font-weight: 600;
}

.pa-team-cards {
  color: var(--muted);
  font-size: 12px;
  width: 60px;
  text-align: center;
}

.pa-team-money {
  font-weight: 700;
  color: #00b894;
  width: 70px;
  text-align: right;
}

.pa-team-bid-status {
  width: 30px;
  text-align: center;
}

/* Bid form */
.pa-bid-form {
  padding: 16px;
  border-radius: 12px;
  background: rgba(108, 92, 231, 0.08);
  border: 1px solid var(--brand);
  margin: 12px 0;
}

.pa-bid-form label {
  font-weight: 600;
  font-size: 14px;
}

.pa-bid-submitted {
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(0, 184, 148, 0.12);
  border: 1px solid rgba(0, 184, 148, 0.3);
  color: #00b894;
  font-weight: 600;
  margin: 12px 0;
}

/* Result */
.pa-result-box {
  padding: 16px;
  border-radius: 12px;
  background: rgba(253, 203, 110, 0.08);
  border: 1px solid rgba(253, 203, 110, 0.3);
  margin: 12px 0;
  text-align: center;
}

.pa-result-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.pa-result-paid {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}

.pa-bids-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.pa-bid-chip {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

.pa-bid-chip.winner {
  background: rgba(0, 184, 148, 0.15);
  border-color: #00b894;
  color: #00b894;
}

/* Post-auction */
.pa-card-select-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pa-card-checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.15s;
}

.pa-card-checkbox:hover {
  background: rgba(108, 92, 231, 0.1);
}

.pa-card-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.pa-submit-status {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

.pa-submit-status.done {
  background: rgba(0, 184, 148, 0.12);
  border-color: #00b894;
  color: #00b894;
}

.pa-btn-sell {
  background: #00b894 !important;
}

.pa-btn-auction {
  background: #6c5ce7 !important;
}

/* Post-bidding listings */
.pa-listing-card {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 12px;
}

.pa-listing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pa-listing-seller {
  font-weight: 700;
  font-size: 14px;
}

/* Final standings */
.pa-final-standings {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pa-final-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
}

.pa-final-row.pa-final-top {
  background: rgba(108, 92, 231, 0.08);
  border-color: var(--brand);
}

.pa-final-rank {
  font-size: 20px;
  width: 40px;
  text-align: center;
}

.pa-final-info {
  flex: 1;
}

.pa-final-name {
  font-weight: 700;
  font-size: 15px;
}

.pa-final-hand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.pa-hand-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: rgba(108, 92, 231, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
}

.pa-hand-cards {
  display: flex;
  flex-wrap: wrap;
}

.pa-final-prize {
  font-size: 13px;
  font-weight: 600;
}

.pa-final-money {
  font-size: 18px;
  font-weight: 800;
  color: var(--brand);
}

/* History */
.pa-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pa-history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.02);
}

.pa-history-round {
  font-weight: 700;
  color: var(--brand);
  width: 30px;
}

.pa-history-cards {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
}

.pa-history-winner {
  font-weight: 600;
  width: 100px;
}

.pa-history-paid {
  font-weight: 600;
  color: #00b894;
  width: 50px;
  text-align: right;
}

/* Rules badges */
.pa-round-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(108, 92, 231, 0.12);
  color: var(--brand);
  border: 1px solid rgba(108, 92, 231, 0.25);
}

.pa-prize-badge {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
}

.pa-prize-badge.gold {
  background: rgba(253, 203, 110, 0.2);
  border-color: #fdcb6e;
  color: #fdcb6e;
}

.pa-prize-badge.silver {
  background: rgba(223, 230, 233, 0.15);
  border-color: #b2bec3;
  color: #b2bec3;
}

.pa-prize-badge.bronze {
  background: rgba(225, 112, 85, 0.15);
  border-color: #e17055;
  color: #e17055;
}

.pa-prize-badge.dim {
  color: var(--muted);
}

.pa-prize-badge.neg {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.3);
}

/* Per-card listing grid */
.pa-card-listings-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pa-card-listing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.pa-card-listing.pa-own {
  opacity: 0.5;
}

.pa-card-listing-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pa-card-listing-bid {
  flex-shrink: 0;
}

/* Awards table */
.pa-awards-table {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 4px;
}

.pa-award-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
}

.pa-award-hand {
  font-weight: 600;
}

.pa-award-amt {
  font-weight: 700;
  color: #00b894;
}

.pa-award-amt.dim {
  color: var(--muted);
}

/* ===== Mental Math ===== */
.mm-rules {
  max-width: 800px;
  margin: 0 auto;
}

.mm-type-badge {
  background: rgba(108, 92, 231, 0.1);
  border: 1px solid rgba(108, 92, 231, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  text-align: center;
}

/* Settings */
.mm-settings-grid {
  display: grid;
  gap: 20px;
  margin-top: 12px;
}

.mm-setting-group {
  display: grid;
  gap: 8px;
}

.mm-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mm-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.mm-checkbox,
.mm-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
}

.mm-checkbox:hover,
.mm-radio:hover {
  border-color: var(--brand);
  background: rgba(108, 92, 231, 0.05);
}

.mm-checkbox input,
.mm-radio input {
  accent-color: var(--brand);
}

.mm-radio-group {
  display: flex;
  gap: 8px;
}

.mm-setting-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.mm-input {
  background: #0e1220;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
  width: 100%;
}

.mm-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
}

.mm-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(108, 92, 231, 0.4);
}

.mm-join {
  margin-top: 20px;
}

.join-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* Lobby */
.mm-lobby {
  max-width: 600px;
  margin: 0 auto;
}

.mm-lobby-header {
  text-align: center;
  margin-bottom: 24px;
}

.mm-join-code-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 12px;
  padding: 16px;
  border: 2px dashed var(--brand);
  border-radius: 12px;
  background: rgba(108, 92, 231, 0.05);
}

.mm-code-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mm-code-value {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 10px;
  color: var(--brand);
}

.mm-settings-display {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 24px;
}

.mm-setting-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.mm-players-list {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.mm-players-list h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
}

.mm-player-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 6px;
}

.mm-player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #9d8cff, var(--brand));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: white;
}

.mm-player-name {
  font-weight: 600;
}

.mm-start-btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
}

.mm-waiting {
  color: var(--muted);
  text-align: center;
  padding: 20px 0;
}

.mm-waiting-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  color: var(--muted);
  font-size: 15px;
}

.mm-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  animation: mmPulse 1.5s ease-in-out infinite;
}

@keyframes mmPulse {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.mm-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 16px;
}

/* Playing */
.mm-play-container {
  max-width: 700px;
  margin: 0 auto;
}

.mm-play-header {
  margin-bottom: 24px;
}

.mm-progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mm-q-counter {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.mm-score-display {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
}

.mm-progress-bar-bg {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}

.mm-progress-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), #9d8cff);
  transition: width 0.3s ease;
}

.mm-question-card {
  position: relative;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.mm-type-indicator {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}

.mm-question-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.mm-q-text {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
}

.mm-q-label {
  font-size: 20px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.mm-q-option {
  font-size: 28px;
  font-weight: 700;
  margin: 4px 0;
}

.mm-equals {
  font-size: 36px;
  color: var(--muted);
}

.mm-q-mark {
  font-size: 48px;
  font-weight: 800;
  color: var(--brand);
}

/* Timer */
.mm-timer-bar-bg {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  margin: 16px 0 8px;
  overflow: hidden;
}

.mm-timer-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--green), #2ecc71);
  width: 100%;
}

.mm-timer-bar-fill.mm-timer-urgent {
  background: linear-gradient(90deg, var(--red), #ff6b6b) !important;
}

.mm-timer-text {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 20px;
}

/* Answer */
.mm-answer-area {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.mm-answer-input {
  width: 200px;
  padding: 14px 16px;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  border-radius: 12px;
  background: #0e1220;
  border: 2px solid var(--border);
  color: var(--text);
  transition: border-color 0.2s;
}

.mm-answer-input:focus {
  outline: none;
  border-color: var(--brand);
}

.mm-submit-btn {
  padding: 14px 28px;
  font-size: 16px;
}

.mm-comparison-btns {
  display: flex;
  gap: 16px;
}

.mm-choice-btn {
  width: 80px;
  height: 80px;
  font-size: 32px;
  font-weight: 800;
  border-radius: 16px;
  background: rgba(108, 92, 231, 0.1);
  border: 2px solid var(--brand);
  color: var(--brand);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mm-choice-btn:hover {
  background: var(--brand);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.4);
}

/* Feedback overlay */
.mm-feedback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  border-radius: 16px;
  animation: mmFadeIn 0.2s ease;
}

.mm-correct {
  background: rgba(46, 204, 113, 0.15);
  color: var(--green);
}

.mm-wrong {
  background: rgba(255, 107, 107, 0.15);
  color: var(--red);
}

@keyframes mmFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Waiting finish */
.mm-waiting-finish {
  text-align: center;
  padding: 60px 20px;
}

.mm-score-big {
  font-size: 64px;
  font-weight: 800;
  color: var(--brand);
  margin: 12px 0;
}

/* Finished */
.mm-finished {
  max-width: 700px;
  margin: 0 auto;
}

.mm-results-header {
  text-align: center;
  margin-bottom: 24px;
}

.mm-scoreboard-card,
.mm-review-card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.mm-scoreboard-card h3,
.mm-review-card h3 {
  margin: 0 0 16px 0;
}

.mm-score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.02);
}

.mm-winner {
  background: rgba(108, 92, 231, 0.1);
  border: 1px solid rgba(108, 92, 231, 0.3);
}

.mm-rank {
  font-size: 20px;
  width: 36px;
  text-align: center;
}

.mm-sb-name {
  flex: 1;
  font-weight: 600;
}

.mm-sb-score {
  font-weight: 700;
  color: var(--brand);
}

.mm-sb-pct {
  font-size: 13px;
  color: var(--muted);
  width: 48px;
  text-align: right;
}

/* Review */
.mm-review-list {
  display: grid;
  gap: 8px;
}

.mm-review-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.mm-r-correct {
  border-left: 3px solid var(--green);
}

.mm-r-wrong {
  border-left: 3px solid var(--red);
}

.mm-review-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  flex-shrink: 0;
}

.mm-review-body {
  flex: 1;
  min-width: 0;
}

.mm-review-question {
  font-size: 14px;
  margin-bottom: 4px;
  word-break: break-word;
}

.mm-review-answers {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.mm-review-correct-label strong {
  color: var(--green);
}

.mm-review-yours strong {
  color: var(--text);
}

@media (max-width: 600px) {
  .mm-q-text {
    font-size: 32px;
  }

  .mm-q-option {
    font-size: 22px;
  }

  .mm-equals {
    font-size: 28px;
  }

  .mm-q-mark {
    font-size: 32px;
  }

  .mm-answer-input {
    width: 150px;
    font-size: 20px;
  }

  .mm-setting-row {
    grid-template-columns: 1fr;
  }

  .mm-score-big {
    font-size: 48px;
  }
}