/* ============================================================
   GSJ Bingo — editorial poster aesthetic
   Cream + ink + rotating accent palette
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300..900&family=Manrope:wght@400..800&display=swap');

:root {
  /* Surfaces */
  --bg:        #F2EBDC;
  --bg-soft:   #ECE3D0;
  --paper:    #FAF6EC;
  --ink:       #1A1814;
  --ink-soft:  #4B463D;
  --rule:      #2A251D;
  --hairline:  rgba(26,24,20,.18);

  /* The 10 category accent colors, in order. */
  --c1:  #E5573C;   /* Soziales — coral */
  --c2:  #D9456E;   /* Offenes Herz — rose */
  --c3:  #E8B339;   /* Kreativität — mustard */
  --c4:  #4DAA45;   /* Komfortzone — green */
  --c5:  #4775B0;   /* Ordnung — blue */
  --c6:  #2E6E4E;   /* Outdoor — forest */
  --c7:  #E07432;   /* Sport — orange */
  --c8:  #7A5DC9;   /* Mindset — violet */
  --c9:  #2A8C97;   /* Reisen — teal */
  --c10: #B8893E;   /* Abschluss — gold */

  /* Bonus achievements get their own muted gold accent. */
  --bonus: #1A1814;

  --radius:   2px;
  --radius-lg: 6px;
  --shadow:   0 1px 0 var(--rule), 4px 4px 0 var(--rule);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  /* Grain overlay for paper feel */
  background-image:
    radial-gradient(rgba(26,24,20,.025) 1px, transparent 1px),
    radial-gradient(rgba(26,24,20,.018) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 2px;
}

a { color: inherit; }
button { font-family: inherit; }

/* ---------- Auth pages (login / register) ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
}
@media (min-width: 880px) {
  .auth-shell { grid-template-columns: 1.15fr 1fr; }
}

.auth-poster {
  background: var(--ink);
  color: var(--paper);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-poster::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(229,87,60,.35), transparent 50%),
    radial-gradient(circle at 90% 20%, rgba(232,179,57,.28), transparent 55%);
  pointer-events: none;
}
.auth-poster > * { position: relative; }

.poster-eyebrow {
  font-family: 'Manrope';
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  opacity: .75;
}
.poster-title {
  font-family: 'Fraunces';
  font-variation-settings: 'opsz' 144, 'wght' 700;
  font-size: clamp(48px, 8vw, 96px);
  line-height: .92;
  letter-spacing: -.02em;
  margin: 24px 0 0;
}
.poster-title em {
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'wght' 400;
  color: var(--c3);
}
.poster-tag {
  font-family: 'Fraunces';
  font-size: 18px;
  font-style: italic;
  opacity: .8;
  margin-top: 24px;
  max-width: 32ch;
}
.poster-meta {
  font-size: 12px;
  letter-spacing: .15em;
  text-transform: uppercase;
  opacity: .55;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(250,246,236,.2);
  padding-top: 16px;
}

.auth-form-wrap {
  padding: 48px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-form {
  width: 100%;
  max-width: 380px;
}
.auth-form h2 {
  font-family: 'Fraunces';
  font-variation-settings: 'opsz' 48, 'wght' 600;
  font-size: 36px;
  margin: 0 0 4px;
  letter-spacing: -.01em;
}
.auth-form p.lead {
  margin: 0 0 32px;
  color: var(--ink-soft);
  font-size: 15px;
}

.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink-soft);
}
.field input {
  width: 100%;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: box-shadow .15s, transform .15s;
}
.field input:focus {
  box-shadow: 3px 3px 0 var(--ink);
  transform: translate(-1px, -1px);
}

.btn {
  display: inline-block;
  appearance: none;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .04em;
  padding: 13px 22px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  text-decoration: none;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(0, 0); box-shadow: none; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
}

.alt-link {
  margin-top: 22px;
  font-size: 14px;
  color: var(--ink-soft);
}
.alt-link a { color: var(--ink); font-weight: 700; }

.error-msg {
  background: var(--c1);
  color: var(--paper);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 18px;
  display: none;
}
.error-msg.show { display: block; }

/* ---------- Bingo page ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1.5px solid var(--rule);
}
.app-header::after {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg,
    var(--c1) 0 10%, var(--c2) 10% 20%, var(--c3) 20% 30%,
    var(--c4) 30% 40%, var(--c5) 40% 50%, var(--c6) 50% 60%,
    var(--c7) 60% 70%, var(--c8) 70% 80%, var(--c9) 80% 90%,
    var(--c10) 90% 100%);
}
.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.brand {
  font-family: 'Fraunces';
  font-variation-settings: 'opsz' 144, 'wght' 700;
  font-size: 22px;
  letter-spacing: -.01em;
}
.brand em {
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'wght' 400;
  color: var(--c1);
}

.score-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 22px;
  border-radius: 999px;
  font-family: 'Fraunces';
  font-variation-settings: 'opsz' 48, 'wght' 600;
}
.score-pill .label {
  font-family: 'Manrope';
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  opacity: .7;
}
.score-pill .value {
  font-size: 28px;
  line-height: 1;
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.score-pill .value.bump { transform: scale(1.25); }

.header-end {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--ink-soft);
}
.header-end strong { color: var(--ink); font-weight: 700; }
.logout-btn {
  background: none;
  border: 1.5px solid var(--rule);
  color: var(--ink);
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.logout-btn:hover { background: var(--ink); color: var(--paper); }

.score-detail {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px 0;
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.score-detail span strong { color: var(--ink); font-weight: 700; }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* --- Bonus achievements section --- */
.bonus-section { margin-bottom: 56px; }
.section-head {
  display: flex;
  align-items: end;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--rule);
}
.section-head .num {
  font-family: 'Fraunces';
  font-variation-settings: 'opsz' 144, 'wght' 300;
  font-style: italic;
  font-size: 56px;
  line-height: 1;
  color: var(--ink-soft);
}
.section-head h2 {
  font-family: 'Fraunces';
  font-variation-settings: 'opsz' 144, 'wght' 700;
  font-size: 38px;
  margin: 0;
  line-height: 1;
  letter-spacing: -.01em;
  flex: 1;
}
.section-head .meta {
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
}

