/*
 * HuddlePick theme: Logo 2a with palette K "Sorbet Nacht" (dark).
 * Fonts are self-hosted, so the browser never contacts Google (GDPR).
 * Paths assume styles/ and fonts/ sit side by side.
 * Load this stylesheet in the public frontend only, not in EasyAdmin.
 */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/figtree-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/fredoka-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  --hp-bg: #1F1A2E;
  --hp-surface: #2A2440;
  --hp-surface-2: #3B3456;
  --hp-border: #3B3456;
  --hp-border-strong: #7C71A1;   /* inputs, empty stars: at least 3:1 against bg and surface */

  --hp-text: #F5F0FF;
  --hp-text-muted: #B8AED0;
  --hp-text-disabled: #9088AC;

  --hp-primary: #C4B1FF;
  --hp-primary-hover: #D2C4FF;
  --hp-primary-active: #B39EFF;
  --hp-on-primary: #1F1A2E;

  --hp-accent: #FFC3A8;
  --hp-on-accent: #1F1A2E;

  --hp-success: #9BE5C3;
  --hp-warning: #FFE08A;
  --hp-danger: #FF9FB2;
  --hp-info: #A9D2FF;
  --hp-on-status: #1F1A2E;

  --hp-focus: #C4B1FF;

  --hp-font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hp-font-heading: "Fredoka", "Figtree", system-ui, sans-serif;

  --hp-radius-sm: 8px;
  --hp-radius: 12px;
  --hp-radius-lg: 20px;
  --hp-radius-pill: 999px;
  --hp-shadow: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 12px 32px rgb(0 0 0 / 0.28);
  --hp-container: 1080px;

  --hp-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.8l2.7 5.6 6.1.8-4.5 4.2 1.1 6.1L12 16.6l-5.4 2.9 1.1-6.1-4.5-4.2 6.1-.8z' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E");
  --hp-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23B8AED0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--hp-bg);
  color: var(--hp-text);
  font-family: var(--hp-font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  font-family: var(--hp-font-heading);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.6rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

a {
  color: var(--hp-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--hp-primary-hover); }

small, .hp-muted { color: var(--hp-text-muted); }

hr { margin: 24px 0; border: 0; border-top: 1px solid var(--hp-border); }

img { max-width: 100%; height: auto; }

::selection { background: var(--hp-primary); color: var(--hp-on-primary); }

:focus-visible { outline: 3px solid var(--hp-focus); outline-offset: 2px; }

/* ---------- Layout ---------- */
.hp-container { width: min(100% - 32px, var(--hp-container)); margin-inline: auto; }

.hp-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--hp-border);
  background: rgb(31 26 46 / 0.92);
  backdrop-filter: blur(8px);
}
.hp-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  min-height: 68px;
  padding-block: 12px;
}
.hp-logo { display: inline-flex; align-items: center; margin-right: auto; }
.hp-logo img { display: block; width: auto; height: 34px; }

.hp-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
@media (max-width: 600px) {
  .hp-header__inner { column-gap: 12px; }
  .hp-logo img { height: 28px; }
  .hp-nav { order: 3; flex-basis: 100%; }
}
.hp-nav a:not(.hp-btn) { color: var(--hp-text-muted); font-weight: 600; text-decoration: none; }
.hp-nav a:not(.hp-btn):hover, .hp-nav a[aria-current="page"] { color: var(--hp-text); }

.hp-main { padding-block: 32px 64px; }

.hp-stack { display: flex; flex-direction: column; gap: 16px; }
.hp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 24px; align-items: start; }

.hp-footer { padding-block: 24px; border-top: 1px solid var(--hp-border); color: var(--hp-text-muted); font-size: 0.875rem; }

