* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-primary: rgba(29, 40, 53, 0.98);
  --bg-darker: #141c25;
  --bg-card: rgba(29, 40, 53, 0.85);
  --bg-input: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #375a7f;
  --accent: #375a7f;
  --accent-bright: #4a8abf;
  --text: #c8d0d8;
  --text-muted: #7a8a9a;
  --text-dim: #556070;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
}

body {
  font-family: 'Chakra Petch', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-darker);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
}

/* Scrollbar matching Solaris */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #303030; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

/* Landing page */
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  overflow: auto;
  background: var(--bg-primary);
}

.landing h1 {
  font-size: 2.4em;
  color: var(--accent-bright);
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 1.1em;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  max-width: 560px;
  width: 100%;
}

.card h2 { font-size: 1.3em; margin-bottom: 8px; color: var(--text); }
.card p { color: var(--text-muted); margin-bottom: 16px; font-size: 0.9em; }

.card form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

input[type="text"], textarea, select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.9em;
  flex: 1;
  outline: none;
}

input:focus, textarea:focus { border-color: var(--accent-bright); }

button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.9em;
  cursor: pointer;
  white-space: nowrap;
}

button:hover { background: var(--accent-bright); }

.btn-primary {
  width: 100%;
  padding: 12px;
  font-size: 1em;
  margin-top: 8px;
}

.help-section {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 20px;
}

.help-section h3 { font-size: 1em; margin-bottom: 12px; color: var(--text); }

.help-section ol {
  color: var(--text-muted);
  font-size: 0.85em;
  padding-left: 20px;
  margin-bottom: 16px;
  line-height: 1.8;
}

kbd {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 0.85em;
  color: var(--text);
}

code {
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 0.85em;
  color: var(--accent-bright);
}

.api-link {
  color: var(--accent-bright);
  word-break: break-all;
  font-size: 0.85em;
}

.hidden { display: none !important; }

#apiUrlResult, #apiResult {
  background: rgba(55, 90, 127, 0.12);
  border: 1px solid rgba(55, 90, 127, 0.3);
  border-radius: 4px;
  padding: 12px;
  margin-top: 8px;
}

#apiUrlResult p, #apiResult p { margin-bottom: 8px; color: var(--text-muted); }

/* Game tabs bar */
.game-tabs-bar {
  display: flex;
  align-items: center;
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border);
  height: 32px;
  padding: 0 4px;
  overflow-x: auto;
}

.game-tabs-bar:empty { display: none; }

.game-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  flex: 1;
}

.game-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.75em;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.game-tab:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.game-tab.active { color: #fff; border-bottom-color: var(--accent-bright); background: rgba(255,255,255,0.05); }

.game-tab .tab-close {
  font-size: 0.9em;
  opacity: 0.4;
  cursor: pointer;
  padding: 0 2px;
}

.game-tab .tab-close:hover { opacity: 1; color: var(--danger); }

.game-tab-add {
  width: 28px;
  height: 24px;
  padding: 0;
  font-size: 1.1em;
  border-radius: 4px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 4px;
}

.game-tab-add:hover { background: var(--accent); color: #fff; }

/* Viewer layout */
.viewer-layout {
  display: flex;
  height: calc(100vh - 32px);
  width: 100vw;
}

.map-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #0a0e14;
}

#mapCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.map-controls {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 4px;
}

.map-controls button {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 1.1em;
  border-radius: 4px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
}

.map-controls button:hover { background: var(--accent); }
.map-controls button.active { background: var(--accent-bright); }

/* Ruler panel */
.ruler-panel {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 15, 30, 0.92);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  min-width: 160px;
  z-index: 20;
}
.ruler-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8em;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.ruler-header button {
  font-size: 0.85em;
  padding: 2px 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 3px;
  cursor: pointer;
}
.ruler-header button:hover { background: rgba(255,255,255,0.06); }
.ruler-info { font-size: 0.8em; color: var(--text-dim); }
.ruler-segment { padding: 2px 0; color: var(--text); }
.ruler-segment strong { color: var(--accent-bright); }
.ruler-total { padding-top: 4px; border-top: 1px solid var(--border); margin-top: 4px; color: var(--text); }
.ruler-total strong { color: #FFcc00; }

/* Scan range panel */
.scan-range-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 15, 30, 0.92);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  min-width: 160px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 20;
}
.scan-range-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8em;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.scan-range-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.1em;
  padding: 0 2px;
  line-height: 1;
}
.scan-range-close:hover { color: var(--text); }
.scan-range-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 0.8em;
  color: var(--text);
  cursor: pointer;
}
.scan-range-item input { accent-color: var(--accent-bright); margin: 0; }
.scan-range-all { font-weight: 500; padding-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,0.04); margin-bottom: 2px; }
.scan-range-no-stars { opacity: 0.45; }
.scan-range-dim { font-size: 0.7em; color: var(--text-dim); margin-left: auto; font-style: italic; }

