:root {
  color-scheme: light;
  --bg: #fbf7ef;
  --paper: #fffdf8;
  --ink: #16211d;
  --muted: #6b746f;
  --line: #e8dfd1;
  --green: #2f7b61;
  --green-soft: #dceee5;
  --coral: #e36f57;
  --coral-soft: #ffe2da;
  --gold: #d9ad4f;
  --shadow: 0 18px 45px rgba(42, 34, 20, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(0, 106, 167, 0.08) 0 10px, transparent 10px 100%),
    radial-gradient(circle at 85% 8%, rgba(217, 173, 79, 0.18), transparent 17rem),
    radial-gradient(circle at top left, rgba(227, 111, 87, 0.15), transparent 34rem),
    linear-gradient(180deg, #fffaf2 0%, var(--bg) 45%, #f3eee4 100%);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  cursor: pointer;
}

.app-shell {
  position: relative;
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 18px 14px 48px;
}

.party-flags {
  display: flex;
  gap: 5px;
  width: max-content;
  margin: 0 0 12px 2px;
  filter: drop-shadow(0 6px 10px rgba(42, 34, 20, 0.12));
}

.party-flags span {
  width: 24px;
  height: 18px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: #006aa7;
  position: relative;
}

.party-flags span::before,
.party-flags span::after {
  content: "";
  position: absolute;
  background: #fecc02;
}

.party-flags span::before {
  left: 8px;
  top: 0;
  width: 4px;
  height: 100%;
}

.party-flags span::after {
  left: 0;
  top: 6px;
  width: 100%;
  height: 4px;
}

.party-flags span:nth-child(2),
.party-flags span:nth-child(5),
.party-flags span:nth-child(7) {
  transform: translateY(5px);
}

.party-flags span:nth-child(3),
.party-flags span:nth-child(6) {
  transform: translateY(-2px);
}

.swedish-flags {
  position: absolute;
  top: 132px;
  left: 22px;
  right: 22px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.swedish-flags span {
  position: relative;
  width: 30px;
  height: 21px;
  border-radius: 3px;
  background: #006aa7;
  box-shadow: 0 8px 18px rgba(0, 106, 167, 0.16);
}

.swedish-flags span::before,
.swedish-flags span::after {
  content: "";
  position: absolute;
  background: #fecc02;
}

.swedish-flags span::before {
  left: 10px;
  top: 0;
  width: 5px;
  height: 100%;
}

.swedish-flags span::after {
  left: 0;
  top: 8px;
  width: 100%;
  height: 5px;
}

.swedish-flags span:nth-child(2),
.swedish-flags span:nth-child(4) {
  margin-top: 12px;
}

.student-caps {
  position: absolute;
  top: 112px;
  left: 50%;
  display: flex;
  gap: 135px;
  transform: translateX(-50%);
  pointer-events: none;
}

.student-caps span {
  position: relative;
  width: 44px;
  height: 20px;
  border: 2px solid rgba(22, 33, 29, 0.14);
  border-radius: 50% 50% 44% 44%;
  background: #fff;
  box-shadow: 0 7px 14px rgba(42, 34, 20, 0.12);
}

.student-caps span::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -8px;
  height: 9px;
  border-radius: 0 0 50% 50%;
  background: #16211d;
}

.student-caps span::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #006aa7;
}

.balloons {
  position: absolute;
  top: 12px;
  right: 116px;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  pointer-events: none;
}

.balloons span {
  position: relative;
  display: block;
  width: 19px;
  height: 25px;
  border-radius: 50% 50% 46% 46%;
  background: var(--coral);
  box-shadow: inset -5px -6px 0 rgba(0, 0, 0, 0.08);
}

.balloons span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 24px;
  width: 1px;
  height: 26px;
  background: rgba(22, 33, 29, 0.22);
}

.balloons span:nth-child(2) {
  width: 22px;
  height: 30px;
  margin-top: 8px;
  background: var(--green);
}

.balloons span:nth-child(3) {
  margin-top: 2px;
  background: var(--gold);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 2px 14px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.45rem, 8vw, 2.4rem);
  line-height: 1;
  color: var(--green);
}

h2 {
  font-size: clamp(1.35rem, 6vw, 2rem);
  line-height: 1.05;
}

h3 {
  font-size: 1rem;
}

p {
  line-height: 1.55;
}

.date-pill {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 1px solid rgba(47, 123, 97, 0.2);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: center;
}

.date-pill span {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 -4px 18px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(14px);
}

.tab {
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab.is-active {
  background: var(--ink);
  color: #fffaf2;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.hero-card,
.lock-card,
.quiz-card,
.info-card,
.composer,
.todo-item,
.question-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.93);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 20px;
  overflow: hidden;
  align-items: stretch;
}

.hero-card p {
  margin: 10px 0 0;
  color: var(--muted);
}

.countdown {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  min-width: 88px;
  min-height: 100%;
  padding: 10px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
}

.countdown span {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.countdown small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.section-stack {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.info-card {
  padding: 16px;
}

.info-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  list-style: none;
  cursor: pointer;
}

.info-card summary::-webkit-details-marker {
  display: none;
}

.summary-icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 900;
}

.summary-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.info-body {
  margin: 12px 0 0;
  color: var(--muted);
}

.agenda {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.agenda li {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: start;
}

.agenda time {
  color: var(--green);
  font-weight: 900;
}

.map-card {
  position: relative;
  min-height: 150px;
  margin-top: 12px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 48%, rgba(255, 255, 255, 0.65) 48% 52%, transparent 52%),
    linear-gradient(0deg, transparent 45%, rgba(255, 255, 255, 0.7) 45% 53%, transparent 53%),
    #dceee5;
  overflow: hidden;
}

