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

body {
  overflow: hidden;
  background: #1a1a2e;
  font-family: 'Consolas', 'SF Mono', 'Fira Code', monospace;
  color: #e0e0e0;
  user-select: none;
  -webkit-user-select: none;
}

#mainCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ===== UI Overlay ===== */

#ui-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* ===== Top Bar ===== */

#top-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 12px;
  pointer-events: auto;
}

#sens-display {
  font-size: 14px;
  min-width: 80px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}

.separator {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 4px;
}

/* ===== Reality Bar ===== */

body.reality-active #top-bar {
  padding: 6px 12px;
  gap: 8px;
}

body.reality-active #top-bar .ctrl-btn {
  padding: 4px 10px;
  font-size: 13px;
}

body.reality-active #sens-display {
  font-size: 12px;
  min-width: 60px;
}

/* ===== Buttons ===== */

.ctrl-btn {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ctrl-btn:active {
  background: rgba(247, 37, 133, 0.3);
}

/* ===== Arrow Buttons ===== */

.arrow-btn {
  pointer-events: auto;
  position: absolute;
  bottom: 24px;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-size: 32px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease, border-color 0.1s ease, box-shadow 0.1s ease;
  touch-action: none;
  -webkit-touch-callout: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.arrow-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.arrow-btn.pressed {
  transform: scale(0.9);
  background: rgba(247, 37, 133, 0.35);
  border-color: rgba(247, 37, 133, 0.6);
  box-shadow: 0 0 20px rgba(247, 37, 133, 0.3);
}

#btn-left {
  left: 24px;
}

#btn-right {
  right: 24px;
}

/* ===== Setup & Intro Overlay ===== */

.setup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(26, 26, 46, 0.95);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

.setup-overlay.visible {
  display: flex;
}

/* --- Intro Screen --- */

.intro-content {
  text-align: center;
  max-width: 600px;
  padding: 40px;
}

.intro-content h1 {
  font-size: 28px;
  margin-bottom: 12px;
  color: #e0e0e0;
}

.intro-subtitle {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 28px;
}

.intro-desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin-bottom: 20px;
}

.intro-howto {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.5;
  margin-bottom: 10px;
}

/* --- Setup Screen --- */

.setup-content {
  display: flex;
  gap: 40px;
  max-width: 900px;
  width: 90%;
}

.setup-col {
  flex: 1;
  min-width: 200px;
}

.setup-col h2 {
  font-size: 24px;
  margin-bottom: 8px;
  color: #e0e0e0;
}

.setup-col h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.setup-harmful h3 { color: #ff6b6b; }
.setup-helpful h3 { color: #06d6a0; }

.setup-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.setup-level-subtitle {
  font-size: 12px !important;
  color: rgba(255, 255, 255, 0.4) !important;
  margin-bottom: 8px !important;
}

.setup-center p {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  margin-bottom: 20px;
}

.setup-target {
  font-size: 16px;
  margin: 4px 0;
  font-weight: bold;
}

.setup-target.profit { color: #28c878; }
.setup-target.loss { color: #ff3c3c; }

.setup-start-btn {
  margin-top: 30px;
  padding: 14px 48px;
  font-size: 18px;
  font-family: inherit;
  font-weight: bold;
  background: rgba(40, 200, 120, 0.2);
  color: #28c878;
  border: 2px solid rgba(40, 200, 120, 0.5);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.setup-start-btn:hover {
  background: rgba(40, 200, 120, 0.35);
  transform: scale(1.05);
}

.setup-mod-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  margin: 3px 0;
  border-radius: 4px;
  font-size: 13px;
  background: rgba(255,255,255,0.04);
  position: relative;
}

.setup-mod-row.inactive {
  opacity: 0.3;
}

.setup-mod-row .mod-name { flex: 1; }

.setup-mod-row .mod-val {
  font-weight: bold;
  min-width: 40px;
  text-align: right;
}

.setup-harmful .setup-mod-row .mod-val { color: #ff6b6b; }
.setup-helpful .setup-mod-row .mod-val { color: #06d6a0; }

.setup-mod-row.interactive {
  background: rgba(6, 214, 160, 0.08);
  cursor: pointer;
}

.setup-slots {
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setup-slots label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
}

.setup-slots input[type="checkbox"] {
  accent-color: #06d6a0;
}

/* ===== Tooltips ===== */

.mod-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  margin-left: 6px;
  cursor: help;
  flex-shrink: 0;
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.92);
  color: #e0e0e0;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
  width: 260px;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 200;
  font-weight: normal;
}

[data-tooltip]:hover::after {
  opacity: 1;
}
