html,
body {
  margin: 0;
  height: 100%;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

:root {
  --brand-red: #c24a2a;
  --brand-red-dark: #9a3820;
  --brand-cream: #f5ebe0;
  --brand-ink: #2d3142;
  --brand-teal: #2a9d8f;
  --touch-min: 44px;
}

.app-shell {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100%;
  height: 100%;
  background: var(--brand-cream);
  color: var(--brand-ink);
}

.screen {
  min-height: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.screen[hidden] {
  display: none !important;
}

.screen-scroll {
  overflow: auto;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}

.screen-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(env(safe-area-inset-top, 8px) + 8px) 12px 12px;
  background: var(--brand-red);
  color: #fff;
}

.screen-bar h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.btn-icon {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

/* Main menu */
.screen-menu {
  background: linear-gradient(180deg, var(--brand-red) 0%, var(--brand-red-dark) 42%, #1f2230 42%, #252836 100%);
}

.menu-hero {
  position: relative;
  flex: 1 1 auto;
  min-height: 45vh;
  display: flex;
  align-items: flex-end;
  padding: 24px 20px 32px;
}

.menu-skyline {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 200, 120, 0.35) 0%, transparent 40%),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 28px,
      rgba(255, 255, 255, 0.04) 28px,
      rgba(255, 255, 255, 0.04) 30px
    );
  opacity: 0.9;
}

.menu-skyline::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 120px;
  height: 65%;
  background: linear-gradient(180deg, #3a4055 0%, #252836 100%);
  clip-path: polygon(15% 100%, 85% 100%, 70% 0, 30% 0);
}

.menu-brand {
  position: relative;
  z-index: 1;
  color: #fff;
}

.menu-tag {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.18em;
  opacity: 0.85;
}

.menu-title {
  margin: 0;
  font-size: clamp(2rem, 9vw, 2.6rem);
  letter-spacing: 0.08em;
  line-height: 1;
}

.menu-actions {
  padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0));
  display: grid;
  gap: 10px;
  background: #252836;
}

.btn-menu {
  min-height: var(--touch-min);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #343848;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
}

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

.btn-menu-quiet {
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
}

/* Levels */
.level-list {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.level-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid #d8cfc4;
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.level-card.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.level-thumb {
  height: 72px;
  border-radius: 8px;
  background: linear-gradient(180deg, #6a7fd1 0%, #3d4a7a 100%);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
}

.level-meta h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.level-meta p {
  margin: 0;
  font-size: 12px;
  color: #5c6478;
}

.level-spec {
  margin-top: 4px !important;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px !important;
}

.level-stars {
  color: var(--brand-teal);
  letter-spacing: 2px;
}

/* Settings */
.settings-list {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: var(--touch-min);
  padding: 0 14px;
  border: 1px solid #d8cfc4;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
}

.setting-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--brand-red);
}

/* How to play */
.howto-steps {
  padding: 16px;
  display: grid;
  gap: 16px;
}

.howto-step {
  background: #fff;
  border: 1px solid #d8cfc4;
  border-radius: 10px;
  padding: 12px;
}

.howto-step p {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.45;
}

.howto-diagram {
  height: 72px;
  border-radius: 8px;
  background: #eef2f8;
  border: 1px dashed #b8c0d4;
}

.howto-diagram-people {
  background:
    radial-gradient(circle at 20% 70%, #e76f51 4px, transparent 5px),
    radial-gradient(circle at 35% 70%, #2a9d8f 4px, transparent 5px),
    radial-gradient(circle at 50% 70%, #e76f51 4px, transparent 5px),
    #eef2f8;
}

.howto-diagram-lifts {
  background: linear-gradient(90deg, transparent 45%, #3d4450 45%, #3d4450 55%, transparent 55%), #eef2f8;
}

.howto-diagram-config {
  background:
    linear-gradient(#dbeafe 0 0) 20px 20px / 12px 12px no-repeat,
    linear-gradient(#fff 0 0) 36px 20px / 12px 12px no-repeat,
    #eef2f8;
}