.tick-controls {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
}

.tick-controls button {
  width: 32px;
  height: 28px;
  padding: 0;
  font-size: 1em;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
}

.tick-controls button:hover { background: var(--accent); }

#tickLabel {
  font-size: 0.85em;
  color: var(--text);
  min-width: 60px;
  text-align: center;
}

.tooltip {
  position: absolute;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 0.8em;
  pointer-events: none;
  z-index: 100;
  max-width: 250px;
}

.tooltip .star-name { font-weight: bold; margin-bottom: 4px; color: var(--text); }
.tooltip .star-info { color: var(--text-muted); }

/* Sidebar */
.sidebar {
  width: 340px;
  background: var(--bg-primary);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
  font-size: 1.1em;
  color: var(--accent-bright);
}

.game-info { color: var(--text-dim); font-size: 0.8em; margin-top: 4px; }

.credit { color: var(--text-dim); font-size: 0.7em; }

.lock-btn {
  font-size: 0.65em;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
}

.lock-btn:hover { background: var(--accent); color: #fff; }
.lock-btn.locked { color: var(--warning); border-color: var(--warning); }

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.sidebar-toggle {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 1.2em;
  line-height: 1;
  border-radius: 4px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
}

.sidebar-toggle:hover { background: var(--accent); color: #fff; }

.sidebar-header { position: relative; }

.sidebar.collapsed {
  width: 36px;
  min-width: 36px;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-header > *:not(.sidebar-toggle),
.sidebar.collapsed .sidebar-tabs,
.sidebar.collapsed .tab-content,
.sidebar.collapsed .credit,
.sidebar.collapsed .game-info,
.sidebar.collapsed .lock-btn,
.sidebar.collapsed .live-dot,
.sidebar.collapsed #viewerCount {
  display: none !important;
}

.sidebar.collapsed .sidebar-header {
  padding: 8px 4px;
  display: flex;
  justify-content: center;
}

.sidebar.collapsed .sidebar-header h2 { display: none; }

.sidebar.collapsed .sidebar-toggle {
  position: static;
  transform: rotate(180deg);
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 10px 8px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8em;
  border-radius: 0;
  cursor: pointer;
}

.tab:hover { color: var(--text); }
.tab.active { color: #fff; border-bottom-color: var(--accent-bright); }

.tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.tab-content.active { display: block; }

/* Submit section */
.submit-section textarea {
  width: 100%;
  resize: vertical;
  min-height: 80px;
  font-family: 'Courier New', monospace;
  font-size: 0.8em;
}

.fetch-helper {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.fetch-helper button { font-size: 0.8em; padding: 8px 12px; }

.hint { color: var(--text-dim); font-size: 0.8em; margin-bottom: 6px; }

.password-setup {
  margin: 10px 0;
  padding: 10px;
  background: rgba(55, 90, 127, 0.08);
  border: 1px solid rgba(55, 90, 127, 0.2);
  border-radius: 4px;
}

.password-setup input { width: 100%; margin-top: 6px; }

.drop-zone {
  border: 2px dashed rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 20px;
  text-align: center;
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 0.85em;
  transition: border-color 0.2s;
}

.drop-zone-primary {
  border-color: var(--accent);
  padding: 24px;
  background: rgba(55, 90, 127, 0.06);
}

.file-btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
}

.file-btn:hover { background: var(--accent-bright); }

.btn-loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.btn-loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

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

.error-panel {
  background: rgba(200, 30, 30, 0.15);
  border-top: 1px solid rgba(248, 113, 113, 0.3);
  padding: 8px 12px;
  font-size: 0.75em;
  color: var(--danger);
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: monospace;
}

.version-tag {
  position: fixed;
  bottom: 4px;
  right: 8px;
  font-size: 0.6em;
  color: rgba(255,255,255,0.15);
  z-index: 50;
  pointer-events: none;
}

.drop-zone.dragover {
  border-color: var(--accent-bright);
  color: var(--text-muted);
}

#submitStatus {
  margin-top: 8px;
  padding: 8px;
  border-radius: 4px;
  font-size: 0.85em;
}

#submitStatus.success { background: rgba(0,200,100,0.1); color: var(--success); }
#submitStatus.error { background: rgba(255,50,50,0.1); color: var(--danger); }

/* Roster */
.roster-panel .player-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.player-colour {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.player-alias { flex: 1; font-size: 0.9em; color: var(--text); }

.player-badge {
  font-size: 0.7em;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.badge-submitted { background: rgba(0,200,100,0.15); color: var(--success); }
.badge-no-data { background: rgba(255,200,0,0.15); color: var(--warning); }
.badge-unknown { background: rgba(255,50,50,0.15); color: var(--danger); }
.badge-defeated { background: rgba(100,100,100,0.15); color: var(--text-muted); }

.stale-warning {
  display: block;
  font-size: 0.7em;
  color: #e0a800;
  margin-top: 2px;
  text-decoration: underline;
  cursor: pointer;
}
.stale-warning:hover { color: #ffc107; }

.player-row { flex-wrap: wrap; }

.team-header {
  font-size: 0.75em;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 12px;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Journal */
.journal-panel .journal-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.journal-entry .player-colour { width: 10px; height: 10px; }
.journal-entry .entry-info { flex: 1; }
.journal-entry .entry-alias { font-size: 0.85em; color: var(--text); }
.journal-entry .entry-tick { color: var(--accent-bright); font-size: 0.8em; }
.journal-entry .entry-time { color: var(--text-dim); font-size: 0.75em; }

/* Journal selection UI */
.journal-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8em;
  color: var(--text-dim);
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
  cursor: pointer;
}
.journal-toggle input { accent-color: var(--accent-bright); }

.journal-player-group {
  margin-bottom: 12px;
}

.journal-player-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 6px;
}

.journal-player-name { font-size: 0.85em; color: var(--text); font-weight: 500; }
.journal-player-count { font-size: 0.7em; color: var(--text-dim); margin-left: auto; }

.journal-sub-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 20px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}
.journal-sub-entry:hover { background: rgba(255,255,255,0.03); }
.journal-sub-entry.selected { background: rgba(100, 180, 255, 0.08); }
.journal-sub-entry input[type=radio] { accent-color: var(--accent-bright); margin: 0; }
.journal-sub-entry input[type=radio]:disabled { opacity: 0.4; }
.journal-sub-tick { font-size: 0.8em; color: var(--accent-bright); }
.journal-sub-time { font-size: 0.7em; color: var(--text-dim); margin-left: auto; }

/* Capitals */
.capitals-panel h3 { font-size: 1em; margin-bottom: 8px; color: var(--text); }

.capital-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.85em;
}

.capital-friendly { color: var(--success); }
.capital-enemy { color: var(--danger); }

.capital-remove {
  background: rgba(255,50,50,0.2);
  color: var(--danger);
  border: none;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75em;
  cursor: pointer;
}

.capital-form {
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  padding: 12px;
  margin-top: 12px;
}

.capital-form h4 { font-size: 0.9em; margin-bottom: 8px; color: var(--text); }
.capital-form select { width: 100%; margin-bottom: 8px; }
.capital-form label { font-size: 0.85em; margin-right: 12px; color: var(--text); }

/* Notes */
.notes-panel .hint code { background: rgba(255,255,255,0.06); padding: 1px 4px; border-radius: 2px; font-size: 0.9em; }

.note-form {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 12px;
}
.note-form-header { font-size: 0.85em; color: var(--accent-bright); margin-bottom: 6px; font-weight: 500; }
.note-form textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.85em;
  resize: vertical;
  min-height: 50px;
  background: var(--bg-darker);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px;
}
.note-form-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.note-char-count { font-size: 0.7em; color: var(--text-dim); }
.note-form-footer input { font-size: 0.8em; padding: 4px 6px; }
.note-form-footer button { font-size: 0.8em; padding: 4px 10px; }

.note-item {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  padding: 8px 0;
}
.note-item:last-child { border-bottom: none; }
.note-item-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.note-star-ref {
  font-size: 0.8em;
  color: var(--accent-bright);
  cursor: pointer;
  font-weight: 500;
}
.note-star-ref:hover { text-decoration: underline; }
.note-author { font-size: 0.75em; color: var(--text-dim); }
.note-time { font-size: 0.7em; color: var(--text-dim); margin-left: auto; }
.note-actions { display: flex; gap: 4px; }
.note-btn-edit, .note-btn-delete {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85em;
  padding: 0 3px;
  line-height: 1;
}
.note-btn-edit:hover { color: var(--accent-bright); }
.note-btn-delete:hover { color: var(--danger); }

.note-item-text {
  font-size: 0.85em;
  color: var(--text);
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.note-ref-star { color: var(--accent-bright); font-weight: 500; }
.note-ref-player { font-weight: 500; }

/* @mention highlighting */
.note-mentions-you {
  border-left: 3px solid #FFcc00;
  padding-left: 8px;
  background: rgba(255, 204, 0, 0.04);
}
.note-mentions-you .note-item-header::after {
  content: 'mentions you';
  font-size: 0.65em;
  color: #FFcc00;
  background: rgba(255, 204, 0, 0.12);
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
}

/* Badge on Notes tab */
.mention-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: #FFcc00;
  color: #000;
  font-size: 0.65em;
  font-weight: bold;
  margin-left: 4px;
  padding: 0 4px;
}

.submit-prompt {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text-dim);
  font-size: 1em;
  z-index: 10;
}
.submit-prompt p { margin: 8px 0; }

