:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #0a0c10;
  color: #edf2f7;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 22% 18%, rgba(32, 145, 122, 0.18), transparent 28%),
    linear-gradient(135deg, #080a0e 0%, #111822 48%, #17120f 100%);
}

.shell {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.hud {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.brand,
.meters > div,
.help,
.message,
.start-card,
.start-button,
.rules-button,
.dashboard-button,
.language-button,
.settings-button,
.dashboard-panel,
.rules-card,
.reward-card,
.reward-choice {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 10, 14, 0.76);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
}

.brand {
  min-width: 230px;
  padding: 12px 14px;
  border-radius: 8px;
}

.brand strong {
  display: block;
  font-size: 16px;
  letter-spacing: 0;
}

.brand span,
.meters span {
  display: block;
  margin-top: 2px;
  color: #9aa8b6;
  font-size: 11px;
  font-weight: 700;
}

.meters {
  display: grid;
  grid-template-columns: repeat(7, minmax(70px, 1fr));
  gap: 8px;
  max-width: min(820px, calc(100vw - 430px));
}

.meters > div {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
}

.meters strong {
  display: block;
  margin-top: 2px;
  color: #ffffff;
  font-size: 18px;
  line-height: 1.1;
  white-space: nowrap;
}

.rules-button {
  position: absolute;
  top: 16px;
  left: 258px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #ffffff;
  font: inherit;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

.start-panel {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 7, 10, 0.58);
}

.start-panel.hidden {
  display: none;
}

.start-card {
  width: min(480px, calc(100vw - 32px));
  padding: 30px;
  border-radius: 8px;
  text-align: center;
}

.start-kicker {
  display: block;
  color: #72f0b8;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.start-card h1 {
  margin: 10px 0 4px;
  color: #ffffff;
  font-size: 42px;
  line-height: 1;
}

.start-card p {
  margin: 0;
  color: #dbe5ee;
  font-size: 22px;
  font-weight: 800;
}

.start-author {
  margin-top: 18px;
  color: #9aa8b6;
  font-size: 13px;
  font-weight: 700;
}

.start-author strong {
  color: #ffffff;
}

.difficulty-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
}

.difficulty-option {
  min-width: 0;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #dbe5ee;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.difficulty-option.active {
  border-color: rgba(109, 240, 185, 0.72);
  background: rgba(109, 240, 185, 0.14);
  color: #ffffff;
}

