/* =====================================================================
   GAME CENTER – STANDARD-FARBPALETTE
   Diese Farben sind der feste Standard des Projekts und werden
   überall verwendet. Neue Farben bitte nur als Abstufungen davon.
   ===================================================================== */
:root {
  --gc-navy:   #264653;  /* Titel, Text, dunkle Flächen            */
  --gc-teal:   #2A9D8F;  /* Sekundär-Aktionen, Lobby, Online        */
  --gc-yellow: #E9C46A;  /* Highlights, Badges                      */
  --gc-orange: #F4A261;  /* Akzente, Hover                          */
  --gc-coral:  #E76F51;  /* Primär-Aktionen (Login, Starten)        */
  --gc-bg:     #FBF7F0;  /* Seitenhintergrund (leichtes warmes Weiss) */

  /* abgeleitete Töne (aus der Palette gemischt) */
  --gc-white:       #FFFFFF;
  --gc-navy-soft:   #3B5A67;
  --gc-navy-muted:  #5F7682;
  --gc-bg-deep:     #E8DFD1;
  --gc-bg-light:    #F3EDE3;
  --gc-teal-dark:   #238276;
  --gc-coral-dark:  #D35A3C;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 6px rgba(38, 70, 83, .08);
  --shadow-md: 0 8px 24px rgba(38, 70, 83, .14);
  --shadow-lg: 0 18px 48px rgba(38, 70, 83, .22);

  --card-w: 380px;   /* Spielkarten im Querformat (16:9) */
  --card-h: 214px;

  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--gc-navy);
  background: var(--gc-bg);
  min-height: 100vh;
}
[hidden] { display: none !important; }
.muted { color: var(--gc-navy-muted); }
.tiny { font-size: 13px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gc-navy-muted); }

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 999px; cursor: pointer;
  font: 600 16px/1 var(--font);
  padding: 12px 20px;
  transition: transform .15s, background .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--gc-coral); color: var(--gc-white); box-shadow: 0 4px 12px rgba(231,111,81,.35); }
.btn-primary:hover:not(:disabled) { background: var(--gc-coral-dark); }
.btn-teal { background: var(--gc-teal); color: var(--gc-white); box-shadow: 0 4px 12px rgba(42,157,143,.3); }
.btn-teal:hover:not(:disabled) { background: var(--gc-teal-dark); }
.btn-ghost { background: var(--gc-white); color: var(--gc-navy); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--gc-bg-light); }
.btn-google { background: var(--gc-white); color: var(--gc-navy); border: 2px solid var(--gc-bg-deep); width: 100%; justify-content: center; padding: 14px; }
.btn-google:hover { border-color: var(--gc-navy-muted); }
.btn-sm { padding: 9px 14px; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; padding: 14px; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico-g { width: 20px; height: 20px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--gc-bg-light); color: var(--gc-navy); font-size: 16px;
}
.icon-btn:hover { background: var(--gc-bg-deep); }

.badge {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--gc-yellow); color: var(--gc-navy);
  font-size: 12px; font-weight: 800; display: inline-grid; place-items: center;
}
.badge-coral { background: var(--gc-coral); color: var(--gc-white); }

/* ===================== Header ===================== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 40px;
  background: rgba(251, 247, 240, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gc-bg-deep);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--gc-navy); }
.brand-mark svg { width: 40px; height: 40px; display: block; }
.brand-name { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--gc-white); border-radius: 999px; padding: 5px 14px 5px 5px;
  box-shadow: var(--shadow-sm); cursor: pointer; border: 0; font: 600 15px var(--font); color: var(--gc-navy);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  font-weight: 800; font-size: 14px; color: var(--gc-white);
}
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }

/* ===================== Hero ===================== */
.hero { padding: 48px 40px 12px; }
.hero-title {
  margin: 0; font-size: clamp(44px, 6vw, 76px); font-weight: 900; letter-spacing: -.03em; line-height: 1.02;
  color: var(--gc-navy);
}
.hero-title::after {
  content: ""; display: block; width: 120px; height: 8px; margin-top: 14px; border-radius: 8px;
  background: linear-gradient(90deg, var(--gc-teal) 0 25%, var(--gc-yellow) 25% 50%, var(--gc-orange) 50% 75%, var(--gc-coral) 75%);
}
.hero-sub { margin: 16px 0 0; font-size: 19px; color: var(--gc-navy-soft); max-width: 680px; }

