/* GameDraft — styles/features.css
   Neue UX-Komponenten: Fortschrittsleiste, Start-Panel mit Vorlagen (Presets)
   und das Abschluss-Panel. Greift Tokens & Look der bestehenden .panel-Optik auf. */

/* --- Fortschrittsleiste --------------------------------------------------- */
.duelProgress { margin: 4px 0 14px; display: grid; gap: 6px; }
.duelProgressBar {
  height: 8px; border-radius: 999px; overflow: hidden;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
}
.duelProgressFill {
  display: block; height: 100%; width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #00d7ff, #3d7bff 52%, #7c4dff);
  box-shadow: 0 0 18px rgba(67,111,255,.45);
  transition: width .35s cubic-bezier(.4,.0,.2,1);
}
.duelProgressLabel { color: var(--muted); font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }

/* --- Start-Panel (Vorlagen-Auswahl) -------------------------------------- */
.startPanel {
  background: rgba(17,19,25,.92);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 24px;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  margin: 4px 0 18px;
}
.startPanelHead { max-width: 760px; margin-bottom: 18px; }
.startPanelHead h2 { margin: 6px 0 8px; font-size: clamp(22px, 3vw, 30px); }
.startPanelHead .sub { margin: 0; }

.presetGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.presetCard {
  position: relative;
  text-align: left;
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 16px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(0,0,0,.18)),
    color-mix(in srgb, var(--accent, #5aa9ff) 7%, #12151d);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  overflow: hidden;
}
.presetCard::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent, #5aa9ff);
  opacity: .9;
}
.presetCard:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent, #5aa9ff) 55%, var(--border));
  box-shadow: 0 16px 40px rgba(0,0,0,.35), 0 0 0 1px color-mix(in srgb, var(--accent, #5aa9ff) 30%, transparent);
}
.presetCard:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent, #5aa9ff) 60%, transparent); outline-offset: 2px; }
.presetCardHead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.presetEmoji {
  line-height: 1;
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent, #5aa9ff) 18%, #0c0f16);
  border: 1px solid color-mix(in srgb, var(--accent, #5aa9ff) 35%, transparent);
  color: color-mix(in srgb, var(--accent, #5aa9ff) 80%, #ffffff);
}
.presetEmoji svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; display: block;
}
.presetCount {
  font-size: 11.5px; font-weight: 800; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 9px;
  background: rgba(0,0,0,.3);
}
.presetName { font-size: 17px; font-weight: 850; letter-spacing: -.01em; }
.presetDesc { color: var(--muted); font-size: 13px; line-height: 1.35; min-height: 2.7em; }
.presetCovers { display: flex; gap: 5px; margin-top: 2px; }
.presetCover {
  width: 30px; height: 42px; border-radius: 7px;
  background-color: #15171f; background-size: cover; background-position: center; background-repeat: no-repeat;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.startPanelActions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* --- Abschluss-Panel ------------------------------------------------------ */
.finishedPanel {
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(124,77,255,.16), transparent 60%),
    rgba(17,19,25,.92);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 28px 24px;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  margin: 4px 0 18px;
}
.finishedBadge { font-size: 44px; line-height: 1; margin-bottom: 6px; }
.finishedPanel h2 { margin: 0 0 8px; font-size: clamp(22px, 3vw, 30px); }
.finishedPanel .sub { margin: 0 auto 20px; max-width: 560px; }
.finishedStats {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  margin: -6px 0 18px;
}
.finishedTop3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 200px));
  gap: 14px; justify-content: center;
  margin-bottom: 22px;
}
.finishedRankCard {
  position: relative; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 12px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(4,5,8,.45);
  transition: transform .15s ease, border-color .15s ease;
}
.finishedRankCard:hover { transform: translateY(-3px); border-color: #65728d; }
.finishedCover {
  width: 96px; height: 134px; border-radius: 12px;
  background-color: #15171f; background-size: cover; background-position: center; background-repeat: no-repeat;
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 12px 30px rgba(0,0,0,.55);
}
.finishedRankBadge { position: absolute; top: 8px; left: 8px; font-size: 22px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.6)); }
.finishedRankName { font-weight: 850; font-size: 15px; line-height: 1.15; }
.finishedRankMeta { color: var(--muted); font-size: 12px; }
.finishedActions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* --- Onboarding „So funktioniert's" + Duell-Tastaturhinweis --------------- */
.howItWorksBox {
  background: linear-gradient(180deg, rgba(0,215,255,.08), rgba(124,77,255,.08));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.4;
}
.duelKeyHint {
  margin-top: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: .01em;
}
@media (max-width: 640px) { .duelKeyHint { font-size: 11.5px; } }