.map-pin {
  position: absolute;
  left: 52%;
  top: 38%;
  transform: translate(-50%, -50%);
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

.parking-map {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf7;
  overflow: hidden;
}

.map-toolbar {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.82);
}

.map-toolbar button {
  min-width: 44px;
  min-height: 40px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
}

.map-toolbar button:last-child {
  margin-left: auto;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.map-viewport {
  overflow: hidden;
  touch-action: pan-y;
}

.parking-map-svg {
  display: block;
  width: 100%;
  min-height: 230px;
}

.map-world {
  transform-origin: 50% 50%;
  transition: transform 180ms ease;
}

.map-bg {
  fill: #e5f0e8;
}

.map-road {
  fill: none;
  stroke: #fff8ea;
  stroke-width: 28;
  stroke-linecap: round;
  filter: drop-shadow(0 1px 0 rgba(42, 34, 20, 0.08));
}

.map-road-main {
  stroke-width: 34;
}

.map-path {
  fill: none;
  stroke: rgba(47, 123, 97, 0.28);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 2 14;
}

.parking-area {
  fill: rgba(0, 106, 167, 0.24);
  stroke: #006aa7;
  stroke-width: 3;
}

.parking-lines {
  fill: none;
  stroke: rgba(0, 106, 167, 0.45);
  stroke-width: 2;
  stroke-linecap: round;
}

.house-shape {
  fill: #fffdf8;
  stroke: var(--green);
  stroke-width: 3;
}

.house-roof {
  fill: none;
  stroke: var(--green);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.house-dot {
  fill: var(--green);
  stroke: #fff;
  stroke-width: 4;
}

.walk-line {
  fill: none;
  stroke: var(--coral);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 4 9;
}

.walk-dot {
  fill: var(--coral);
  stroke: #fff;
  stroke-width: 2;
}

.map-label {
  fill: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.map-label-house {
  fill: var(--green);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-legend i {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.legend-house {
  background: var(--green);
}

.legend-parking {
  background: #006aa7;
  opacity: 0.55;
}

.legend-walk {
  background: var(--coral);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.photo-tile {
  aspect-ratio: 1;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(47, 123, 97, 0.18), rgba(227, 111, 87, 0.22)),
    var(--paper);
  border: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 14px;
}

.ghost-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
  padding: 0 12px;
}

.quiz-card,
.lock-card,
.composer,
.question-editor,
.agenda-editor-item,
.leaderboard-admin {
  padding: 16px;
}

.quiz-options {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.option-button {
  width: 100%;
  min-height: 70px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 16px;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(42, 34, 20, 0.07);
}

.option-button:disabled,
.secondary-button:disabled,
.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.option-1 {
  background: #e7f2ec;
}

.option-2 {
  background: #ffe8df;
}

.option-3 {
  background: #fff1c8;
}

.option-4 {
  background: #e4ecff;
}

.option-5 {
  background: #f3e9ff;
}

.option-button.is-selected {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(47, 123, 97, 0.13);
}

.quiz-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.primary-button,
.password-form button,
.composer button {
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  padding: 0 16px;
}

.lock-card p {
  color: var(--muted);
}

.password-form,
.composer,
.question-form,
.name-form {
  display: grid;
  gap: 9px;
}

label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
}

textarea {
  resize: vertical;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--coral);
  font-weight: 800;
}

.admin-panel {
  display: grid;
  gap: 14px;
}

.todo-list,
.quiz-editor,
.agenda-editor {
  display: grid;
  gap: 10px;
}

.todo-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
}

.todo-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  accent-color: var(--green);
}

.todo-item.is-done .todo-title {
  color: var(--muted);
  text-decoration: line-through;
}

.todo-title {
  margin: 0;
  font-weight: 900;
}

.todo-comment {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--coral-soft);
  color: var(--coral);
  font-weight: 900;
}

.quiz-editor-head {
  margin-top: 14px;
}

.question-editor {
  display: grid;
  gap: 10px;
}

.agenda-editor-item,
.leaderboard-admin {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.93);
  box-shadow: var(--shadow);
}

.agenda-editor-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.agenda-editor-draft {
  border-color: rgba(47, 123, 97, 0.35);
  background: #f6fff9;
}

.question-grid {
  display: grid;
  gap: 8px;
}

.answer-row {
  display: grid;
  gap: 7px;
}

.answer-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.editor-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.secondary-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  padding: 0 12px;
}

.quiz-image {
  display: block;
  width: 100%;
  max-height: 230px;
  object-fit: cover;
  border-radius: 8px;
  margin: 4px 0 14px;
  border: 1px solid var(--line);
}

.quiz-meta,
.admin-note,
.empty-state {
  color: var(--muted);
  margin: 12px 0 0;
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  white-space: nowrap;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.leaderboard {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.leaderboard-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.leaderboard-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.leaderboard-list span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.leaderboard-list span:last-child {
  grid-column: 1 / -1;
}

@media (min-width: 720px) {
  .app-shell {
    padding: 28px 24px 72px;
  }

  main {
    max-width: 760px;
    margin: 0 auto;
  }

  .section-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-card:first-child,
  .info-card:nth-child(3) {
    grid-column: span 2;
  }

  .hero-card {
    padding: 28px;
  }

  .balloons {
    right: 140px;
  }
}