/* ---------- Buttons ---------- */
button,
.hp-btn,
input[type="submit"],
input[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--hp-radius);
  background: var(--hp-primary);
  color: var(--hp-on-primary);
  font: 700 1rem/1 var(--hp-font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
button:hover, .hp-btn:hover, input[type="submit"]:hover, input[type="button"]:hover {
  background: var(--hp-primary-hover);
  color: var(--hp-on-primary);
}
button:active, .hp-btn:active, input[type="submit"]:active, input[type="button"]:active {
  background: var(--hp-primary-active);
}

.hp-btn--secondary,
.hp-btn--secondary:hover {
  border-color: var(--hp-border-strong);
  background: transparent;
  color: var(--hp-text);
}
.hp-btn--secondary:hover { background: var(--hp-surface-2); }

.hp-btn--accent, .hp-btn--accent:hover { background: var(--hp-accent); color: var(--hp-on-accent); }
.hp-btn--danger, .hp-btn--danger:hover { background: var(--hp-danger); color: var(--hp-on-status); }
.hp-btn--block { width: 100%; }

button:disabled,
.hp-btn[aria-disabled="true"],
input[type="submit"]:disabled {
  border-color: transparent;
  background: var(--hp-surface-2);
  color: var(--hp-text-disabled);
  cursor: not-allowed;
}

/* ---------- Forms ---------- */
label { display: block; margin-bottom: 6px; font-weight: 600; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--hp-border-strong);
  border-radius: var(--hp-radius-sm);
  background-color: var(--hp-bg);
  color: var(--hp-text);
  font: inherit;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--hp-primary);
  outline: 3px solid var(--hp-focus);
  outline-offset: 1px;
}
input::placeholder, textarea::placeholder { color: var(--hp-text-muted); opacity: 1; }
textarea { min-height: 120px; resize: vertical; }

select {
  appearance: none;
  padding-right: 42px;
  background-image: var(--hp-chevron);
  background-position: right 14px center;
  background-repeat: no-repeat;
  background-size: 16px;
}

input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--hp-primary); }

input[type="file"] { max-width: 100%; color: var(--hp-text-muted); font: inherit; }
input[type="file"]::file-selector-button {
  min-height: 40px;
  margin-right: 12px;
  padding: 0 16px;
  border: 1px solid var(--hp-border-strong);
  border-radius: var(--hp-radius-sm);
  background: var(--hp-surface-2);
  color: var(--hp-text);
  font: 600 0.95rem var(--hp-font-body);
  cursor: pointer;
}

/* Checkbox or radio with its text on one line, e.g. filters: <label class="hp-check"><input type="checkbox"> vegan</label> */
.hp-check { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; cursor: pointer; }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 6px; font-weight: 600; }

.hp-field { margin-bottom: 16px; }
.hp-help { margin-top: 6px; color: var(--hp-text-muted); font-size: 0.875rem; }
.hp-form-error { margin: 6px 0 0; padding: 0; list-style: none; color: var(--hp-danger); font-size: 0.875rem; font-weight: 600; }
[aria-invalid="true"] { border-color: var(--hp-danger); }

/* ---------- Cards ---------- */
.hp-card {
  padding: 24px;
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius-lg);
  background: var(--hp-surface);
  box-shadow: var(--hp-shadow);
}
.hp-card > :last-child { margin-bottom: 0; }
.hp-card__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.hp-card__header > * { margin: 0; }

/* ---------- Poll results ---------- */
.hp-results { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.hp-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--hp-radius);
  background: var(--hp-bg);
  color: var(--hp-text);
}
.hp-result__rank {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--hp-surface-2);
  font-size: 0.875rem;
  font-weight: 700;
}
.hp-result__name { flex: 1; min-width: 0; font-weight: 600; }
.hp-result__points { color: var(--hp-text-muted); font-weight: 600; white-space: nowrap; }

.hp-result--winner { background: var(--hp-accent); color: var(--hp-on-accent); }
.hp-result--winner .hp-result__rank { background: var(--hp-on-accent); color: var(--hp-accent); }
.hp-result--winner .hp-result__name { font-weight: 700; }
.hp-result--winner .hp-result__points { color: var(--hp-on-accent); }

.hp-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--hp-radius-pill);
  background: var(--hp-surface-2);
  color: var(--hp-text);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
}
.hp-chip--match { background: var(--hp-accent); color: var(--hp-on-accent); }
.hp-result--winner .hp-chip { background: var(--hp-on-accent); color: var(--hp-accent); }

