/* Main Layout & Component Styling - Developer-Friendly VS Code Dark Modern Theme */

html, body {
  height: 100%;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #181818;
  color: #d4d4d4;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Single Unified Minimal Menu Bar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  padding: 0 14px;
  background: #1f1f1f;
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  flex-shrink: 0;
}

.nav-group-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-brand-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: var(--tracking-tight);
  color: #ffffff;
}

.nav-btn {
  padding: 3px 10px;
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  border-radius: var(--radius-sm);
  color: #cccccc;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.nav-btn:hover {
  background: #37373d;
  color: #ffffff;
  border-color: #4c4c4c;
}

.nav-badge {
  font-family: var(--font-code);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  color: #cccccc;
}

.nav-challenge-title {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: #9d9d9d;
}

.nav-group-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-stat-item {
  font-family: var(--font-code);
  font-size: 12px;
  font-weight: 600;
  color: #cccccc;
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.nav-btn-icon {
  padding: 3px 8px;
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  border-radius: var(--radius-sm);
  color: #cccccc;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.nav-btn-icon:hover {
  color: #ffffff;
  background: #37373d;
  border-color: #4c4c4c;
}

/* App Main Container: Fixed Viewport Height with 100dvh Support */
.app-container {
  height: calc(100vh - 38px - 24px);
  height: calc(100dvh - 38px - 24px);
  max-height: calc(100vh - 38px - 24px);
  max-height: calc(100dvh - 38px - 24px);
  width: 100%;
  margin: 0 auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  background: #181818;
}

/* Tabs Navigation */
.view-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.tab-btn {
  padding: 5px 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: var(--tracking-wide);
  background: #252526;
  border: 1px solid #2d2d2d;
  border-radius: var(--radius-sm);
  color: #cccccc;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover {
  color: #ffffff;
  background: #2d2d2d;
  border-color: #3c3c3c;
}

.tab-btn.active {
  background: #1e1e1e;
  border-color: #007acc;
  color: #ffffff;
}

/* Lobby Hero */
.lobby-hero {
  text-align: center;
  margin: 4px 0 14px;
  flex-shrink: 0;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: #252526;
  border: 1px solid #2d2d2d;
  border-radius: var(--radius-sm);
  font-family: var(--font-code);
  font-size: 11px;
  font-weight: 600;
  color: #cccccc;
  margin-bottom: 6px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  color: #ffffff;
  margin-bottom: 4px;
}

.hero-title span {
  color: #3794ff;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 13px;
  color: #9d9d9d;
  line-height: var(--leading-normal);
  max-width: 600px;
  margin: 0 auto;
}

.lobby-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

/* Sequential Gauntlet Banner */
.gauntlet-card {
  background: #252526;
  border: 1px solid #2d2d2d;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.gauntlet-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gauntlet-level {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: #3794ff;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}

.gauntlet-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.gauntlet-desc {
  font-family: var(--font-body);
  font-size: 12px;
  color: #cccccc;
  line-height: var(--leading-normal);
}

.btn-gauntlet-play {
  padding: 6px 16px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: #0e639c;
  border: 1px solid #1177bb;
  color: #ffffff;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-gauntlet-play:hover {
  background: #1177bb;
}

/* Mode Cards Grid */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.mode-card {
  background: #252526;
  border: 1px solid #2d2d2d;
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.15s;
}

.mode-card:hover {
  border-color: #3c3c3c;
}

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

.mode-badge {
  font-family: var(--font-code);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  color: #cccccc;
}

.mode-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.mode-desc {
  font-family: var(--font-body);
  font-size: 12px;
  color: #cccccc;
  line-height: var(--leading-normal);
  margin-bottom: 12px;
}

.wager-selector {
  margin-bottom: 12px;
}

.wager-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: #858585;
  margin-bottom: 4px;
  display: block;
}

.wager-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.wager-pill {
  padding: 3px 8px;
  font-family: var(--font-code);
  font-size: 11px;
  font-weight: 600;
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  border-radius: var(--radius-sm);
  color: #cccccc;
  cursor: pointer;
  transition: all 0.15s;
}

.wager-pill:hover, .wager-pill.active {
  background: #0e639c;
  border-color: #1177bb;
  color: #ffffff;
}

.btn-play {
  width: 100%;
  padding: 7px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  border-radius: var(--radius-sm);
  background: #0e639c;
  border: 1px solid #1177bb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-play:hover {
  background: #1177bb;
}

/* ------------------------------------------------------------- */
/* CURRICULUM ROADMAP                                            */
/* ------------------------------------------------------------- */
.curriculum-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.curriculum-module {
  background: #252526;
  border: 1px solid #2d2d2d;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-family: var(--font-display);
}

.module-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.module-progress {
  font-family: var(--font-code);
  font-size: 11px;
  font-weight: 600;
  color: #858585;
}

.challenge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px;
}

