/* =========================================================
  Farver, base og variabler
  ========================================================= */
:root {
  /* Nyt Spilcaféen-tema */
  --cream: #fff8ef;
  --brown: #661010;
  --text: #501012;
  --ring: #e6c1b9;
  --pink: #f2d2ca;
  --shadow: 0 6px 18px rgba(91, 17, 17, 0.14);
  --thumb-ratio: 1 / 1;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* baggrundsfarve */
body {
  background: var(--cream);
  color: var(--text);
  font: 16px/1.4 ui-sans-serif, system-ui, Segoe UI, Roboto, Inter;
}

.visually-hidden, .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
  HEADER 
  ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 3000;
  height: 90px;
  background: var(--cream);
  padding: 0;
  margin: 0 0 12px;
  overflow: visible;
}


/* Selve bjælken: absolut, så padding ikke skubber den */
.topbar-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 70px;
  width: 100%;
  background: var(--brown);
  box-shadow: var(--shadow);
}

/* tilbage-knap i topbaren */
.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 20px;
  color: #fff;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
}

.header-back {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 20;

  font-size: 22px;
  color: #fff;
}

.selected-cafe-name {
  position: absolute;
  left: 12px;
  bottom: 25px;
  z-index: 20;

  display: block;
  width: 135px;

  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.15;
  text-align: left;
  white-space: normal;
}

  /* =========================================================
   FORSIDE – VÆLG CAFÉ
========================================================= */

.home-view {
  min-height: 100vh;
  padding: 32px 20px 120px;
  background: var(--cream);
  text-align: center;
}

.home-logo {
  display: block;
  width: 150px;
  height: auto;
  margin: 0 auto 24px;
}

.home-intro {
  max-width: 500px;
  margin: 0 auto 32px;
}

.home-intro h1 {
  margin: 0 0 12px;
  color: var(--brown);
  font-size: 26px;
}

.home-intro p {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

.home-view h2 {
  margin: 0 0 18px;
  color: var(--brown);
  font-size: 22px;
}

.cafe-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.cafe-card {
  min-height: 0px;
  padding: 10px;
  border: 0;
  border-radius: 20px;
  background: var(--brown);
  color: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;

  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;

  font: inherit;
  text-align: left;
  height: auto;
  align-self: start;
  overflow: hidden;
}

.cafe-card img {
  width: 100%;
  height: 145px;
  object-fit: cover;
  display: block;
  border-radius: 15px;
  margin-bottom: 12px;
}

.cafe-card strong {
  font-size: 20px;
  display: block;
  line-height: 1.2;
  margin: 0 4px 6px;
}

.cafe-card span {
  font-size: 15px;
  opacity: 0.9;
  display: block;
  line-height: 1.3;
  margin: 0 4px 6px;
}

.cafe-card:hover {
  transform: translateY(-2px);
}

.cafe-card:focus-visible {
  outline: 3px solid var(--brown);
  outline-offset: 3px;
}


/* =========================================================
  SPILOVERSIGT – SØGNING OG FILTER
  ========================================================= */
.page {
  padding: 12px 14px 110px;
  /* ekstra bund-padding så tabbar ikke dækker */
  max-width: min(1400px, 100%);
  margin: 0 auto;
}

/* Søg-bar */
.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background:#fffaf7;
  border: 1px solid var(--ring);
  box-shadow: none;
  border-radius: 14px;
  padding: 0px 14px;
  margin: 0px;
  min-height: 44px;
}

.searchbar input::placeholder {
  color: #8d7a77;
}

.searchbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}

/* filter*/

.search-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 10px;
  align-items: center;
  margin: -18px 0 16px;
}

.search-icon {
  font-size: 22px;
  color: var(--brown);
}

.filter-toggle {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--brown);
  border-radius: 14px;
  background: var(--pink);
  color: var(--brown);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.filter-toggle:focus-visible {
  outline: 3px solid var(--brown);
  outline-offset: 2px;
}

