:root {
  --bg: #070d19;
  --surface: #131d2e;
  --border: #223249;
  --text: #f8fafc;
  --muted: #94a3b8;
  --kuhlo-accent: #f59e0b;
  --hr-accent: #4ade80;
  --hr-gold: #d4a24c;
  --planned-accent: #64748b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at top, #101e36 0%, var(--bg) 72%);
  color: var(--text);
  display: flex;
  justify-content: center;
  padding: 2rem 1.5rem 2.5rem;
}

.portal-shell {
  width: 100%;
  max-width: 1220px;
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
}

.portal-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fde68a;
}

.portal-header h1 {
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(90deg, #fff 0%, #fde68a 52%, #d4a24c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.portal-header p {
  color: var(--muted);
  font-size: 1rem;
  max-width: 680px;
}

/* Sektionen (Posaunenchor vs. Jagd- & Naturhörner) */
.portal-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.section-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.section-icon {
  font-size: 1.35rem;
}

.section-title-row h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-pill {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.pill-klingend-c {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.38);
  color: #fde68a;
}

.pill-jagd {
  background: rgba(74, 222, 128, 0.11);
  border-color: rgba(212, 162, 76, 0.42);
  color: #fde68a;
}

.section-desc {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Grid-Layouts */
.portal-grid {
  display: grid;
  gap: 1.15rem;
}

.portal-grid.grid-1 {
  grid-template-columns: minmax(0, 620px);
  justify-content: center;
}

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

.portal-grid.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1024px) {
  .portal-grid.grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .portal-grid.grid-1,
  .portal-grid.grid-2,
  .portal-grid.grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Kachel-Basis */
.app-tile {
  --tile-bg: var(--surface);
  text-decoration: none;
  color: inherit;
  background: var(--tile-bg);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.app-tile.is-active:hover,
.app-tile.is-active:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.app-tile.is-planned {
  --tile-bg: #111a2a;
  border-style: dashed;
  border-color: rgba(100, 116, 139, 0.42);
  background: linear-gradient(180deg, rgba(19, 29, 46, 0.82) 0%, rgba(11, 18, 30, 0.92) 100%);
}

.tile-kuhlo:hover,
.tile-kuhlo:focus-visible,
.tile-duett:hover,
.tile-duett:focus-visible {
  border-color: var(--kuhlo-accent);
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.16);
}

.tile-hubertusruf {
  --tile-bg: #152018;
  background: linear-gradient(180deg, #152018 0%, #101714 100%);
  border-color: #28402e;
}

.tile-hubertusruf:hover,
.tile-hubertusruf:focus-visible {
  border-color: var(--hr-gold);
  box-shadow: 0 10px 28px rgba(212, 162, 76, 0.18);
}

/* Bild-Banner für aktive Apps */
.tile-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 8.5;
  overflow: hidden;
  background: #0b111c;
  flex-shrink: 0;
}

.tile-media img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.35s ease;
}

.tile-media-duett {
  background: radial-gradient(circle at 22% 25%, rgba(245, 158, 11, 0.22) 0%, rgba(16, 30, 54, 0.94) 55%, #080e1a 100%);
}

.duett-fallback-art {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: #fde68a;
  pointer-events: none;
}

.duett-fallback-icons {
  font-size: 2.35rem;
  filter: drop-shadow(0 6px 18px rgba(245, 158, 11, 0.25));
}

.duett-fallback-clefs {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #cbd5e1;
}

.tile-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(7, 13, 25, 0.15) 0%, transparent 45%, var(--tile-bg) 100%);
}

.app-tile.is-active:hover .tile-media img,
.app-tile.is-active:focus-visible .tile-media img {
  transform: scale(1.04);
}

/* Kompakte Header-Banner für geplante Ausbaustufen */
.tile-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.banner-brass {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(19, 29, 46, 0.4) 100%);
}

.banner-lowbrass {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16) 0%, rgba(19, 29, 46, 0.4) 100%);
}

.banner-tuba {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.16) 0%, rgba(19, 29, 46, 0.4) 100%);
}

.banner-hunt {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.16) 0%, rgba(21, 32, 24, 0.5) 100%);
}

.banner-hunt-valve {
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.18) 0%, rgba(21, 32, 24, 0.5) 100%);
}

