:root {
  color-scheme: light;
  --page-bg: #f4f5f7;
  --text: #1f2937;
  --muted: #687385;
  --panel: #ffffff;
  --line: #d9dee7;
  --accent: #2f7c77;
  --game-bg: #9a9a9a;
  --glyph-color: #000000;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--page-bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.menu {
  width: min(760px, calc(100% - 32px));
  min-height: 100vh;
  display: grid;
  align-items: center;
  margin: 0 auto;
  padding: 32px 0;
}

.panel {
  position: relative;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.back-link {
  position: absolute;
  top: 18px;
  right: 22px;
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--accent);
  outline: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 64px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: 0;
}

.lead {
  max-width: 560px;
  margin: 14px 0 24px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.color-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--text);
  font-weight: 700;
}

.color-control input {
  width: 72px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.locations {
  margin-bottom: 24px;
}

.location-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.location-card {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.location-card strong,
.location-card small {
  display: block;
}

.location-card strong {
  margin-bottom: 6px;
}

.location-card small {
  color: var(--muted);
  line-height: 1.35;
}

.location-card.is-active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.primary-button {
  min-width: 160px;
  min-height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: #246a66;
  outline: none;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.game {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--game-bg);
}

.glyph {
  max-width: 96vw;
  color: var(--glyph-color);
  font-family: Arial, Helvetica, sans-serif;
  font-size: min(58vw, 72vh);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: 0;
  text-align: center;
  user-select: none;
}

.glyph.is-speaking {
  transform: scale(1.02);
}

.glyph.is-wide {
  font-size: min(28vw, 44vh);
  line-height: 0.95;
}

.exit-zone {
  position: fixed;
  top: 0;
  right: 0;
  width: 92px;
  height: 92px;
  cursor: default;
}

body.playing {
  overflow: hidden;
}

@media (max-width: 640px) {
  .panel {
    padding: 22px;
  }

  .settings,
  .location-list {
    grid-template-columns: 1fr;
  }
}