.bonus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.bonus-card {
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: transform .15s, box-shadow .15s;
}
.bonus-card.claimed {
  background: var(--ink);
  color: var(--paper);
  transform: rotate(-.5deg);
  box-shadow: 4px 4px 0 var(--c3);
}
.bonus-card.claimed .bonus-title { color: var(--c3); }
.bonus-card.claimed .bonus-desc { color: var(--paper); opacity: .8; }

.bonus-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}
.bonus-title {
  font-family: 'Fraunces';
  font-variation-settings: 'opsz' 48, 'wght' 700;
  font-size: 20px;
  margin: 0;
  line-height: 1.15;
  letter-spacing: -.01em;
}
.bonus-points {
  background: var(--c3);
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  white-space: nowrap;
  border: 1.5px solid var(--ink);
}
.bonus-desc {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.45;
}
.bonus-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.slot {
  width: 22px;
  height: 22px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  color: inherit;
  transition: background .15s, transform .1s;
}
.slot:hover { transform: scale(1.1); }
.slot.filled {
  background: var(--c3);
  color: var(--ink);
  border-color: var(--ink);
}
.bonus-card.claimed .slot.filled {
  background: var(--c3);
  color: var(--ink);
}
.slot-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .65;
}

/* --- Category sections --- */
.categories { display: flex; flex-direction: column; gap: 56px; }
.category {
  --accent: var(--c1);
}
.category[data-color="1"]  { --accent: var(--c1); }
.category[data-color="2"]  { --accent: var(--c2); }
.category[data-color="3"]  { --accent: var(--c3); }
.category[data-color="4"]  { --accent: var(--c4); }
.category[data-color="5"]  { --accent: var(--c5); }
.category[data-color="6"]  { --accent: var(--c6); }
.category[data-color="7"]  { --accent: var(--c7); }
.category[data-color="8"]  { --accent: var(--c8); }
.category[data-color="9"]  { --accent: var(--c9); }
.category[data-color="10"] { --accent: var(--c10); }

.category-head {
  display: flex;
  align-items: end;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--rule);
  position: relative;
}
.category-head::before {
  content: '';
  position: absolute;
  bottom: -1.5px;
  left: 0;
  width: 80px;
  height: 4px;
  background: var(--accent);
}
.category-head .num {
  font-family: 'Fraunces';
  font-variation-settings: 'opsz' 144, 'wght' 300;
  font-style: italic;
  font-size: 56px;
  line-height: 1;
  color: var(--accent);
}
.category-head h2 {
  font-family: 'Fraunces';
  font-variation-settings: 'opsz' 144, 'wght' 700;
  font-size: clamp(28px, 4vw, 38px);
  margin: 0;
  line-height: 1;
  letter-spacing: -.01em;
  flex: 1;
}
.category-head .progress {
  font-family: 'Manrope';
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink-soft);
}
.category-head .extra {
  background: var(--accent);
  color: var(--paper);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1.5px solid var(--ink);
}
.category.all-done .category-head .extra {
  background: var(--ink);
  color: var(--c3);
}

.tasks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.task {
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 14px 16px 14px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .15s;
  position: relative;
  user-select: none;
}
.task:hover {
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--accent);
}
.task .check {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--rule);
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  margin-top: 1px;
  transition: background .15s;
}
.task .check svg {
  opacity: 0;
  transform: scale(.4) rotate(-15deg);
  transition: opacity .2s, transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.task.done {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--ink);
}
.task.done .check {
  background: var(--ink);
  border-color: var(--ink);
}
.task.done .check svg {
  opacity: 1;
  transform: scale(1) rotate(0);
}
.task.done .task-text {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  opacity: .85;
}
.task-num {
  font-family: 'Fraunces';
  font-variation-settings: 'opsz' 14, 'wght' 600;
  font-size: 12px;
  letter-spacing: .04em;
  opacity: .5;
  display: block;
  margin-bottom: 2px;
}
.task-text {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
}

.loading {
  text-align: center;
  padding: 120px 20px;
  font-family: 'Fraunces';
  font-style: italic;
  font-size: 24px;
  color: var(--ink-soft);
}

/* Responsive nudges */
@media (max-width: 720px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }
  .header-end { display: none; }
  .score-pill { padding: 8px 16px; }
  .score-pill .value { font-size: 22px; }
  .container { padding: 24px 16px 60px; }
  .section-head .num, .category-head .num { font-size: 36px; }
  .section-head h2 { font-size: 26px; }
  .header-end {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
  }

  .header-end span { 
    display: none; /* Hide the welcome text */
  }

  .logout-btn {
    background: var(--ink); /* Make it more visible as a floating button */
    color: var(--paper);
    padding: 12px 20px;
    border-radius: 50px; /* Rounded pill shape */
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    font-size: 14px;
    border: none;
  }
}
