/* Kommuntestet — quiz + results layout
   Visuell riktning: skog/sjö/aftonljus (inte lila, inte cream+terracotta)

   Skala:
   - --ui-scale: 1     = ursprunglig “comfortable” (före 2026-10-20 kompakt)
   - --ui-scale: 0.86  = nuvarande kompakt (mindre scroll)
   Comfortable-referens (vid scale 1): brand clamp 2.8–4.6rem, q-stage min-height 28rem,
   map min-height 30rem, view padding-bottom 3rem, topbar padding 1rem 1.4rem.
*/

:root {
  --ui-scale: 0.86; /* sätt till 1 för ursprunglig storlek */
  --ink: #14201c;
  --ink-soft: #2a3d36;
  --paper: #f3f6f2;
  --mist: rgba(243, 246, 242, 0.72);
  --forest: #1f5c45;
  --forest-deep: #0f3a2c;
  --lake: #2a6f8a;
  --lake-deep: #163f52;
  --sun: #d4a15a;
  --sun-soft: #e8c488;
  --granite: #5c6b66;
  --danger: #a63d3d;
  --ok: #2f7a55;
  --glass: rgba(255, 255, 255, 0.14);
  --glass-strong: rgba(255, 255, 255, 0.28);
  --shadow: 0 18px 50px rgba(15, 40, 32, 0.28);
  --radius: calc(18px * var(--ui-scale));
  --font-display: "Syne", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: calc(16px * var(--ui-scale));
}

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

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--forest-deep);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

/* ----- Atmosphere ----- */

.app-shell {
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 15% 10%, rgba(42, 111, 138, 0.55), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 20%, rgba(212, 161, 90, 0.35), transparent 50%),
    radial-gradient(ellipse 90% 70% at 50% 100%, rgba(15, 58, 44, 0.95), transparent 60%),
    linear-gradient(165deg, #1a4a58 0%, #0f3a2c 42%, #163028 100%);
}

.atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1' opacity='0.35'%3E%3Cpath d='M20 120c18-28 36-42 54-42s36 14 54 42'/%3E%3Cpath d='M40 40c8 14 8 28 0 42'/%3E%3Ccircle cx='120' cy='36' r='10'/%3E%3C/g%3E%3C/svg%3E");
  animation: drift 48s linear infinite;
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10, 28, 24, 0.45) 100%);
}

@keyframes drift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 320px 160px;
  }
}

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1.1rem;
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: #f7faf7;
  text-decoration: none;
}

.topbar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ghost-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: var(--glass);
  color: #f3f6f2;
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.ghost-btn:hover {
  background: var(--glass-strong);
  transform: translateY(-1px);
}

.view {
  position: relative;
  z-index: 2;
  width: min(1000px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding-bottom: 1.75rem;
}

/* ----- Welcome / hero ----- */

.hero {
  min-height: calc(100dvh - 3.5rem);
  display: grid;
  align-items: end;
  padding: 0.5rem 0 1.5rem;
}

.hero-panel {
  position: relative;
  z-index: 2;
  max-width: min(34rem, calc(100% - 11rem));
  animation: rise-in 0.9s var(--ease) both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.brand-hero {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.65rem, 4.8vw, 2.85rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #f8fbf8;
  margin: 0 0 1.1rem;
  max-width: 18ch;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn-primary {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  color: var(--forest-deep);
  background: linear-gradient(135deg, var(--sun-soft), var(--sun));
  box-shadow: 0 12px 30px rgba(212, 161, 90, 0.35);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 16px 36px rgba(212, 161, 90, 0.45);
}

.btn-secondary {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #f3f6f2;
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: background 0.25s var(--ease);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

.name-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.9rem;
}

.name-field label {
  color: rgba(243, 246, 242, 0.75);
  font-size: 0.85rem;
}

.name-field input {
  width: min(22rem, 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(10, 30, 26, 0.35);
  color: #f8fbf8;
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  outline: none;
  backdrop-filter: blur(8px);
}

.name-field input:focus {
  border-color: var(--sun);
  box-shadow: 0 0 0 3px rgba(212, 161, 90, 0.25);
}

.hero-motif {
  position: absolute;
  right: max(-1.5rem, calc((100vw - 1000px) / 2 - 3rem));
  bottom: 3%;
  width: min(24vw, 200px);
  height: auto;
  opacity: 0.88;
  z-index: 1;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.28));
  animation: floaty 7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@media (max-width: 820px) {
  .hero-panel {
    max-width: 34rem;
  }

  .hero-motif {
    opacity: 0.22;
    width: min(42vw, 160px);
    right: -6vw;
    bottom: 6%;
  }
}

/* ----- Quiz ----- */

.quiz-layout {
  display: grid;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.progress-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: rgba(243, 246, 242, 0.8);
  font-size: 0.9rem;
}

.progress-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lake), var(--sun));
  transition: width 0.45s var(--ease);
}