/* ---------- Badges ---------- */
.hp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--hp-radius-pill);
  background: var(--hp-surface-2);
  color: var(--hp-text);
  font-size: 0.8125rem;
  font-weight: 600;
}
.hp-badge--open { background: rgb(155 229 195 / 0.16); color: var(--hp-success); }
.hp-badge--closed { color: var(--hp-text-muted); }

/* ---------- Stars ---------- */
/* Display: <span class="hp-stars" style="--value: 3.5" role="img" aria-label="3,5 von 5 Sternen"></span> */
.hp-stars {
  --size: 20px;
  --value: 0;
  display: inline-block;
  width: calc(var(--size) * 5);
  height: var(--size);
  vertical-align: middle;
  background: linear-gradient(90deg, var(--hp-accent) calc(var(--value) * 20%), var(--hp-border-strong) 0);
  -webkit-mask: var(--hp-star) left / var(--size) var(--size) repeat-x;
  mask: var(--hp-star) left / var(--size) var(--size) repeat-x;
}

/* Input: radios in the order 5 to 1, see preview/preview.html */
.hp-rating { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hp-rating__stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.hp-rating__stars input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.hp-rating__stars label {
  position: relative;
  width: 34px;
  height: 34px;
  margin: 0;
  border-radius: 6px;
  cursor: pointer;
}
.hp-rating__stars label::before {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--hp-border-strong);
  -webkit-mask: var(--hp-star) center / contain no-repeat;
  mask: var(--hp-star) center / contain no-repeat;
  transition: background-color 0.1s ease;
}
.hp-rating__stars input:checked ~ label::before,
.hp-rating__stars label:hover::before,
.hp-rating__stars label:hover ~ label::before { background: var(--hp-accent); }
.hp-rating__stars input:focus-visible + label { outline: 3px solid var(--hp-focus); outline-offset: 1px; }

/* ---------- Alerts (flash messages) ---------- */
.hp-alert {
  padding: 12px 16px;
  border: 1px solid var(--hp-border-strong);
  border-radius: var(--hp-radius);
  background: var(--hp-surface);
  color: var(--hp-text);
  font-weight: 600;
}
.hp-alert--success { border-color: rgb(155 229 195 / 0.45); background: rgb(155 229 195 / 0.1); color: var(--hp-success); }
.hp-alert--warning { border-color: rgb(255 224 138 / 0.45); background: rgb(255 224 138 / 0.1); color: var(--hp-warning); }
.hp-alert--danger  { border-color: rgb(255 159 178 / 0.45); background: rgb(255 159 178 / 0.1); color: var(--hp-danger); }
.hp-alert--info    { border-color: rgb(169 210 255 / 0.45); background: rgb(169 210 255 / 0.1); color: var(--hp-info); }

/* ---------- Place images ---------- */
/* Placeholder when a place has no photo: <div class="hp-initial hp-initial--2" aria-hidden="true">P</div> */
.hp-initial {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: var(--hp-radius);
  background: var(--hp-primary);
  color: var(--hp-bg);
  font-family: var(--hp-font-heading);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
}
.hp-initial--2 { background: var(--hp-accent); }
.hp-initial--3 { background: var(--hp-success); }
.hp-initial--4 { background: var(--hp-info); }
.hp-initial--5 { background: var(--hp-warning); }

/* Photo credit, e.g. for Google photos */
.hp-credit { margin-top: 4px; color: var(--hp-text-muted); font-size: 0.75rem; }

/* ---------- Sharing ---------- */
/* QR codes stay dark on white so every phone camera reads them */
.hp-qr { display: inline-block; padding: 16px; border-radius: var(--hp-radius); background: #FFFFFF; line-height: 0; }
.hp-qr img, .hp-qr svg, .hp-qr canvas { display: block; max-width: 100%; height: auto; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid var(--hp-border); text-align: left; }
th { color: var(--hp-text-muted); font-size: 0.875rem; font-weight: 600; }
.hp-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Utilities ---------- */
.hp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