.filter-menu {
  border: 1px solid var(--brown);
  border-radius: 14px;
  margin-bottom: 16px;
  overflow: hidden;
}

.filter-menu[hidden] {
  display: none;
}

.filter-group {
  border-bottom: 1px solid var(--ring);
}

.filter-group:last-child {
  border-bottom: 0;
}

.filter-group-toggle {
  width: 100%;
  min-height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border: 0;
  background: #efd1d1;
  color: var(--brown);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.filter-options {
  background: #fff;
}

.filter-options[hidden] {
  display: none;
}

.filter-options label {
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border-top: 1px solid #eee4df;
}

.filter-options input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--brown);
}

.filters-storage[hidden] {
  display: none;
}


/* valgte filtre */

.selected-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.selected-filters[hidden] {
  display: none;
}

.selected-filter {
  padding: 6px 10px;
  border: 1px solid var(--brown);
  border-radius: 999px;
  background: #efd1d1;
  color: var(--brown);
  font: inherit;
  cursor: pointer;
}




/* =========================================================
  KORT / SPIL-KORT
  ========================================================= */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: 
    linear-gradient(
        145deg,
        #9e1619 0%,
        #850d10 60%,
        #76090c 100%
      );
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 5px 12px rgba(83, 14, 14, 0.18);
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.thumb {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #661010;
  aspect-ratio: var(--thumb-ratio);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 10px;
}

.fav {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 999px;
  padding: 6px 8px;
  font-size: 16px;
  cursor: pointer;
  z-index: 2;
}

.fav.active {
  background: #fff;
  color: #c0183c;
}

.card h3 {
  margin: 8px 4px 6px;
  font-size: 16px;
}

.meta,
.extra {
  color: #f1dfd6;
  opacity: 0.95;
  display: flex;
  gap: 10px;
  margin: 0 4px 4px;
  font-size: 14px;
}

.extra {
  flex-direction: column;
  gap: 2px;
}

.badges {
  position: absolute;
  left: 8px;
  top: 8px;
  display: flex;
  gap: 6px;
}

.badge {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  padding: 3px 6px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.card-open {
  position: absolute;
  inset: 0;
  z-index: 1;

  border: 0;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
}

.card-open:focus-visible {
  outline: 3px solid #000;
  outline-offset: 3px;
}

/* =========================================================
  TABBAR – altid klikbar, hover-effekt, alle lige store
  ========================================================= */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8000;
  background: #efd8c6;
  backdrop-filter: saturate(1.2) blur(6px);
  border-top: 1px solid #efd8ce;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 8px 8px 6px;
  height: 78px;
}


/* Generel styling af navigationens knapper */
.tabbar button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #7b5647;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 4px;
  font-size: 15px;
  outline: 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s ease, background-color 0.18s ease,
    color 0.18s ease, box-shadow 0.18s ease;
  border-radius: 12px;
}

.tabbar[hidden] {
  display: none;
}
 /* Ikoner */
#tab-all img {
  width: 34px;
  height: 34px;
}

#tab-reserve img {
  width: 31px;
  height: 31px;
}

#filter-favourites img {
  width: 29px;
  height: 27px;
}

#tab-profile img {
  width: 30px;
  height: 30px;
}

.tabbar .tab {
  display: grid;
  grid-template-rows: 34px 30px;

  height: 64px;
  width: 100%;

  justify-items: center;
  align-items: start;
  align-self: center;

  gap: 4px;
  padding: 0 4px;
}

.tabbar .tab img {
  object-fit: contain;
  align-self: start;
  justify-self: center;
}

.tabbar .tab small {
  display: block;

  width: 100%;
  height: 30px;
  margin: 0;

  font-size: 12px;
  line-height: 1.1;
  text-align: center;

  align-self: start;
}

/* Aktiv tilstand */
.tabbar .tab.active {
  color: #3b2118;
  font-weight: 700;
}