.question-stage {
  position: relative;
  min-height: 0;
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  box-shadow: var(--shadow);
  isolation: isolate;
  animation: stage-in 0.55s var(--ease) both;
}

@keyframes stage-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.question-stage[data-theme="skog"] {
  background:
    linear-gradient(135deg, rgba(15, 58, 44, 0.55), rgba(20, 70, 90, 0.35)),
    radial-gradient(circle at 80% 20%, rgba(232, 196, 136, 0.25), transparent 40%),
    linear-gradient(160deg, #1f5c45, #163f52);
}

.question-stage[data-theme="sjo"] {
  background:
    linear-gradient(160deg, rgba(22, 63, 82, 0.7), rgba(15, 58, 44, 0.45)),
    radial-gradient(circle at 20% 80%, rgba(120, 190, 210, 0.3), transparent 45%),
    linear-gradient(145deg, #2a6f8a, #0f3a2c);
}

.question-stage[data-theme="afton"] {
  background:
    linear-gradient(150deg, rgba(80, 50, 30, 0.35), rgba(15, 58, 44, 0.55)),
    radial-gradient(circle at 70% 30%, rgba(212, 161, 90, 0.45), transparent 40%),
    linear-gradient(160deg, #3a5a48, #8a6234);
}

.question-stage[data-theme="granit"] {
  background:
    linear-gradient(155deg, rgba(40, 50, 48, 0.65), rgba(30, 70, 80, 0.5)),
    linear-gradient(160deg, #3d4f4a, #1f3d48);
}

.question-stage[data-theme="eld"] {
  background:
    radial-gradient(circle at 30% 20%, rgba(220, 120, 60, 0.35), transparent 40%),
    linear-gradient(155deg, #5a3420, #1f5c45);
}

.q-symbols {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.18;
  pointer-events: none;
}

.q-symbols svg {
  width: 100%;
  height: 100%;
}

.q-glass {
  position: relative;
  z-index: 1;
  margin: clamp(0.65rem, 2vw, 1.1rem);
  padding: clamp(0.85rem, 2.2vw, 1.25rem);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(16px) saturate(1.15);
  color: #f7faf7;
}

.q-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.72;
  margin: 0 0 0.35rem;
}

.q-title {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: clamp(1.2rem, 2.8vw, 1.65rem);
  line-height: 1.15;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.options {
  display: grid;
  gap: 0.45rem;
}

.option {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(8, 24, 22, 0.28);
  color: #f7faf7;
  border-radius: 12px;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.option.has-slogan {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.7rem 0.85rem;
}

.option-label {
  font-weight: 650;
  letter-spacing: 0.01em;
}

.option-slogan {
  font-size: 0.82rem;
  line-height: 1.35;
  opacity: 0.78;
  font-weight: 400;
}

.option:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateX(3px);
}

.option.is-selected {
  border-color: var(--sun);
  background: linear-gradient(120deg, rgba(212, 161, 90, 0.28), rgba(255, 255, 255, 0.1));
  box-shadow: inset 0 0 0 1px rgba(212, 161, 90, 0.45);
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

/* ----- Results personal ----- */

.results-personal {
  display: grid;
  gap: 0.9rem;
  padding-top: 0.4rem;
  animation: rise-in 0.7s var(--ease) both;
}

.result-hero {
  border-radius: calc(var(--radius) + 4px);
  padding: clamp(0.95rem, 2.5vw, 1.4rem);
  color: #f8fbf8;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    linear-gradient(160deg, #1f5c45, #163f52 60%, #2a4a38);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.result-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.2vw, 2.05rem);
  margin: 0 0 0.3rem;
  letter-spacing: -0.02em;
}

.result-hero .match-line {
  font-size: 1rem;
  margin: 0;
  opacity: 0.92;
}

.result-hero .match-line strong {
  color: var(--sun-soft);
}

.result-hero .form-line {
  font-size: 0.92rem;
  margin: 0.45rem 0 0;
  opacity: 0.88;
  line-height: 1.4;
}

.result-hero .form-line strong {
  color: var(--sun-soft);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.result-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #f3f6f2;
}

.result-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.detail-panel {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0.4rem 0 2rem;
  animation: rise-in 0.55s var(--ease) both;
}

.detail-head {
  margin-bottom: 1.1rem;
}

.detail-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  margin: 0.75rem 0 0.35rem;
  letter-spacing: -0.02em;
  color: #f3f6f2;
}

.detail-lead {
  margin: 0;
  max-width: 38rem;
  color: rgba(243, 246, 242, 0.78);
  line-height: 1.45;
}

.vars-list {
  display: grid;
  gap: 0.75rem;
}

.var-card {
  border-radius: 16px;
  padding: 0.95rem 1.05rem;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)),
    rgba(8, 28, 24, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f3f6f2;
}

.var-card.is-off {
  opacity: 0.55;
}

.var-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: baseline;
  margin-bottom: 0.45rem;
}

.var-card-top h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0;
  flex: 1 1 12rem;
}

.var-meta {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.72;
}

.var-col {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  color: var(--sun-soft);
}

.var-opts {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.28rem;
}

.var-opts li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  font-size: 0.88rem;
  padding: 0.28rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.var-opts li span:last-child {
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.var-skatta {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.18);
}

.var-skatta-status {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--sun-soft);
}

.var-note {
  margin: 0 0 0.55rem;
  font-size: 0.86rem;
  line-height: 1.35;
  color: rgba(243, 246, 242, 0.82);
}

.var-skatta-items li span:first-child {
  font-variant-numeric: tabular-nums;
  color: var(--sun-soft);
}

.var-cluster {
  margin-top: 0.7rem;
}

.var-cluster-lead {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  opacity: 0.85;
}

.var-cluster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.var-cluster-table th,
.var-cluster-table td {
  padding: 0.28rem 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: right;
}

.var-cluster-table th:first-child,
.var-cluster-table td:first-child {
  text-align: left;
}

.var-cluster-table thead th {
  font-weight: 600;
  opacity: 0.9;
}

.blend-hero .blend-result {
  margin-top: 0.5rem;
}

.blend-card {
  border-radius: 18px;
  padding: clamp(1.1rem, 3vw, 1.6rem);
  color: #f8fbf8;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    linear-gradient(160deg, #1f5c45, #163f52 55%, #2a4a38);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow);
}

.blend-card .blend-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.blend-card h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.35rem);
  margin: 0 0 0.45rem;
  letter-spacing: -0.02em;
  color: var(--sun-soft);
}