.banner-icon {
  font-size: 1.65rem;
  line-height: 1;
  font-weight: 700;
  color: #e2e8f0;
}

.banner-tuba .banner-icon {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.55rem;
  border-radius: 8px;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #e9d5ff;
}

.banner-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

/* Status- & Routen-Badges */
.tile-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  z-index: 2;
}

.tile-media .tile-status-badge {
  position: absolute;
  top: 0.7rem;
  left: 0.75rem;
}

.tile-media .tile-route-chip {
  position: absolute;
  top: 0.7rem;
  right: 0.75rem;
  z-index: 2;
}

.status-live {
  background: rgba(16, 185, 129, 0.9);
  color: #042f2e;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}

.status-planned {
  background: rgba(51, 65, 85, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
}

.tile-media .status-planned {
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(148, 163, 184, 0.38);
  color: #e2e8f0;
  backdrop-filter: blur(4px);
}

.tile-route-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.52rem;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.7rem;
  background: rgba(7, 13, 25, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #cbd5e1;
  backdrop-filter: blur(4px);
}

/* Kachel-Inhalt */
.tile-body {
  padding: 1.15rem 1.35rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

.tile-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.app-tile h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
}

.clef-badge {
  flex-shrink: 0;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.18rem 0.52rem;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  white-space: nowrap;
}

.clef-bass {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.35);
  color: #bae6fd;
}

.clef-hunt {
  background: rgba(212, 162, 76, 0.15);
  border-color: rgba(212, 162, 76, 0.38);
  color: #fde68a;
}

.tile-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
}

.tile-tags {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.36rem;
  margin-top: 0.2rem;
  color: #cbd5e1;
  font-size: 0.85rem;
  line-height: 1.38;
}

.tile-tags li {
  position: relative;
  padding-left: 0.85rem;
}

.tile-tags li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--muted);
}

.tile-tags code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.7);
  color: #fde68a;
}

.tile-media-link,
.tile-title-link {
  color: inherit;
  text-decoration: none;
}

.tile-title-link:hover {
  text-decoration: underline;
}

/* Aktions-Buttons */
.tile-actions {
  margin-top: auto;
  padding-top: 0.8rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.6rem;
}

.tile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  text-align: center;
  white-space: nowrap;
}

.tile-btn:hover,
.tile-btn:focus-visible {
  outline: none;
  transform: translateY(-1px);
}

.tile-kuhlo .tile-btn-desktop,
.tile-duett .tile-btn-desktop {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.14);
  color: #fde68a;
}

.tile-kuhlo .tile-btn-desktop:hover,
.tile-kuhlo .tile-btn-desktop:focus-visible,
.tile-duett .tile-btn-desktop:hover,
.tile-duett .tile-btn-desktop:focus-visible {
  border-color: var(--kuhlo-accent);
  background: rgba(245, 158, 11, 0.24);
}

.tile-kuhlo .tile-btn-mobile {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.13);
  color: #bae6fd;
}

.tile-kuhlo .tile-btn-mobile:hover,
.tile-kuhlo .tile-btn-mobile:focus-visible {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.24);
}

.tile-hubertusruf .tile-btn-desktop {
  border-color: rgba(212, 162, 76, 0.48);
  background: rgba(212, 162, 76, 0.15);
  color: #fde68a;
}

.tile-hubertusruf .tile-btn-desktop:hover,
.tile-hubertusruf .tile-btn-desktop:focus-visible {
  border-color: var(--hr-gold);
  background: rgba(212, 162, 76, 0.26);
}

.tile-btn-disabled {
  opacity: 0.62;
  cursor: not-allowed;
  border-style: dashed;
  color: #94a3b8;
}

.tile-btn-disabled:hover {
  transform: none;
}

@media (max-width: 680px) {
  .tile-kuhlo .tile-btn-mobile {
    border-color: var(--kuhlo-accent);
    background: rgba(245, 158, 11, 0.25);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-tile,
  .tile-media img {
    transition: none;
  }

  .app-tile.is-active:hover,
  .app-tile.is-active:focus-visible,
  .app-tile.is-active:hover .tile-media img,
  .app-tile.is-active:focus-visible .tile-media img {
    transform: none;
  }
}

.portal-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.portal-footer code {
  color: #fde68a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