.challenge-node {
  background: #1e1e1e;
  border: 1px solid #2d2d2d;
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.challenge-node:hover:not(.locked) {
  border-color: #007acc;
  background: #282828;
}

.challenge-node.current {
  border-color: #007acc;
  background: #1f2430;
}

.challenge-node.completed {
  border-color: #2d4530;
}

.challenge-node.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.node-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-code);
  font-size: 10px;
  color: #858585;
}

.node-status {
  font-weight: 600;
}

.challenge-node.completed .node-status {
  color: #89d185;
}

.challenge-node.current .node-status {
  color: #3794ff;
}

.node-title {
  font-size: 11px;
  font-weight: 500;
  color: #cccccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------- */
/* RULES TAB                                                     */
/* ------------------------------------------------------------- */
.rules-card {
  background: #252526;
  border: 1px solid #2d2d2d;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  color: #cccccc;
}

.rules-card h2 {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 10px;
}

.rules-card ul {
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
}

.rules-card li {
  margin-bottom: 8px;
}

.rules-card strong {
  color: #ffffff;
}

/* ------------------------------------------------------------- */
/* ARENA WORKSPACE: ZERO-SCROLL SPLIT VIEW                       */
/* ------------------------------------------------------------- */
.arena-split-layout {
  display: grid;
  grid-template-columns: minmax(280px, clamp(300px, 28vw, 360px)) 1fr;
  gap: 8px;
  flex: 1;
  height: 100%;
  overflow: hidden;
}

/* Left Column: Focused Documentation Pane (Clean Unboxed Flow) */
.instructions-panel {
  background: #1e1e1e;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  height: 100%;
  box-sizing: border-box;
  color: #cccccc;
}

/* Gamified Quest Meta Header */
.quest-meta-banner {
  background: #252526;
  border: 1px solid #2d2d2d;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.quest-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quest-level-tag {
  font-family: var(--font-code);
  font-size: 11px;
  font-weight: 700;
  color: #3794ff;
  letter-spacing: 0.5px;
}

.quest-difficulty {
  font-family: var(--font-code);
  font-size: 11px;
  font-weight: 600;
  color: #dcdcaa;
}

.quest-bounties {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-code);
  font-size: 11px;
  color: #858585;
}

.quest-bounty-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #cccccc;
}

.quest-speed-target {
  font-size: 11px;
  font-family: var(--font-code);
  color: #89d185;
  background: rgba(137, 209, 133, 0.08);
  padding: 3px 6px;
  border-radius: 2px;
  border: 1px solid rgba(137, 209, 133, 0.2);
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.section-label {
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #d4d4d4;
  font-weight: 600;
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.section-label.task-label {
  color: #d4d4d4;
}

/* Direct Text Content: Unboxed, Matching Parent Color */
.concept-box, .task-box {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  box-shadow: none;
  color: #cccccc;
}

.concept-text, .task-text {
  font-family: var(--font-body);
  font-size: 13px;
  color: #cccccc;
  line-height: 1.6;
}

.concept-text p, .task-text p {
  margin: 0 0 8px 0;
  color: #cccccc;
}

.concept-text p:last-child, .task-text p:last-child {
  margin-bottom: 0;
}

.concept-text strong, .task-text strong {
  color: #ffffff;
  font-weight: 600;
}

/* Inline Code Elements */
.inline-code, code {
  font-family: var(--font-code);
  font-size: 12px;
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  border-radius: 3px;
  padding: 1px 5px;
  color: #9cdcfe;
  font-weight: 500;
  display: inline-block;
  vertical-align: baseline;
}

/* Strategically Placed Collapsible Hint */
.hint-details {
  border: 1px solid var(--border-subtle);
  background: #252526;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: auto;
  transition: all 0.15s;
}

.hint-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: #cccccc;
  list-style: none;
  user-select: none;
  transition: all 0.15s;
}

.hint-summary::-webkit-details-marker {
  display: none;
}

.hint-summary:hover {
  color: #ffffff;
  background: #2d2d2d;
}

.hint-details[open] .hint-summary {
  color: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  background: #252526;
}

.hint-arrow {
  font-size: 10px;
  transition: transform 0.15s ease;
  display: inline-block;
}

.hint-details[open] .hint-arrow {
  transform: rotate(180deg);
}

.hint-content {
  padding: 8px 10px;
  background: #1e1e1e;
}

.hint-code-box {
  position: relative;
  background: #181818;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 8px 10px;
  overflow-x: auto;
}

.hint-code-box pre {
  margin: 0;
  font-family: var(--font-code);
  font-size: 12px;
  color: #d4d4d4;
  line-height: 1.5;
  white-space: pre-wrap;
}

.btn-copy-hint {
  position: absolute;
  top: 6px;
  right: 6px;
  font-family: var(--font-code);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  background: #2d2d2d;
  color: #cccccc;
  border: 1px solid #3c3c3c;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-copy-hint:hover {
  color: #ffffff;
  background: #37373d;
  border-color: #4c4c4c;
}

/* Contenders Radar */
.radar-compact {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}

.radar-compact-header {
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #858585;
  font-weight: 600;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
}

.player-tile-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  background: #252526;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: 11px;
  color: #cccccc;
  margin-bottom: 3px;
}