.blend-card .blend-score {
  margin: 0 0 1rem;
  opacity: 0.9;
}

.blend-map-wrap {
  max-width: 14rem;
  margin: 0 0 1.1rem;
}

.blend-map-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

.blend-members,
.blend-votes {
  margin: 0 0 0.85rem;
  padding: 0;
  list-style: none;
}

.blend-members li,
.blend-votes li {
  padding: 0.28rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.92rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.blend-section-title {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.blend-empty {
  padding: 1.2rem;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  color: rgba(243, 246, 242, 0.85);
}

/* ----- Group board ----- */

.group-board {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0.85rem;
  align-items: stretch;
}

@media (max-width: 860px) {
  .group-board {
    grid-template-columns: 1fr;
  }
}

.board-panel {
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px);
  color: #f5f8f5;
  padding: 0.85rem;
  box-shadow: var(--shadow);
}

.board-panel h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.55rem;
}

.map-wrap {
  position: relative;
  min-height: 22rem;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 40% 30%, rgba(42, 111, 138, 0.35), transparent 50%),
    linear-gradient(180deg, rgba(20, 50, 44, 0.5), rgba(10, 28, 24, 0.35));
}

.map-wrap svg {
  width: 100%;
  height: 100%;
  min-height: 22rem;
}

.sweden-land path {
  paint-order: stroke fill;
}