/* --- Bibliothek: klarere „+"-Affordanz auf nicht gewählten Kacheln -------- */
.libraryTile:not(.selected) .checkBadge {
  color: var(--muted);
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
}
.libraryTile:not(.selected):hover .checkBadge {
  color: #fff;
  background: rgba(0,0,0,.78);
  border-color: rgba(255,255,255,.35);
}

/* --- Profil-Switcher (Mehrfach-Profile im „Meine Listen"-Modal) ----------- */
.profileSwitcher { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.profileChip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: #12151d; color: var(--muted);
  font-weight: 700; font-size: 13px; cursor: pointer; transition: .15s ease;
}
.profileChip .navIcon { width: 18px; height: 18px; flex-basis: 18px; background: none; box-shadow: none; }
.profileChip:hover { color: var(--text); transform: translateY(-1px); }
.profileChip.active {
  border-color: color-mix(in srgb, var(--good) 60%, var(--border));
  color: var(--text);
  background: color-mix(in srgb, var(--good) 14%, #12151d);
}
.profileChipNew { font-size: 18px; font-weight: 900; padding: 0 14px; color: var(--text); }

/* --- Vorlagen im „Meine Listen"-Modal ------------------------------------ */
.listsSectionTitle {
  font-weight: 850; font-size: 13px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
  margin: 16px 0 8px;
}
.listsSectionHint { font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 12px; opacity: .75; }
.listsPresetGrid {
  display: flex; gap: 12px; overflow-x: auto;
  padding-bottom: 8px; flex: 0 0 auto;
  scrollbar-width: thin;
}
.listsPresetGrid .presetCard { flex: 0 0 230px; }

@media (max-width: 640px) {
  .finishedTop3 { grid-template-columns: 1fr; max-width: 260px; margin-inline: auto; }
  .presetDesc { min-height: 0; }
}

/* === Hauptmenü (Home-Screen) ============================================= */
.mainMenu {
  margin: 4px 0 18px;
  animation: menuFadeIn .25s ease;
}
@keyframes menuFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.menuHead { display: flex; align-items: center; gap: 12px; margin: 2px 0 18px; }
.menuScreenTitle { margin: 0; font-size: clamp(22px, 3vw, 30px); font-weight: 850; letter-spacing: -.02em; }
/* Hero-Titel im Hauptmenü-Root: Marken-Gradient + Untertitel */
.menuHeadRoot { flex-direction: column; align-items: flex-start; gap: 4px; margin: 4px 0 20px; }
.menuTitleHero {
  font-size: clamp(28px, 4.4vw, 40px); font-weight: 900; letter-spacing: -.025em; line-height: 1.05;
  background: linear-gradient(100deg, #ffffff 0%, #cfe0ff 38%, #8ab4ff 70%, #b79bff 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.menuRootSub { margin: 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.menuBackBtn {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  font-size: 24px; line-height: 1;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #12151d;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.menuBackBtn:hover { border-color: color-mix(in srgb, #5aa9ff 50%, var(--border)); background: #161a24; }
.menuBackBtn:active { transform: scale(.94); }

.menuTiles { display: grid; gap: 12px; }
.menuTile {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(0,0,0,.18)),
    color-mix(in srgb, var(--accent, #5aa9ff) 6%, #12151d);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  overflow: hidden;
}
.menuTile::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent, #5aa9ff); opacity: .9;
}
.menuTile:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent, #5aa9ff) 55%, var(--border));
  box-shadow: 0 14px 36px rgba(0,0,0,.32), 0 0 0 1px color-mix(in srgb, var(--accent, #5aa9ff) 28%, transparent);
}
.menuTile:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent, #5aa9ff) 60%, transparent); outline-offset: 2px; }
.menuTileIcon {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  line-height: 1;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent, #5aa9ff) 18%, #0c0f16);
  border: 1px solid color-mix(in srgb, var(--accent, #5aa9ff) 35%, transparent);
  color: color-mix(in srgb, var(--accent, #5aa9ff) 78%, #ffffff);
}
.menuTileIcon svg {
  width: 26px; height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
.menuTileText { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
.menuTileTitle { font-size: 16.5px; font-weight: 800; letter-spacing: -.01em; }
.menuTileDesc { color: var(--muted); font-size: 13px; line-height: 1.35; }
.menuTileChevron {
  flex: 0 0 auto; font-size: 26px; line-height: 1; color: var(--muted);
  transition: transform .15s ease, color .15s ease;
}
.menuTile:hover .menuTileChevron { transform: translateX(3px); color: var(--text); }

.menuHelpLink {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 16px;
  padding: 8px 4px;
  background: none; border: none;
  color: var(--muted); font-size: 13.5px; font-weight: 700;
  cursor: pointer;
  transition: color .15s ease;
}
.menuHelpLink:hover { color: var(--text); text-decoration: underline; }
.menuHelpIcon { display: inline-flex; text-decoration: none; }
.menuHelpIcon svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; display: block;
}

/* Hilfe als rundes „?"-Icon oben rechts im Menükopf */
.menuHelpBtn {
  margin-left: auto;
  flex: 0 0 auto;
  width: 46px; height: 46px;
  padding: 0 !important;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--brand-accent, #5b8cff) 45%, var(--border));
  background: color-mix(in srgb, var(--brand-accent, #5b8cff) 18%, #12151d);
  color: #eaf0ff;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(91,140,255,.18);
  transition: color .15s ease, border-color .15s ease, background .15s ease, transform .1s ease, box-shadow .15s ease;
}
.menuHelpBtn:hover {
  color: #fff;
  border-color: color-mix(in srgb, var(--brand-accent, #5b8cff) 70%, var(--border));
  background: color-mix(in srgb, var(--brand-accent, #5b8cff) 30%, #12151d);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(91,140,255,.30);
}
.menuHelpBtn svg {
  width: 26px; height: 26px;
  fill: none; stroke: currentColor; stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round; display: block;
}

.menuSectionTitle {
  font-weight: 850; font-size: 13px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
  margin: 22px 0 12px;
}

/* Community-Import */
.communityImport {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(17,19,25,.7);
}
.communityImportRow { display: flex; gap: 10px; flex-wrap: wrap; }
.communityImportRow input {
  flex: 1 1 240px; min-width: 0;
  height: var(--gd-control-h, 44px);
  padding: 0 14px;
  border-radius: var(--gd-r-md, 12px);
  border: 1px solid var(--border);
  background: #0c0f16; color: var(--text);
  font-size: 14px;
}
.communityImportRow input:focus-visible { outline: 2px solid color-mix(in srgb, #5aa9ff 60%, transparent); outline-offset: 1px; }
.communityImportRow .primary { flex: 0 0 auto; }
.communityImportNote { margin-top: 10px; font-size: 13px; color: var(--muted); min-height: 1.2em; }
.communityImportNote.isError { color: #ff6b6b; }

@media (max-width: 640px) {
  .menuTile { padding: 14px; gap: 12px; }
  .menuTileIcon { width: 42px; height: 42px; font-size: 19px; }
  .menuTileDesc { font-size: 12.5px; }
}