.tabbar .tab.active::after {
  content: "";
  width: 24px;
  height: 3px;
  background: #3b2118;
  border-radius: 999px;
  margin-top: 4px;
}



/* Hover og fokus */
.tabbar .tab:hover,
.tabbar .tab:focus-visible,
.tabbar .tab:active {
  transform: scale(1.08);
  background: rgba(0, 0, 0, 0.05);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

/* Synlig tastaturfokus */
.tabbar button:focus-visible {
  outline: 2px solid rgba(59, 33, 24, 0.35);
  outline-offset: 2px;
}

/* Hjem-knap i midten */
.tabbar .home-fab {
  width: 62px;
  height: 62px;

  justify-self: center;
  align-self: center;

  position: relative;
  top: -38px;
  z-index: 2;

  padding: 0;
  margin: 0;

  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
}

.tabbar .home-fab img {
  width: 78px;
  height: 78px;
  display: block;
}
.tabbar .home-fab:focus-visible {
  outline: 3px solid var(--brown);
  outline-offset: 3px;
}

/* =========================================================
   FOOTER
========================================================= */
.legal {
  text-align: center;
  color: #661010;
  font-size: 12px;
  padding: 10px 0 80px;
}

/* =========================================================
   MODAL – SPILDETALJER
========================================================= */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.122);
}

.modal-card {
  position: relative;
  z-index: 1;
  background: var(--brown);
  color: #fff;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow);
  width: min(920px, 100%);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 999px;
  font-size: 22px;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
}


/* Billede og indhold */
.modal-media {
  flex: 0 0 auto;
  background: #1a1a1a7b;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-media img {
  width: 100%;
  height: auto;
  max-height: 350px;
  object-fit: contain;
  display: block;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  display: grid;
  gap: 10px;
}

.modal-body h2 {
  margin: 0;
  font-size: clamp(20px, 3.2vw, 28px);
}

.modal-meta {
  display: flex;
  gap: 14px;
  opacity: 0.95;
  flex-wrap: wrap;
}

.modal-details {
  display: grid;
  gap: 6px;
}

.modal-details span {
  opacity: 0.95;
}

/* Regler fold ud og ind  */
.rules-btn {
  background: none;
  border: none;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 1.1rem;
  transition: color 0.2s ease;
}

.rules-btn:hover {
  color: #ffd479;
}

.rules-btn[aria-expanded="true"]::before {
  content: "▾";
}

.rules-btn[aria-expanded="false"]::before {
  content: "▸";
}

.rules-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.rules-content.open {
  max-height: 600px;
}

#modal-rules {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem;
  border-radius: 6px;
  white-space: pre-wrap;
  line-height: 1.4;
  margin-top: 0.5rem;
}

/* =========================================================
  BOOKING
  ========================================================= */
.booking[hidden] {
  display: none;
}

.booking {
  position: relative;
  max-width: clamp(600px, 90vw, 1100px);
  margin: 0 auto;
  padding: 20px 16px 120px;
}

.booking-logo {
  height: 56px;
  display: block;
  margin: 10px auto 8px;
}

.booking-title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  text-align: center;
  margin: 10px 0 16px;
  color: #3b2118;
}

/* Valg af café */
.booking-grid {
  display: grid;
  gap: 16px;
}

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

.booking-card {
  background: var(--brown);
  color: #fff;
  border-radius: 14px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.booking-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.booking-bubbles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
/* Kalender */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 8px;
}
.cal-arrow {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 22px;
  padding: 6px 10px;
  color: #3b2118;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  justify-items: center;
}

.cal-day {
  /* ma, ti, on ... */
  font-weight: 700;
  font-size: 14px;
  color: #7b5647;
}

.cal-cell {
  /* <-- de enkelte dages KNAPPER */
  width: 40px;
  height: 40px;
  border-radius: 50%; /* gør dem RUNDE */
  border: 1px solid var(--ring);
  background: #7fa763;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.cal-cell:hover {
  background: #f2e4d8;
  transform: scale(1.06);
}