.player-tile-mini.is-human {
  border-color: #007acc;
  color: #ffffff;
}

/* ------------------------------------------------------------- */
/* MODALS (VS Code Dialog Style)                                 */
/* ------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-card {
  background: #252526;
  border: 1px solid #2d2d2d;
  border-radius: 4px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  margin-bottom: 6px;
  color: #ffffff;
}

.modal-title.win {
  color: #89d185;
}

.modal-title.lose {
  color: #f14c4c;
}

.payout-box {
  background: #1e1e1e;
  border: 1px solid #2d2d2d;
  border-radius: 3px;
  padding: 10px;
  margin: 12px 0;
}

.payout-amount {
  font-family: var(--font-code);
  font-size: 16px;
  font-weight: 700;
  color: #dcdcaa;
}

.modal-btn-primary {
  width: 100%;
  padding: 8px;
  background: #0e639c;
  border: 1px solid #1177bb;
  border-radius: 3px;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
}

.modal-btn-primary:hover {
  background: #1177bb;
}

.modal-btn-secondary {
  width: 100%;
  padding: 8px;
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  border-radius: 3px;
  color: #cccccc;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-btn-secondary:hover {
  background: #37373d;
  color: #ffffff;
}

.btn-kbd-badge {
  font-family: var(--font-code);
  font-size: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Profile Modal Details */
.profile-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.profile-modal-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.icon-btn {
  background: transparent;
  border: none;
  color: #858585;
  font-size: 14px;
  cursor: pointer;
}

.icon-btn:hover {
  color: #ffffff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.stat-box {
  background: #1e1e1e;
  border: 1px solid #2d2d2d;
  border-radius: 3px;
  padding: 8px;
  text-align: center;
}

.stat-number {
  font-family: var(--font-code);
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
}

.stat-label {
  font-size: 10px;
  color: #858585;
  margin-top: 2px;
}

.input-label {
  display: block;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #858585;
  margin-bottom: 4px;
}

.text-input {
  width: 100%;
  padding: 6px 10px;
  background: #1e1e1e;
  border: 1px solid #2d2d2d;
  border-radius: 3px;
  color: #d4d4d4;
  font-family: var(--font-body);
  font-size: 13px;
  box-sizing: border-box;
  margin-bottom: 12px;
}

.text-input:focus {
  outline: none;
  border-color: #007acc;
}

/* ------------------------------------------------------------- */
/* SIGNATURE VS CODE BOTTOM STATUS BAR                           */
/* ------------------------------------------------------------- */
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
  background: #007acc;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 11px;
  padding: 0 10px;
  z-index: 100;
  user-select: none;
  flex-shrink: 0;
  box-sizing: border-box;
}

.statusbar-group-left, .statusbar-group-center, .statusbar-group-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.statusbar-item {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: default;
  white-space: nowrap;
}

.statusbar-item.interactive {
  cursor: pointer;
  padding: 0 4px;
  border-radius: 2px;
  transition: background 0.15s;
}

.statusbar-item.interactive:hover {
  background: rgba(255, 255, 255, 0.2);
}

.statusbar-progress-bar {
  display: inline-flex;
  width: 50px;
  height: 6px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 3px;
  overflow: hidden;
  vertical-align: middle;
  margin-left: 4px;
}

