@tailwind base;
@tailwind components;
@tailwind utilities;

@layer components {
  .link {
    /* underline text-blue-500 hover:text-blue-800 */
    @apply underline text-blue-500 hover:text-blue-800;
  }

  .tag {
    @apply inline-flex items-center px-2 text-xs font-medium py-0.5 rounded lg:rounded-full;
  }

  .btn-primary {
    @apply shadow-xl text-center inline-flex justify-center items-center gap-2 rounded-lg bg-indigo-600 p-4 text-base font-semibold text-white hover:bg-indigo-700 focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 active:text-white/70 transition-colors;
  }

  /* BGG-style rating colors */
  .bgg-rating-box {
    @apply inline-block px-3 py-2 rounded text-white font-bold text-center min-w-[4rem];
  }

  .has-rating-0 {
    background-color: #666e75 !important;
  }

  .has-rating-1,
  .has-rating-2 {
    background-color: #b2151f !important;
  }

  .has-rating-3,
  .has-rating-4 {
    background-color: #d71925 !important;
  }

  .has-rating-5,
  .has-rating-6 {
    background-color: #5369a2 !important;
  }

  .has-rating-7 {
    background-color: #1978b3 !important;
  }

  .has-rating-8 {
    background-color: #1d804c !important;
  }

  .has-rating-9,
  .has-rating-10 {
    background-color: #186b40 !important;
  }

  /* BGG-style weight colors */
  .bgg-weight-box {
    @apply inline-block px-3 py-2 rounded font-bold text-center min-w-[4rem];
  }

  .gameplay-weight-light {
    background-color: #19693f !important;
    color: white !important;
  }

  .gameplay-weight-medium {
    background-color: #b33900 !important;
    color: white !important;
  }

  .gameplay-weight-heavy {
    background-color: #ac141e !important;
    color: white !important;
  }
}

/* Baukasten fuer das neue Design ("Regelheft"), nutzbar in ERB und Slim.
   Groessere Bausteine sind ViewComponents unter app/components. */
@layer components {
  .ui-container {
    @apply mx-auto w-full max-w-[1240px] px-6;
  }

  .ui-page {
    @apply mx-auto w-full max-w-[1240px] px-6 pb-20 pt-14;
  }

  .ui-card {
    @apply rounded-[18px] border-2 border-ink bg-white p-6 shadow-hard;
  }

  .ui-btn {
    @apply inline-flex min-h-[48px] cursor-pointer items-center justify-center gap-2 rounded-xl border-2 border-ink px-5 font-bold transition-colors;
  }
  .ui-btn-primary {
    @apply ui-btn bg-ink text-paper hover:bg-petrol hover:border-petrol;
  }
  .ui-btn-secondary {
    @apply ui-btn bg-white text-ink hover:bg-paper;
  }
  .ui-btn-accent {
    @apply ui-btn bg-mustard text-ink shadow-hard-sm hover:-translate-y-0.5;
  }

  .ui-label {
    @apply block text-[15px] font-bold text-ink;
  }
  .ui-hint {
    @apply mt-1 text-sm text-muted;
  }
  .ui-input {
    @apply mt-1.5 block w-full rounded-xl border-2 border-ink bg-white px-3.5 py-2.5 text-ink placeholder:text-[#9A8F80] focus:border-petrol focus:ring-2 focus:ring-petrol/30;
  }

  .ui-notice {
    @apply rounded-xl border-2 border-ink bg-white px-4 py-3 text-[15px];
  }
  .ui-notice-info {
    @apply ui-notice bg-[#FBEFD1];
  }
  .ui-notice-error {
    @apply ui-notice border-coral bg-[#FBE3DC];
  }

  .ui-segmented {
    @apply inline-flex gap-1 rounded-full border-2 border-ink bg-white p-1;
  }
  .ui-segment {
    @apply inline-flex min-h-[40px] items-center rounded-full px-4 text-[15px] font-bold text-ink hover:bg-paper;
  }
  .ui-segment-active {
    @apply ui-segment bg-ink text-paper hover:bg-ink;
  }

  .ui-table {
    @apply w-full border-collapse text-left text-[15px];
  }
  .ui-table th {
    @apply border-b-2 border-ink px-3 py-3 text-xs font-extrabold uppercase tracking-[0.1em] text-muted;
  }
  .ui-table td {
    @apply border-b border-line px-3 py-2.5 align-middle;
  }
  .ui-table tbody tr:hover td {
    @apply bg-paper;
  }
}

/* Sprungmarken (/#faq usw.) nicht unter dem klebenden Header verstecken */
@layer base {
  section[id] {
    scroll-margin-top: 7rem;
  }
}

/* Brettkampf-Spieleseiten (podcast/game_pages, podcast/game_categories), Stil der Video-Einblendungen */
@layer components {
  /* Seitenrahmen aller Brettkampf-Seiten, gleiche Breite wie Header und Footer */
  .bk-page {
    @apply mx-auto max-w-5xl px-4 sm:px-6 lg:px-8;
  }

  .bk-card {
    @apply rounded-[22px] border-4 border-bk-ink bg-white shadow-bk-lg;
  }

  .bk-card-sm {
    @apply rounded-2xl border-[3px] border-bk-ink bg-white shadow-bk;
  }

  .bk-h1 {
    @apply font-signika text-4xl font-bold leading-none text-bk-orange-deep sm:text-5xl;
  }

  .bk-h2 {
    @apply font-signika text-[28px] font-bold leading-tight text-bk-orange-deep;
  }

  .bk-h3 {
    @apply font-signika text-lg font-bold;
  }

  .bk-chip {
    @apply inline-flex items-center gap-1 rounded-lg border-2 border-bk-ink bg-white px-2.5 py-0.5 text-[13px] font-extrabold text-bk-ink;
  }

  .bk-btn {
    @apply inline-flex items-center gap-2 rounded-xl border-[3px] border-bk-ink bg-white px-4 py-2.5 font-extrabold text-bk-ink shadow-bk-sm transition-transform hover:-translate-x-px hover:-translate-y-px;
  }

  .bk-btn-primary {
    @apply bk-btn bg-bk-orange;
  }

  .bk-row {
    @apply flex items-baseline justify-between gap-4 border-t-2 border-bk-line py-1.5;
  }

  .bk-label {
    @apply text-sm font-bold text-bk-muted;
  }

  .bk-badge {
    @apply inline-block rounded-[10px] border-[3px] border-bk-ink px-2.5 font-signika text-xl font-bold;
  }

  .bk-segment {
    @apply h-4 flex-1 rounded border-[2.5px] border-bk-ink;
  }

  /* Redaktion (podcast/admin) */
  .bk-input {
    @apply block w-full rounded-xl border-[3px] border-bk-ink bg-white px-3 py-2 text-[15px] focus:border-bk-blue-deep focus:ring-0 disabled:bg-bk-line disabled:text-bk-muted;
  }

  .bk-field {
    @apply flex flex-col gap-1;
  }

  .bk-hint {
    @apply text-xs font-bold text-bk-muted;
  }

  .bk-table {
    @apply w-full border-collapse text-left text-sm;
  }

  .bk-table th {
    @apply border-b-[3px] border-bk-ink px-3 py-2 font-extrabold;
  }

  .bk-table td {
    @apply border-b-2 border-bk-line px-3 py-2 align-middle;
  }
}