.start-button {
  margin-top: 14px;
  min-width: 150px;
  height: 46px;
  border-radius: 8px;
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.dashboard-button {
  position: absolute;
  top: 16px;
  left: 316px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 48px;
  border-radius: 8px;
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.language-button {
  position: absolute;
  top: 16px;
  left: 398px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 48px;
  border-radius: 8px;
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.settings-button {
  position: absolute;
  top: 16px;
  left: 472px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #ffffff;
  font: inherit;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

.settings-button.active {
  border-color: rgba(109, 240, 185, 0.72);
  background: rgba(109, 240, 185, 0.14);
  color: #72f0b8;
}

.rules-button:hover,
.rules-button:focus-visible,
.start-button:hover,
.start-button:focus-visible,
.difficulty-option:hover,
.difficulty-option:focus-visible,
.dashboard-button:hover,
.dashboard-button:focus-visible,
.language-button:hover,
.language-button:focus-visible,
.settings-button:hover,
.settings-button:focus-visible,
.close-button:hover,
.close-button:focus-visible {
  border-color: rgba(109, 240, 185, 0.62);
  outline: none;
}

.dashboard-panel {
  position: absolute;
  top: 82px;
  right: 16px;
  z-index: 29;
  width: min(330px, calc(100vw - 32px));
  max-height: calc(100vh - 154px);
  overflow: auto;
  padding: 12px;
  border-radius: 8px;
  color: #dbe5ee;
  font-size: 12px;
}

.dashboard-panel.hidden {
  display: none;
}

.dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.dashboard-head strong {
  color: #ffffff;
  font-size: 15px;
}

.dashboard-head span {
  color: #72f0b8;
  font-size: 11px;
  font-weight: 800;
}

.dashboard-section {
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.dashboard-section h2 {
  margin: 0 0 7px;
  color: #9aa8b6;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
}

.dashboard-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 20px;
  line-height: 1.35;
}

.dashboard-row span:first-child {
  color: #aeb9c4;
}

.dashboard-row span:last-child {
  max-width: 62%;
  color: #ffffff;
  font-weight: 750;
  text-align: right;
  overflow-wrap: anywhere;
}

.dashboard-chart-row {
  margin-top: 7px;
}

.dashboard-chart-row > span {
  display: block;
  margin-bottom: 6px;
  color: #aeb9c4;
}

.echo-chart {
  display: grid;
  gap: 6px;
}

.echo-chart-row {
  display: grid;
  grid-template-columns: 48px 1fr 42px;
  align-items: center;
  gap: 8px;
}

.echo-chart-row span,
.echo-chart-row b {
  color: #dbe5ee;
  font-size: 11px;
  font-weight: 750;
}

.echo-chart-row b {
  text-align: right;
}

.echo-chart-row div {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.echo-chart-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #72f0b8;
}

.help {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #c8d2dc;
  font-size: 13px;
  pointer-events: none;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  margin-right: 4px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom-color: rgba(255, 255, 255, 0.35);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.message {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(420px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  padding: 24px;
  border-radius: 8px;
  text-align: center;
}

.message.hidden {
  display: none;
}

.message h1 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.1;
}

.message p {
  margin: 0;
  color: #c8d2dc;
  line-height: 1.45;
}

.rules-panel,
.reward-panel {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 7, 10, 0.42);
}

.rules-panel.hidden {
  display: none;
}

.reward-panel.hidden {
  display: none;
}

.rules-card,
.reward-card {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  padding: 26px;
  border-radius: 8px;
}

.rules-card h1,
.reward-card h1 {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.1;
}

.rules-card p {
  margin: 0 0 12px;
  color: #d5dee7;
  font-size: 15px;
  line-height: 1.48;
}

.rules-card p:last-child {
  margin-bottom: 0;
}

.reward-card {
  width: min(820px, calc(100vw - 32px));
}

.reward-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: #72f0b8;
  font-size: 12px;
  font-weight: 800;
}

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

.reward-choice {
  min-height: 154px;
  padding: 16px;
  border-radius: 8px;
  color: #edf2f7;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.reward-choice:hover,
.reward-choice:focus-visible {
  border-color: rgba(109, 240, 185, 0.72);
  outline: none;
}

.reward-choice strong {
  display: block;
  margin-bottom: 8px;
  font-size: 17px;
}

.reward-choice span {
  display: block;
  color: #c8d2dc;
  font-size: 14px;
  line-height: 1.4;
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 760px) {
  .hud {
    align-items: start;
  }

  .brand {
    display: none;
  }

  .rules-button {
    top: auto;
    left: auto;
    right: 16px;
    bottom: 82px;
    width: 42px;
    height: 42px;
    font-size: 18px;
  }

  .dashboard-button {
    top: auto;
    left: auto;
    right: 66px;
    bottom: 82px;
    width: 64px;
    height: 42px;
  }

  .language-button {
    top: auto;
    left: auto;
    right: 138px;
    bottom: 82px;
    width: 54px;
    height: 42px;
  }

  .settings-button {
    top: auto;
    left: auto;
    right: 200px;
    bottom: 82px;
    width: 42px;
    height: 42px;
    font-size: 18px;
  }

  .dashboard-panel {
    top: 116px;
    right: 16px;
    max-height: calc(100vh - 214px);
  }

  .meters {
    grid-template-columns: repeat(3, minmax(70px, 1fr));
    max-width: 100%;
  }

  .reward-choices {
    grid-template-columns: 1fr;
  }

  .help {
    right: 16px;
    flex-wrap: wrap;
    gap: 8px 12px;
  }
}