.legend {
  margin-top: 10px;
  color: #7b5647;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot-green {
  background: #7fb77e;
}
.dot-red {
  background: #c27474;
}

.bubble {
  background: #5b2a1a;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 16px 0;
  text-align: center;
  font-weight: 800;
  cursor: pointer;
  font-size: 18px;
}

.booking-time {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}


.slot {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--ring);
  text-align: center;
  cursor: pointer;
}

.slot.busy {
  opacity: 0.45;
  pointer-events: none;
  text-decoration: line-through;
}

.slot.primary {
  background: var(--brown);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.booking-type {
  display: grid;
  gap: 10px;
}

.booking-form {
  display: grid;
  gap: 10px;
}

.booking-form label {
  font-weight: 600;
  color: var(--text);
  margin-bottom: -4px;
}

.booking-form input,
.booking-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--ring);
  background: #fff;
}

.booking-btn {
  padding: 12px;
  border-radius: 12px;
  background: var(--brown);
  color: #fff;
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.booking-summary {
  background: #fff;
  border: 1px solid var(--ring);
  border-radius: 12px;
  padding: 10px 12px;
}

.booking-success {
  display: grid;
  gap: 12px;
  text-align: center;
}

.success-big {
  font-size: 22px;
  font-weight: 800;
  color: #3b2118;
}

/* =========================================================
   10. RESPONSIVT DESIGN
========================================================= */

@media (max-width: 600px) {
  .home-view {
    padding: 18px 20px 20px;
  }

  .home-logo {
    width: 130px;
    margin: 0 auto 18px;
  }

  .home-intro {
    margin-bottom: 18px;
  }

  .home-intro h1 {
    font-size: 25px;
    line-height: 1.15;
    margin-bottom: 10px;
  }

  .home-intro p {
    font-size: 15px;
    line-height: 1.4;
    margin: 0 auto;
  }

  .home-view > h2 {
    font-size: 23px;
    margin: 20px 0 14px;
  }

  .cafe-grid {
    gap: 10px;
  }

  .cafe-card {
    padding: 7px;
    border-radius: 16px;
  }

  .cafe-card img {
    height: 100px;
    border-radius: 12px;
    margin-bottom: 7px;
  }

  .cafe-card strong {
    font-size: 17px;
    line-height: 1.1;
    margin: 0 3px 4px;
  }

  .cafe-card span {
    font-size: 12px;
    line-height: 1.2;
    margin: 0 3px 5px;
  }
}


@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}


@media (min-width: 900px) {
  .booking-logo {
    height: 80px;
    margin: 14px auto 10px;
  }
}

@media (max-width: 600px) {
  .booking-stage {
    padding: 20px 16px 100px;
  }

  .booking-logo {
    width: 65px;
    height: auto;
    margin: 0 auto 10px;
  }

  .booking-title {
    font-size: 26px;
    margin: 8px 0 18px;
  }

  .booking-cafes {
    gap: 10px;
  }

  .booking-cafes .booking-card {
    height: auto;
    min-height: 0;
    padding: 8px;
    border-radius: 16px;
  }

  .booking-cafes .booking-card img {
    height: 105px;
    border-radius: 12px;
    margin-bottom: 8px;
  }

  .booking-cafes .booking-card h4 {
    font-size: 17px;
    line-height: 1.15;
    margin: 0 3px 5px;
  }

  .booking-cafes .booking-card p {
    font-size: 13px;
    line-height: 1.2;
    margin: 0 3px 5px;
  }
}

@media (min-width: 900px) {
  .booking-cafes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .booking-card img {
    height: 150px;
  }
}

@media (min-width: 1200px) {
  .booking-cafes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .booking-time {
    grid-template-columns: repeat(6, 1fr);
  }
}