:root {
  --bg-top: #bfd78f;
  --bg-bottom: #e7e2b6;
  --panel: rgba(33, 49, 34, 0.9);
  --panel-soft: rgba(245, 240, 215, 0.88);
  --accent: #d65a31;
  --accent-2: #f7b267;
  --ink: #182218;
  --hud: rgba(16, 24, 18, 0.74);
  --line: rgba(255, 255, 255, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", sans-serif;
  color: #f8f3df;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.16), transparent 30%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

button {
  font: inherit;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.screen {
  display: none;
  width: 100%;
  max-width: 1360px;
}

.screen.active {
  display: block;
}

.menu-panel {
  background:
    linear-gradient(135deg, rgba(13, 22, 13, 0.92), rgba(45, 62, 38, 0.9)),
    var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: 36px;
  box-shadow: 0 24px 80px rgba(9, 17, 10, 0.32);
}

.eyebrow,
h1,
h2,
.primary-button,
.ghost-button,
.status-panel,
.overlay-panel h2 {
  font-family: "Russo One", sans-serif;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.95;
}

.lead {
  max-width: 720px;
  color: rgba(255, 248, 227, 0.82);
  font-size: 18px;
  line-height: 1.55;
  margin: 18px 0 28px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card {
  background: rgba(255, 246, 226, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 24px;
  padding: 22px;
  backdrop-filter: blur(10px);
}

.card h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

.option-list {
  display: grid;
  gap: 10px;
}

.option,
.primary-button,
.ghost-button {
  border-radius: 16px;
  border: 1px solid transparent;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.option {
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.22);
  color: #fff8e8;
  text-align: left;
}

.option:hover,
.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.option.active {
  background: linear-gradient(135deg, rgba(214, 90, 49, 0.35), rgba(247, 178, 103, 0.18));
  border-color: rgba(247, 178, 103, 0.7);
}

.menu-actions {
  margin-top: 28px;
  display: flex;
  justify-content: flex-end;
}

.primary-button,
.ghost-button {
  padding: 14px 20px;
  font-size: 16px;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), #b82d24);
  color: #fff8ef;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.06);
  color: #fff8ef;
  border-color: rgba(255, 255, 255, 0.16);
}

#gameScreen {
  position: relative;
}

.hud {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  pointer-events: none;
}

.bars {
  display: flex;
  gap: 16px;
}

.bar-block,
.status-panel {
  min-width: 240px;
  background: var(--hud);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  backdrop-filter: blur(10px);
}

.bar-block span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bar-frame {
  width: 100%;
  height: 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}

.bar-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  transition: width 180ms ease;
}

.bar-fill.player {
  background: linear-gradient(90deg, #4caf50, #b9e769);
}

.bar-fill.enemy {
  background: linear-gradient(90deg, #ef4444, #f59e0b);
}

.status-panel {
  max-width: 420px;
  align-self: flex-start;
  font-size: 14px;
  line-height: 1.5;
}

#weaponText {
  color: var(--accent-2);
  margin-top: 6px;
}

#gameCanvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 28px;
  background: linear-gradient(180deg, #a9d9f7 0%, #e4f6ff 32%, #a0bf68 32%, #7eab5b 100%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  user-select: none;
}

.speech-bubble {
  position: absolute;
  min-width: 220px;
  max-width: 340px;
  background: rgba(255, 251, 235, 0.95);
  color: var(--ink);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: 0 18px 40px rgba(25, 31, 23, 0.22);
  z-index: 3;
  font-weight: 600;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 24px;
  width: 20px;
  height: 20px;
  background: inherit;
  transform: rotate(45deg);
}

.hidden,
.overlay.hidden,
.modal.hidden,
.speech-bubble.hidden {
  display: none;
}

.overlay,
.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(9, 12, 10, 0.56);
  backdrop-filter: blur(8px);
}

.overlay-panel,
.modal-card {
  width: min(560px, calc(100vw - 32px));
  background: linear-gradient(180deg, rgba(17, 28, 19, 0.96), rgba(38, 48, 35, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.overlay-panel h2,
.modal-card h2 {
  margin: 0 0 10px;
  font-size: 28px;
}

.overlay-panel p,
.modal-card p {
  margin: 0;
  color: rgba(255, 249, 232, 0.82);
  line-height: 1.5;
}

.modal-actions {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

@media (max-width: 980px) {
  .choice-grid {
    grid-template-columns: 1fr;
  }

  .hud {
    position: static;
    margin-bottom: 14px;
    flex-direction: column;
  }

  .bars {
    flex-direction: column;
  }

  .bar-block,
  .status-panel {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 14px;
  }

  .menu-panel,
  .overlay-panel,
  .modal-card {
    padding: 22px;
  }

  .modal-actions {
    flex-direction: column;
  }

  .menu-actions {
    justify-content: stretch;
  }

  .menu-actions .primary-button {
    width: 100%;
  }
}