/* ===================== Spielreihen ===================== */
.game-row { padding: 26px 0 8px; }
.row-head { display: flex; align-items: center; justify-content: space-between; padding: 0 40px 12px; }
.row-title { margin: 0; font-size: 26px; font-weight: 800; }
.row-nav { display: flex; gap: 8px; }
.row-nav .icon-btn { width: 44px; height: 44px; background: var(--gc-white); box-shadow: var(--shadow-sm); font-size: 20px; }
.row-nav .icon-btn:hover { background: var(--gc-navy); color: var(--gc-white); }

.row-track {
  display: flex; gap: 24px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 10px 40px 28px; scroll-padding: 0 40px;
  scrollbar-width: thin; scrollbar-color: var(--gc-bg-deep) transparent;
}
.row-track::-webkit-scrollbar { height: 8px; }
.row-track::-webkit-scrollbar-thumb { background: var(--gc-bg-deep); border-radius: 8px; }

.game-card {
  flex: none; width: var(--card-w); scroll-snap-align: start;
  background: var(--gc-white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); overflow: hidden; cursor: pointer;
  border: 0; padding: 0; text-align: left; font: inherit; color: inherit;
  transition: transform .2s ease, box-shadow .2s ease;
}
.game-card:hover, .game-card:focus-visible { transform: translateY(-6px); box-shadow: var(--shadow-lg); outline: none; }
.game-card.is-selected { box-shadow: 0 0 0 4px var(--gc-coral), var(--shadow-lg); }

.card-art { position: relative; width: 100%; height: var(--card-h); overflow: hidden; }
.card-art svg { width: 100%; height: 100%; display: block; transition: transform .35s ease; }
.game-card:hover .card-art svg { transform: scale(1.06); }

.card-tag {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: rgba(255,255,255,.92); color: var(--gc-navy);
  font-size: 13px; font-weight: 700; padding: 5px 11px; border-radius: 999px;
}

/* Hover-Overlay mit Kennziffern */
.card-overlay {
  position: absolute; inset: 0; z-index: 3;
  background: linear-gradient(180deg, rgba(38,70,83,.55) 0%, rgba(38,70,83,.94) 60%);
  color: var(--gc-white);
  display: flex; flex-direction: column; justify-content: flex-end; gap: 12px;
  padding: 18px 20px;
  opacity: 0; transition: opacity .2s ease;
}
.game-card:hover .card-overlay, .game-card:focus-visible .card-overlay { opacity: 1; }
.overlay-players { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 800; }
.overlay-players svg { width: 28px; height: 28px; stroke: var(--gc-yellow); }
.overlay-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.overlay-stat { background: rgba(255,255,255,.12); border-radius: var(--radius-sm); padding: 8px 10px; }
.overlay-stat b { display: block; font-size: 16px; }
.overlay-stat span { font-size: 12px; opacity: .8; text-transform: uppercase; letter-spacing: .05em; }

.card-body { padding: 16px 20px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { margin: 0; font-size: 22px; font-weight: 800; }
.card-meta { font-size: 14px; color: var(--gc-navy-muted); }
.card-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }

/* ===================== Lobby-Dock ===================== */
.lobby-dock {
  position: fixed; top: 86px; right: 24px; z-index: 30; width: 300px;
  background: var(--gc-white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 18px; border-top: 6px solid var(--gc-teal);
}
.lobby-dock-head { display: flex; justify-content: space-between; align-items: flex-start; }
.lobby-code { font-size: 15px; margin-top: 2px; }
.lobby-code strong { font-size: 20px; letter-spacing: .12em; color: var(--gc-teal); }
.lobby-members { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.member { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.member .host { margin-left: auto; font-size: 11px; font-weight: 800; background: var(--gc-yellow); padding: 2px 8px; border-radius: 999px; }
.lobby-game { background: var(--gc-bg-light); border-radius: var(--radius-md); padding: 10px 12px; }
.lobby-game-name { font-weight: 700; font-size: 16px; margin-top: 2px; }
.lobby-dock-actions { display: flex; flex-direction: column-reverse; gap: 8px; margin-top: 14px; }
.lobby-dock-actions .btn { flex: 1; justify-content: center; }
body.in-lobby main#homeView { padding-right: 340px; }

/* ===================== Chat ===================== */
.chat {
  position: fixed; right: 24px; bottom: 24px; z-index: 35; width: 340px;
  background: var(--gc-white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden;
}
.chat-head {
  width: 100%; border: 0; cursor: pointer; display: flex; align-items: center; gap: 10px;
  background: var(--gc-navy); color: var(--gc-white); padding: 13px 16px; font: 700 16px var(--font);
}
.chat-caret { margin-left: auto; transition: transform .2s; }
.chat.collapsed .chat-caret { transform: rotate(180deg); }
.chat.collapsed .chat-body { display: none; }
.chat-messages { height: 260px; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--gc-bg-light); }
.msg { max-width: 85%; }
.msg-name { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.msg-text { background: var(--gc-white); padding: 8px 12px; border-radius: 12px 12px 12px 4px; font-size: 15px; box-shadow: var(--shadow-sm); word-wrap: break-word; }
.msg.me { align-self: flex-end; }
.msg.me .msg-name { text-align: right; }
.msg.me .msg-text { background: var(--gc-teal); color: var(--gc-white); border-radius: 12px 12px 4px 12px; }
.msg.system { align-self: center; font-size: 13px; color: var(--gc-navy-muted); font-style: italic; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--gc-bg-deep); }
.chat-form input { flex: 1; }

/* ===================== Inputs ===================== */
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%; font: 16px var(--font); color: var(--gc-navy);
  padding: 12px 14px; border-radius: var(--radius-md);
  border: 2px solid var(--gc-bg-deep); background: var(--gc-white); outline: none;
}
input:focus { border-color: var(--gc-teal); }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
label input { margin-top: 5px; }

/* ===================== Freundesliste (Drawer) ===================== */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: 380px; max-width: 92vw;
  background: var(--gc-white); box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .25s ease;
  padding: 22px; overflow-y: auto;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-head h3 { margin: 0; font-size: 24px; }
.drawer-search { margin: 16px 0 8px; }
.drawer-section-title { margin: 18px 0 8px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--gc-navy-muted); }
.friend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.friend {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius-md);
  background: var(--gc-bg-light);
}
.friend-info { flex: 1; min-width: 0; }
.friend-name { font-weight: 700; }
.friend-status { font-size: 13px; color: var(--gc-navy-muted); }
.friend .avatar { position: relative; }
.friend .avatar::after {
  content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--gc-bg-light); background: var(--gc-bg-deep);
}
.friend.online .avatar::after { background: var(--gc-teal); }
.friend.offline { opacity: .65; }
.drawer-note { margin-top: 20px; }
.search-result { margin-bottom: 6px; }

.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(38,70,83,.35); opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.show { opacity: 1; pointer-events: auto; }

/* ===================== Modals ===================== */
.modal {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px;
  background: rgba(38,70,83,.45); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal.open { opacity: 1; pointer-events: auto; }
.modal-card {
  position: relative; width: 100%; max-width: 440px;
  background: var(--gc-white); border-radius: 22px; box-shadow: var(--shadow-lg);
  padding: 30px; transform: translateY(12px); transition: transform .2s;
  border-top: 8px solid var(--gc-coral);
  max-height: calc(100vh - 40px); overflow-y: auto;
}
.modal.open .modal-card { transform: none; }
.modal-wide { max-width: 620px; }
.modal-x { position: absolute; top: 16px; right: 16px; }
.modal-card h3 { margin: 0 0 6px; font-size: 28px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--gc-navy-muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--gc-bg-deep); }
.join-row { display: flex; gap: 8px; }
.join-row input { text-transform: uppercase; letter-spacing: .1em; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.game-modal-art { height: 240px; border-radius: var(--radius-md); overflow: hidden; margin: 10px 0 18px; }
.game-modal-art svg { width: 100%; height: 100%; display: block; }
.stat-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.stat-pill { background: var(--gc-bg-light); border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 600; }
.stat-pill b { color: var(--gc-coral); }

.invites { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.invite { display: flex; align-items: center; gap: 10px; background: var(--gc-bg-light); border-radius: var(--radius-md); padding: 10px; border-left: 4px solid var(--gc-yellow); }
.invite span { flex: 1; font-size: 15px; }

/* ===================== Spielansicht ===================== */
.game-stage { max-width: 900px; margin: 40px auto; padding: 0 40px; }
.game-stage h2 { font-size: 44px; margin: 20px 0 6px; }
.game-stage-art { height: 320px; border-radius: var(--radius-lg); overflow: hidden; margin-top: 20px; box-shadow: var(--shadow-md); }
.game-stage-art svg { width: 100%; height: 100%; display: block; }
.stage-players { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; }
.stage-player { display: flex; align-items: center; gap: 10px; background: var(--gc-white); padding: 8px 16px 8px 8px; border-radius: 999px; box-shadow: var(--shadow-sm); font-weight: 700; }

/* ===================== Toasts ===================== */
.toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--gc-navy); color: var(--gc-white); padding: 12px 20px; border-radius: 999px;
  box-shadow: var(--shadow-md); font-weight: 600; font-size: 15px;
  animation: toastIn .25s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }


