:root {
  color-scheme: light;
  --ink: #162126;
  --muted: #64747b;
  --panel: #ffffff;
  --bg: #eef3f2;
  --line: #d8e2df;
  --accent: #1b6f68;
  --accent-2: #d84f2a;
  --focus: #f0bf42;
  --ok: #23845b;
}

* {
  box-sizing: border-box;
}

html,
body,
.app-shell {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

input {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

.app-shell {
  display: grid;
  grid-template-rows: minmax(300px, 54vh) 1fr;
}

.map-wrap {
  position: relative;
  min-height: 0;
}

#map {
  width: 100%;
  height: 100%;
  background: #cfdcda;
}

.status-strip {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  z-index: 500;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 20px rgba(10, 20, 20, 0.16);
}

.control-surface {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.join-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.toolbar button {
  background: #dbe7e5;
  color: var(--ink);
}

.toolbar button.active {
  background: var(--accent);
  color: #fff;
}

.meters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.meter {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #f8fbfa;
}

.meter span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.meter strong {
  font-size: 22px;
}

.monster-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.monster-panel h2,
.monster-panel p {
  margin: 0 0 10px;
}

.safety {
  margin-bottom: 12px;
  border-left: 4px solid var(--focus);
  padding: 8px 10px;
  background: #fff7da;
  color: #44370b;
}

.hints {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.raid-status {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #f2f7f6;
}

.raid-status span {
  color: var(--muted);
  font-size: 13px;
}

.hint {
  border-radius: 8px;
  background: #eaf2f0;
  padding: 8px 10px;
  color: #23413f;
}

.choices {
  display: grid;
  gap: 8px;
}

.choice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.choice input {
  width: 22px;
  height: 22px;
  min-height: 0;
}

.catch-button {
  margin-top: 6px;
  background: var(--accent-2);
}

.radar {
  display: grid;
  place-items: center;
  padding: 8px 0 16px;
}

.radar-ring {
  position: relative;
  width: min(52vw, 220px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background:
    radial-gradient(circle at center, rgba(27, 111, 104, 0.18) 0 7%, transparent 7%),
    repeating-radial-gradient(circle, transparent 0 28px, rgba(27, 111, 104, 0.18) 29px 30px);
}

.radar-arrow {
  position: absolute;
  left: 50%;
  top: 11%;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 34px solid var(--accent-2);
  transform-origin: 50% 90px;
}

.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 900;
  border-radius: 8px;
  padding: 12px 14px;
  background: #17202a;
  color: #fff;
}

@media (max-width: 680px) {
  body {
    overflow: auto;
  }

  .app-shell {
    min-height: 100%;
    height: auto;
    grid-template-rows: 44vh auto;
  }

  .join-form,
  .toolbar,
  .meters {
    grid-template-columns: 1fr;
  }
}
