/* Shared by index.html (ko) and en/index.html. */
:root {
  --bg: #f7f5f0; --card: #ffffff; --ink: #1d1d1f; --muted: #6b6b70; --line: #e4e1da;
  --accent: #3d6bd9; --accent-soft: #e3eafb; --second: #d9773d; --second-soft: #fbeadf;
  --warn: #8a6d00; --warn-soft: #fff4cc;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141416; --card: #1e1e22; --ink: #ececef; --muted: #9a9aa2; --line: #2e2e34;
    --accent: #7a9cf0; --accent-soft: #24304d; --second: #f0a06e; --second-soft: #4a2f1f;
    --warn: #f0d36e; --warn-soft: #3d3418;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 560px; margin: 0 auto; padding: 24px 16px 48px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px 20px; }
h1 { font-size: 24px; margin: 0 0 8px; }
h2 { font-size: 15px; color: var(--muted); font-weight: 600; margin: 24px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 14px; }
button {
  font: inherit; border: 0; border-radius: 12px; padding: 12px 18px; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 600;
}
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .35; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
[hidden] { display: none !important; }

/* question screen */
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.progress > div { height: 100%; background: var(--accent); transition: width .2s; }
.count { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.q { font-size: 20px; font-weight: 600; min-height: 3.2em; margin-bottom: 24px; }
/* Seven equal columns that shrink with the card; the visible circle sits inside a full-height hit area. */
.scale { display: grid; grid-template-columns: repeat(7, 1fr); align-items: center; }
.scale button {
  padding: 0; height: 48px; background: transparent; border-radius: 12px;
  display: grid; place-items: center;
}
.scale button::before {
  content: ""; display: block; border-radius: 50%; border: 2px solid var(--line);
  transition: background .12s, border-color .12s;
}
.scale button[data-v="1"]::before, .scale button[data-v="7"]::before { width: min(44px, 10vw); height: min(44px, 10vw); }
.scale button[data-v="2"]::before, .scale button[data-v="6"]::before { width: min(38px, 8.6vw); height: min(38px, 8.6vw); }
.scale button[data-v="3"]::before, .scale button[data-v="5"]::before { width: min(32px, 7.2vw); height: min(32px, 7.2vw); }
.scale button[data-v="4"]::before { width: min(26px, 6vw); height: min(26px, 6vw); }
.scale button[data-v="5"]::before, .scale button[data-v="6"]::before, .scale button[data-v="7"]::before { border-color: var(--accent); }
.scale button[data-v="1"]::before, .scale button[data-v="2"]::before, .scale button[data-v="3"]::before { border-color: var(--second); }
.scale button[aria-checked="true"][data-v="5"]::before, .scale button[aria-checked="true"][data-v="6"]::before, .scale button[aria-checked="true"][data-v="7"]::before { background: var(--accent); }
.scale button[aria-checked="true"][data-v="1"]::before, .scale button[aria-checked="true"][data-v="2"]::before, .scale button[aria-checked="true"][data-v="3"]::before { background: var(--second); }
.scale button[aria-checked="true"][data-v="4"]::before { background: var(--muted); border-color: var(--muted); }
.ends { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin: 8px 0 24px; }

/* result screen */
.type { font-size: 56px; font-weight: 800; letter-spacing: 4px; line-height: 1; margin: 4px 0 6px; }
.nick { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.axis { margin: 14px 0; }
.axis-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; }
.axis-head b.win { color: var(--ink); }
.axis-head span { color: var(--muted); }
.bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); }
.bar .a { background: var(--accent); }
.bar .b { background: var(--second); }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); margin-left: 6px; }
ul { margin: 0; padding-left: 20px; }
li { margin: 2px 0; }
input[type=text] {
  font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); flex: 1; min-width: 0;
}
.history li { list-style: none; border-bottom: 1px solid var(--line); }
.history li button {
  display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left;
  background: transparent; color: var(--ink); font-weight: 400; padding: 8px 0; border-radius: 0;
}
.history ul { padding: 0; }
.history .t { font-weight: 700; letter-spacing: 1px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 10;
  display: flex; gap: 12px; align-items: center; background: var(--ink); color: var(--bg);
  padding: 10px 10px 10px 16px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px);
}
.toast button { background: transparent; color: var(--bg); text-decoration: underline; padding: 6px 8px; }
.note { font-size: 13px; color: var(--muted); margin-top: 20px; }
.lang { display: table; margin: -8px 0 10px auto; font-size: 14px; color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px; }
.lang:hover, .lang:focus-visible { color: var(--ink); border-color: var(--accent); }