.empty-state { color: var(--text-dim); font-size: 0.85em; text-align: center; padding: 20px 0; }

.password-setup-card {
  background: rgba(55, 90, 127, 0.1);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.password-setup-card h3 {
  font-size: 1.1em;
  margin-bottom: 6px;
  color: var(--accent-bright);
}

/* Player shapes for legend */
.shape-icon {
  width: 12px;
  height: 12px;
  display: inline-block;
  flex-shrink: 0;
}

/* Responsive: mobile layout */
/* ── Mobile: portrait phones (< 768px) ── */
@media (max-width: 768px) {
  /* Stack map and sidebar vertically */
  .viewer-layout {
    flex-direction: column;
    height: calc(100vh - 32px); /* account for game tabs bar */
  }

  .map-area {
    height: 40vh;
    min-height: 200px;
  }

  .sidebar {
    width: 100%;
    height: 60vh;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .sidebar.collapsed {
    display: none !important;
  }

  .viewer-layout:has(.sidebar.collapsed) .map-area {
    height: calc(100vh - 36px);
    flex: 1;
  }

  .mobile-expand-btn {
    position: absolute;
    bottom: 60px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(15,15,30,0.85);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.3em;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-expand-btn:hover { background: var(--accent); }

  /* Always show game tabs bar on mobile */
  .game-tabs-bar {
    display: flex !important;
    height: 36px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }



  /* Make all interactive elements meet 44px minimum touch target (Apple HIG) */
  button, .file-btn, .tab, .game-tab {
    min-height: 44px;
    min-width: 44px;
  }

  input[type="text"], textarea, select {
    min-height: 44px;
    font-size: 16px; /* prevents iOS zoom on focus */
  }

  /* Sidebar tabs: full width, larger touch targets */
  .sidebar-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-tabs .tab {
    font-size: 0.75em;
    padding: 12px 6px;
    flex-shrink: 0;
  }

  /* Drop zone larger on mobile */
  .drop-zone {
    padding: 16px;
  }

  .drop-zone-primary {
    padding: 20px;
  }

  /* Submit button full width */
  .btn-primary {
    min-height: 48px;
    font-size: 1em;
  }

  /* Lock button visible */
  .lock-btn {
    min-height: 32px;
    font-size: 0.7em;
  }

  /* Landing page */
  .landing {
    padding: 12px;
  }

  .card {
    padding: 16px;
  }

  .card form {
    flex-direction: column;
  }

  /* Fetch helper compact on mobile */
  .fetch-helper {
    flex-direction: column;
  }

  /* Sidebar header compact */
  .sidebar-header {
    padding: 10px 12px;
  }

  .sidebar-header h2 {
    font-size: 1em;
  }

  /* Version tag smaller on mobile */
  .version-tag {
    font-size: 0.5em;
  }
}
