/* Polyguide — mobil-först, hög kontrast (används utomhus). */
:root {
    --bg: #0f1720;
    --panel: #18222e;
    --panel-2: #1f2c3a;
    --accent: #2dd4bf;
    --accent-2: #38bdf8;
    --warn: #fbbf24;
    --text: #e8eef3;
    --muted: #93a4b3;
    --line: #2b3a4a;
    --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(1200px 600px at 50% -10%, #16313a, var(--bg)) fixed;
    color: var(--text);
    min-height: 100vh;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

.wrap { max-width: 640px; margin: 0 auto; padding: 24px 18px 48px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.4rem; letter-spacing: -0.02em; }
.brand .dot { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 16px var(--accent); }

h1 { font-size: 1.8rem; line-height: 1.15; margin: 18px 0 6px; letter-spacing: -0.02em; }
h2 { font-size: 1.05rem; margin: 0 0 12px; color: var(--muted); font-weight: 600; }
p.lead { color: var(--muted); margin: 4px 0 24px; line-height: 1.5; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 16px 0; }

.btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; border: none; border-radius: var(--radius); cursor: pointer;
    font-size: 1.15rem; font-weight: 700; padding: 18px; color: #062019;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: scale(.98); }
.btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.btn.warn { background: linear-gradient(135deg, #f59e0b, var(--warn)); color: #2a1a00; }
.btn.big { font-size: 1.4rem; padding: 26px; }
.btn:disabled { filter: grayscale(.6) brightness(.7); cursor: default; }
/* Push-to-talk: hindra scroll/markering vid håll, tydlig inspelningsfärg. */
#pttBtn { touch-action: none; user-select: none; -webkit-user-select: none; }
#pttBtn.recording { background: linear-gradient(135deg, #ef4444, #f87171); color: #2a0000; animation: blink 1s infinite; }

input[type=text] {
    width: 100%; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line);
    background: var(--panel-2); color: var(--text); font-size: 1.1rem; margin-bottom: 12px;
}

.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }

/* Språkrutnät */
.langgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.lang {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px;
    border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel-2);
    cursor: pointer; font-weight: 600; transition: border-color .15s, transform .08s;
}
.lang:active { transform: scale(.97); }
.lang .flag { font-size: 1.8rem; }
.lang.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }

/* Transkript */
.transcript { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; }
.line { background: var(--panel-2); border-radius: 12px; padding: 12px 14px; line-height: 1.45; }
.line.fresh { animation: pop .4s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
.line .orig { color: var(--muted); font-size: .85rem; margin-top: 6px; }

/* QR */
.qr { background: #fff; padding: 14px; border-radius: var(--radius); display: inline-block; }
.qr img { display: block; width: 200px; height: 200px; }
.code { font-size: 2.2rem; font-weight: 800; letter-spacing: .25em; text-align: center; }

/* Lyssnar-räknare */
.listeners { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-weight: 600; }

/* Frågor */
.question { background: linear-gradient(135deg, #2a2410, #1f2c3a); border: 1px solid #5a4a18; border-radius: 12px; padding: 14px; }
.question .who { font-weight: 700; color: var(--warn); }
.question .orig { color: var(--muted); font-size: .85rem; margin-top: 6px; font-style: italic; }

/* Status-prick */
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); }
.status .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.status.live .dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .4; } }

.notice { background: rgba(251,191,36,.1); border: 1px solid #5a4a18; color: var(--warn); border-radius: 12px; padding: 12px 14px; font-size: .9rem; line-height: 1.45; }
.footer { color: var(--muted); font-size: .8rem; text-align: center; margin-top: 28px; }
a { color: var(--accent-2); }