.statusbar-progress-fill {
  height: 100%;
  background: #ffffff;
  transition: width 0.3s ease;
}

.statusbar-kbd {
  font-family: var(--font-code);
  font-size: 10px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 5px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ------------------------------------------------------------- */
/* ARENA MOBILE TABS (Segmented Control for Mobile)              */
/* ------------------------------------------------------------- */
.arena-mobile-tabs {
  display: none;
}

/* ------------------------------------------------------------- */
/* RESPONSIVE DESIGN & MEDIA QUERIES                             */
/* ------------------------------------------------------------- */

/* Tablet Breakpoint (<= 1024px) */
@media (max-width: 1024px) {
  .arena-split-layout {
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 6px;
  }

  .statusbar-group-center {
    display: none;
  }
}

/* Mobile Breakpoint (<= 768px) */
@media (max-width: 768px) {
  html, body {
    font-size: 13px;
  }

  .navbar {
    height: auto;
    min-height: 40px;
    padding: 6px 10px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .nav-group-left {
    gap: 6px;
    flex-wrap: wrap;
  }

  .nav-group-right {
    gap: 6px;
  }

  .nav-challenge-title {
    display: none;
  }

  .app-container {
    height: calc(100dvh - 42px - 26px);
    max-height: calc(100dvh - 42px - 26px);
    padding: 6px;
  }

  .view-tabs {
    gap: 4px;
    margin-bottom: 8px;
  }

  .tab-btn {
    padding: 5px 10px;
    font-size: 11px;
  }

  .modes-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .gauntlet-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .btn-gauntlet-play {
    width: 100%;
    justify-content: center;
  }

  .curriculum-module {
    padding: 10px 12px;
  }

  .challenge-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 5px;
  }

  /* Mobile Arena Segmented View System */
  .arena-mobile-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #1f1f1f;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 6px;
    flex-shrink: 0;
  }

  .mobile-tab-btn {
    flex: 1;
    padding: 6px 8px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    background: transparent;
    border: none;
    border-radius: 2px;
    color: #858585;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-tab-btn.active {
    background: #2d2d2d;
    color: #ffffff;
  }

  .arena-split-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    gap: 0;
  }

  /* Dynamic Mobile Tab Switching in Arena */
  .arena-split-layout[data-active-tab="mission"] .instructions-panel {
    display: flex;
    height: 100%;
    flex: 1;
  }

  .arena-split-layout[data-active-tab="mission"] .editor-workspace {
    display: none;
  }

  .arena-split-layout[data-active-tab="editor"] .instructions-panel {
    display: none;
  }

  .arena-split-layout[data-active-tab="editor"] .editor-workspace {
    display: flex;
    height: 100%;
    flex: 1;
  }

  .arena-split-layout[data-active-tab="editor"] .editor-container {
    display: flex;
    height: 100%;
    flex: 1;
  }

  .arena-split-layout[data-active-tab="editor"] .terminal-container {
    display: none;
  }

  .arena-split-layout[data-active-tab="terminal"] .instructions-panel {
    display: none;
  }

  .arena-split-layout[data-active-tab="terminal"] .editor-workspace {
    display: flex;
    height: 100%;
    flex: 1;
  }

  .arena-split-layout[data-active-tab="terminal"] .editor-container {
    display: none;
  }

  .arena-split-layout[data-active-tab="terminal"] .terminal-container {
    display: flex;
    height: 100%;
    flex: 1;
    max-height: 100%;
  }

  .instructions-panel {
    padding: 10px;
    gap: 10px;
  }

  .statusbar {
    height: 26px;
    padding: 0 8px;
    font-size: 10px;
  }

  .statusbar-group-right .statusbar-item:not(#statusbar-profile) {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-card {
    padding: 18px 16px;
    max-width: 92vw;
  }
}

/* Small Phones (<= 480px) */
@media (max-width: 480px) {
  .hero-title {
    font-size: 17px;
  }

  .hero-subtitle {
    font-size: 12px;
  }

  .challenge-grid {
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 4px;
  }

  .node-title {
    font-size: 10px;
  }

  .nav-brand-text {
    font-size: 12px;
  }

  .nav-btn, .nav-btn-icon, .nav-badge, .nav-stat-item {
    font-size: 11px;
    padding: 3px 6px;
  }

  .quest-bounties {
    gap: 6px;
    font-size: 10px;
  }
}

