:root {
  --bg: #1a0b12;
  --panel: #2a121d;
  --line: #4a2333;
  --text: #f6e9ee;
  --muted: #b9909f;
  --accent: #e0446d;
  --accent2: #ff8a5c;
  --ok: #4cd18a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(120% 80% at 50% 0%, #3a1324 0%, var(--bg) 60%);
  color: var(--text);
  font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.screen {
  max-width: 520px; margin: 0 auto; min-height: 100%;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
}
.hidden { display: none !important; }
h1 { font-size: 2.2rem; text-align: center; margin: 12vh 0 0; letter-spacing: .04em; }
.muted { color: var(--muted); margin: 0; text-align: center; }
.foot { margin-top: auto; font-size: .85rem; }
.msg { color: var(--accent2); text-align: center; min-height: 1.4em; margin: 0; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

button, input, select, textarea {
  font: inherit; color: inherit; border-radius: 14px; border: 1px solid var(--line);
  background: var(--panel); padding: 12px 14px;
}
button { cursor: pointer; transition: transform .08s, background .2s; }
button:active { transform: scale(.97); }
button:disabled { opacity: .4; }
.big {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: 0; font-weight: 700; padding: 16px; font-size: 1.1rem; color: #fff;
}
.ghost { background: transparent; }
.small { padding: 6px 12px; font-size: .9rem; }
.levels .on { background: var(--accent); border-color: var(--accent); color: #fff; }

.small-text { font-size: .85rem; }
#namn { text-align: center; font-size: 1.3rem; }
.pin { text-align: center; font-size: 1.8rem; letter-spacing: .5em; padding-left: .5em; }
.check { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--muted); }

header { display: flex; align-items: center; gap: 8px; }
header .tag { margin-right: auto; }
.tag { font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--accent2); }

.levels { display: flex; gap: 6px; }
.levels button { flex: 1; padding: 8px; font-size: .9rem; }


.stage { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.card {
  flex: 1; min-height: 200px; border-radius: 22px; padding: 22px;
  background: linear-gradient(160deg, #3b1527, #24101a);
  border: 1px solid var(--line); box-shadow: 0 10px 40px #0008;
  display: flex; flex-direction: column; justify-content: center; text-align: center; gap: 12px;
}
.card.flip { animation: flip .35s ease; }
@keyframes flip { from { transform: rotateY(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.cardtype { text-transform: uppercase; letter-spacing: .15em; font-size: .85rem; color: var(--accent2); }
.cardtext { font-size: 1.45rem; font-weight: 600; }
.card.empty .cardtext { color: var(--muted); font-weight: 400; font-size: 1.1rem; }

textarea { width: 100%; resize: vertical; }
.list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.list li { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; gap: 10px; align-items: start; }
.list li span { flex: 1; }
.list small { color: var(--muted); display: block; }
.pin::placeholder { letter-spacing: normal; font-size: 1rem; }
textarea#own, textarea#answer { min-height: 70px; }
.result { font-size: 1.1rem; color: var(--ok); }
.result.pass { color: var(--muted); }
.wait { color: var(--muted); font-size: 1.05rem; }
.surprise {
  background: transparent; border: 1px dashed var(--accent2); color: var(--accent2);
  font-weight: 700; padding: 14px;
}
h2 { font-size: 1.1rem; margin: 18px 0 0; }
.left { text-align: left; }
