:root {
  --ftm-accent: #ff7a18;
  --ftm-accent-2: #ffb347;
  --ftm-bg: #101218;
  --ftm-panel: #171a22;
  --ftm-text: #f3f6fb;
  --ftm-muted: #b8c0d4;
}

.ftm-launch {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9998;
  border: 0;
  background: linear-gradient(180deg, var(--ftm-accent), var(--ftm-accent-2));
  color: #111;
  font-weight: 700;
  padding: 14px 10px;
  border-radius: 0 12px 12px 0;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0,0,0,.22);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.ftm-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.ftm-modal.is-open {
  display: block;
}

.ftm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
}

.ftm-modal__panel {
  position: relative;
  z-index: 2;
  width: min(920px, calc(100vw - 32px));
  margin: 4vh auto;
  background: var(--ftm-panel);
  color: var(--ftm-text);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
}

.ftm-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: 0;
  color: var(--ftm-text);
  font-size: 32px;
  cursor: pointer;
}

.ftm-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.ftm-subtitle, .ftm-help p, .ftm-status {
  color: var(--ftm-muted);
}

.ftm-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ftm-stat {
  background: #0f1219;
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 82px;
}

.ftm-stat span {
  display: block;
  font-size: 12px;
  color: var(--ftm-muted);
}

.ftm-stat strong {
  font-size: 22px;
}

.ftm-game-wrap {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}

#ftm-canvas {
  background: #0a0d13;
  border: 2px solid #283041;
  border-radius: 12px;
  max-width: 100%;
  height: auto;
}

.ftm-sidepanel {
  flex: 1 1 220px;
}

.ftm-buttons, .ftm-mobile-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.ftm-buttons button, .ftm-mobile-controls button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(180deg, var(--ftm-accent), var(--ftm-accent-2));
  color: #111;
}

body.ftm-modal-open {
  overflow: hidden;
}

@media (max-width: 782px) {
  .ftm-modal__panel {
    margin: 2vh auto;
    padding: 16px;
  }

  .ftm-header {
    flex-direction: column;
  }
}