.pin {
  cursor: pointer;
}

.pin circle {
  fill: var(--sun);
  stroke: #14201c;
  stroke-width: 1.5;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
  transition: r 0.2s var(--ease);
}

.pin:hover circle,
.pin.is-active circle {
  fill: #fff3d6;
}

.pin-label {
  font-family: var(--font-body);
  font-size: 11px;
  fill: #f7faf7;
  paint-order: stroke;
  stroke: rgba(15, 40, 32, 0.75);
  stroke-width: 3px;
}

.roster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.roster li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: rgba(8, 24, 22, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.roster .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sun);
}

.roster .who {
  font-weight: 650;
}

.roster .where {
  opacity: 0.75;
  font-size: 0.88rem;
  text-align: right;
}

.board-note {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  opacity: 0.7;
}

/* ----- Fellogg panel ----- */

.fellogg-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(8, 18, 16, 0.55);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.fellogg-panel {
  width: min(760px, 100%);
  max-height: min(80dvh, 640px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: #101c19;
  color: #e8f0ec;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.fellogg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fellogg-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.fellogg-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.fellogg-body {
  margin: 0;
  padding: 1rem;
  overflow: auto;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: #cfe0d7;
  background: #0b1412;
  flex: 1;
}

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  background: rgba(16, 28, 25, 0.92);
  color: #f3f6f2;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  font-size: 0.9rem;
  backdrop-filter: blur(8px);
  animation: rise-in 0.35s var(--ease);
}

.mode-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(243, 246, 242, 0.9);
  background: rgba(255, 255, 255, 0.08);
}

.mode-badge[data-mode="live"] {
  border-color: rgba(232, 196, 136, 0.55);
  color: #fff3d6;
  background: rgba(212, 161, 90, 0.22);
}

.room-panel {
  margin: 0 0 1rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 30, 26, 0.28);
  max-width: 28rem;
}

.room-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.room-join {
  display: flex;
  gap: 0.4rem;
  flex: 1;
  min-width: 12rem;
}

.room-join input,
.tunnel-field input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(10, 30, 26, 0.35);
  color: #f8fbf8;
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  outline: none;
}

.room-join input:focus,
.tunnel-field input:focus {
  border-color: var(--sun);
}

.room-active {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.room-code-line {
  margin: 0 0 0.65rem;
  color: #f8fbf8;
  font-size: 1.05rem;
}

.tunnel-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.7rem;
}

.tunnel-field label {
  color: rgba(243, 246, 242, 0.75);
  font-size: 0.8rem;
}

.tunnel-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.qr-block {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
}

.qr-block img {
  width: 160px;
  height: 160px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.score-bit {
  font-size: 0.85em;
  opacity: 0.75;
  font-weight: 500;
}