/* ===================== Login / Registrierung ===================== */
.center { text-align: center; }
.auth-tabs { display: flex; background: var(--gc-bg-light); border-radius: 999px; padding: 4px; margin-bottom: 16px; }
.auth-tab { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 10px; font: 700 15px var(--font); color: var(--gc-navy-muted); cursor: pointer; }
.auth-tab.active { background: var(--gc-white); color: var(--gc-navy); box-shadow: var(--shadow-sm); }
.form-error { background: rgba(231,111,81,.12); color: var(--gc-coral-dark); border-left: 4px solid var(--gc-coral); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.demo-note { background: rgba(233,196,106,.25); border-left: 4px solid var(--gc-yellow); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; margin: 4px 0 14px; }
#pwHint { margin: -6px 0 12px; }
.btn-google:disabled { opacity: .5; cursor: not-allowed; }

/* Benutzer-Menü oben rechts */
.user-menu-wrap { position: relative; }
.user-chip img.avatar { object-fit: cover; }
.chev { font-size: 12px; color: var(--gc-navy-muted); }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; z-index: 50;
  background: var(--gc-white); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); overflow: hidden;
}
.user-menu-head { padding: 14px 16px; border-bottom: 1px solid var(--gc-bg-deep); display: flex; flex-direction: column; }
.user-menu-head span { font-size: 13px; color: var(--gc-navy-muted); word-break: break-all; }
.user-menu button { width: 100%; text-align: left; border: 0; background: none; padding: 12px 16px; font: 600 15px var(--font); color: var(--gc-coral-dark); cursor: pointer; }
.user-menu button:hover { background: var(--gc-bg-light); }

/* ===================== Footer ===================== */
.site-footer { margin-top: 64px; padding: 0 40px 28px; }
.footer-inner {
  border-top: 2px solid var(--gc-bg-deep);
  padding-top: 22px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  font-size: 15px; color: var(--gc-navy-muted);
}
.footer-version strong { color: var(--gc-teal); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; }
.footer-links a { color: var(--gc-navy); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--gc-coral); }
.footer-links a[aria-current="page"] { color: var(--gc-coral); }
.footer-copy { text-align: right; }
body.in-lobby .site-footer { padding-right: 380px; }

/* ===================== Unterseiten ===================== */
.subpage { max-width: 820px; margin: 0 auto; padding: 48px 40px 0; min-height: calc(100vh - 260px); }
.subpage h1 { font-size: clamp(36px, 5vw, 56px); margin: 0 0 8px; letter-spacing: -.02em; }
.subpage h1::after { content: ""; display: block; width: 80px; height: 6px; margin-top: 12px; border-radius: 6px; background: var(--gc-coral); }
.subpage h2 { font-size: 22px; margin: 32px 0 8px; }
.subpage p, .subpage li { color: var(--gc-navy-soft); }
.placeholder { background: rgba(233,196,106,.25); border-radius: 4px; padding: 0 4px; }
.back-link { display: inline-block; margin-bottom: 20px; color: var(--gc-teal); font-weight: 700; text-decoration: none; }
.back-link:hover { color: var(--gc-teal-dark); }

/* ===================== Responsive ===================== */
@media (max-width: 900px) {
  :root { --card-w: 300px; --card-h: 169px; }
  .topbar { padding: 12px 16px; }
  .topbar-actions .btn span:not(.badge) { display: none; }
  .hero, .row-head { padding-left: 16px; padding-right: 16px; }
  .row-track { padding-left: 16px; padding-right: 16px; scroll-padding: 0 16px; }
  body.in-lobby main#homeView { padding-right: 0; }
  .lobby-dock { position: static; width: auto; margin: 16px; }
  .chat { left: 16px; right: 16px; width: auto; }
  .site-footer, body.in-lobby .site-footer { padding: 0 16px 24px; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-copy { text-align: center; }
  .subpage { padding: 32px 16px 0; }
}
