:root {
  --amer-bg: #f7efe2;
  --amer-ink: #14110f;
  --amer-surface: rgba(255, 250, 242, 0.9);
  --amer-line: rgba(20, 17, 15, 0.09);
  --amer-orange: #f97316;
  --amer-orange-deep: #c2410c;
  --amer-blue: #1d4ed8;
  --amer-blue-soft: rgba(29, 78, 216, 0.12);
  --amer-green: #16a34a;
  --amer-red: #dc2626;
  --amer-shadow: 0 18px 60px rgba(20, 17, 15, 0.12);
}

body.amer-life-page {
  background:
    radial-gradient(circle at top left, rgba(249, 115, 22, 0.18), transparent 28rem),
    radial-gradient(circle at top right, rgba(29, 78, 216, 0.14), transparent 34rem),
    linear-gradient(180deg, #fff9ef 0%, var(--amer-bg) 34%, #efe1cf 100%);
  color: var(--amer-ink);
}

.amer-shell {
  width: min(calc(100% - 1.5rem), 1360px);
  margin: 0 auto;
  padding: 0 0 4rem;
}

.amer-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.72fr);
  gap: 1.6rem;
  padding: 3.75rem 0 2.5rem;
  align-items: stretch;
}

.amer-hero h1 {
  margin: 0 0 1rem;
  font-family: "Bebas Neue", Inter, sans-serif;
  font-size: clamp(4.6rem, 12vw, 8.5rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  max-width: none;
}

.amer-hero .lede {
  max-width: 42rem;
  font-size: clamp(1.02rem, 1vw + 0.85rem, 1.26rem);
  line-height: 1.7;
}

.amer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.amer-tags span,
.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(20, 17, 15, 0.08);
  box-shadow: 0 8px 24px rgba(20, 17, 15, 0.05);
  color: rgba(20, 17, 15, 0.78);
  font-size: 0.92rem;
  font-weight: 600;
}

.stage-pill {
  background: rgba(20, 17, 15, 0.88);
  color: #fff8ef;
}

.stage-pill--ghost {
  background: rgba(255, 255, 255, 0.78);
  color: rgba(20, 17, 15, 0.74);
}

.amer-hero__sidebar {
  display: grid;
  gap: 1rem;
}

.amer-sidecard,
.amer-panel,
.amer-note,
.amer-stage {
  position: relative;
  border: 1px solid var(--amer-line);
  border-radius: 28px;
  background: var(--amer-surface);
  box-shadow: var(--amer-shadow);
  backdrop-filter: blur(12px);
}

.amer-sidecard {
  overflow: hidden;
  padding: 1.15rem 1.15rem 1.25rem;
}

.amer-sidecard::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(140deg, rgba(249, 115, 22, 0.08), transparent 52%),
    linear-gradient(320deg, rgba(29, 78, 216, 0.08), transparent 52%);
  pointer-events: none;
}

.amer-sidecard__kicker,
.amer-panel__kicker,
.amer-note__eyebrow {
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(20, 17, 15, 0.5);
}

.amer-sidecard p,
.amer-note p,
.amer-panel p {
  margin: 0.65rem 0 0;
  line-height: 1.7;
  color: rgba(20, 17, 15, 0.76);
}

.amer-game {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(300px, 0.72fr);
  gap: 1rem;
  align-items: start;
}

.amer-stage {
  overflow: hidden;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(20, 17, 15, 0.1), rgba(20, 17, 15, 0.02)),
    linear-gradient(145deg, rgba(249, 115, 22, 0.1), rgba(29, 78, 216, 0.04)),
    var(--amer-surface);
}

.amer-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(transparent 0, rgba(255, 255, 255, 0.05) 50%, transparent 100%);
  background-size: 100% 5px;
  opacity: 0.3;
  pointer-events: none;
}

.amer-stage__top,
.amer-stage__bottom {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.amer-stage__bottom {
  margin-top: 0.95rem;
  flex-wrap: wrap;
}

.amer-stage__bottom p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.6;
  color: rgba(20, 17, 15, 0.8);
}

.amer-stage__legend {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: rgba(20, 17, 15, 0.65);
}

.legend-dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.35rem;
  border-radius: 999px;
  vertical-align: middle;
}

.legend-dot--job {
  background: #38bdf8;
}

.legend-dot--gas {
  background: #f59e0b;
}

.legend-dot--cop {
  background: #ef4444;
}

.amer-canvas-wrap {
  position: relative;
  z-index: 1;
  margin-top: 0.9rem;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 0 0 1px rgba(20, 17, 15, 0.14);
}

#gameCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  background: linear-gradient(180deg, #16161d 0%, #222533 100%);
  touch-action: none;
}

.amer-sidebar {
  display: grid;
  gap: 1rem;
}

.amer-panel {
  padding: 1rem 1rem 1.1rem;
}

.amer-panel h2 {
  margin: 0.45rem 0 0;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.95rem;
}

.stat-card {
  padding: 0.85rem 0.9rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(20, 17, 15, 0.06);
}

.stat-card__label {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(20, 17, 15, 0.45);
}

.stat-card strong {
  display: block;
  margin-top: 0.45rem;
  font-size: 1.02rem;
  line-height: 1.3;
}

.meter-stack {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.meter__row,
.mission-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.meter__row {
  font-size: 0.88rem;
  color: rgba(20, 17, 15, 0.64);
}

.meter__track {
  display: block;
  width: 100%;
  height: 0.8rem;
  margin-top: 0.45rem;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(20, 17, 15, 0.08);
}

.meter__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 140ms ease;
}

.meter__fill--health {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.meter__fill--fuel {
  background: linear-gradient(90deg, #f59e0b, #facc15);
}

.meter__fill--bust {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.mission-meta {
  margin-top: 1rem;
  color: rgba(20, 17, 15, 0.72);
  font-weight: 700;
}

.feed-list,
.control-list {
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.feed-list {
  display: grid;
  gap: 0.7rem;
}

.feed-list li {
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(20, 17, 15, 0.06);
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(20, 17, 15, 0.76);
}

.control-list {
  display: grid;
  gap: 0.68rem;
}

.control-list li {
  color: rgba(20, 17, 15, 0.76);
  line-height: 1.55;
}

.amer-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.amer-note {
  padding: 1.25rem;
}

.amer-note h2 {
  margin: 0.6rem 0 0;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
}

.touch-controls {
  display: none;
  justify-content: space-between;
  gap: 0.9rem;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 24px;
  border: 1px solid var(--amer-line);
  background: rgba(255, 250, 242, 0.82);
  box-shadow: var(--amer-shadow);
}

.touch-pad {
  position: relative;
  width: 10.5rem;
  height: 10.5rem;
  flex: 0 0 auto;
}

.touch-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  flex: 1;
}

.touch-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 3.2rem;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 20px;
  background: #fff7ec;
  box-shadow: 0 8px 20px rgba(20, 17, 15, 0.1);
  color: var(--amer-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.touch-btn--accent {
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  color: #fffdf9;
}

.touch-btn[data-active="true"] {
  transform: translateY(1px) scale(0.98);
  box-shadow: inset 0 0 0 999px rgba(20, 17, 15, 0.08);
}

.touch-btn--up,
.touch-btn--left,
.touch-btn--right,
.touch-btn--down {
  position: absolute;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 18px;
}

.touch-btn--up {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.touch-btn--left {
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.touch-btn--right {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.touch-btn--down {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

@media (max-width: 1180px) {
  .amer-game {
    grid-template-columns: 1fr;
  }

  .amer-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .amer-hero,
  .amer-notes,
  .amer-sidebar {
    grid-template-columns: 1fr;
  }

  .amer-shell {
    width: min(calc(100% - 1rem), 1360px);
  }

  .amer-hero {
    padding-top: 2.5rem;
  }
}

@media (max-width: 760px) {
  .amer-stage,
  .amer-panel,
  .amer-note,
  .amer-sidecard {
    border-radius: 22px;
  }

  .amer-stage__top,
  .amer-stage__bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .touch-controls {
    display: flex;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .amer-tags,
  .mission-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .touch-actions {
    grid-template-columns: 1fr 1fr;
  }
}
