/* Gruppen-Dungeons kompakt (02.11.2026): Kopfzeile + Dungeon-Abend in einer Reihe, zwei Karten mit Stufen-Anzeige,
   Formular und offene Gruppen nebeneinander – am Desktop ohne Scrollen. @layer vhq = erste Ebene, schlägt pv-!important. */
@layer vhq {
  html body #view .party-page { gap: 10px !important; padding-bottom: 8px !important; align-content: start !important; }
  html body #view .party-top { display: grid !important; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) !important; gap: 10px !important; align-items: stretch !important; }

  /* Kopfzeile: eine schmale Platte */
  html body #view .party-heading { position: relative !important; display: grid !important; grid-template-columns: 1fr auto !important; grid-template-areas: "k m" "t m" "s m" !important; column-gap: 12px !important; row-gap: 2px !important; align-content: center !important; margin: 0 !important; padding: 10px 16px !important; border: 1px solid rgba(214, 178, 106, .35) !important; border-radius: 12px !important; background: linear-gradient(110deg, #2a1f33, #12101a) !important; }
  html body #view .party-heading > small { grid-area: k !important; font: 800 10px/1 Manrope, sans-serif !important; letter-spacing: .18em !important; color: #dcc18c !important; margin: 0 !important; }
  html body #view .party-heading > h1 { grid-area: t !important; margin: 0 !important; font: 600 22px/1.15 Cinzel, Georgia, serif !important; color: #f3e2b8 !important; }
  html body #view .party-heading > p { grid-area: s !important; margin: 0 !important; font: 500 12px/1.3 Manrope, sans-serif !important; color: #b9b0c8 !important; }
  html body #view .party-me { grid-area: m !important; display: flex !important; flex-direction: column !important; gap: 4px !important; align-self: center !important; text-align: right !important; }
  html body #view .party-me b { font: 800 11px/1 Manrope, sans-serif !important; letter-spacing: .12em !important; color: #f6dfa4 !important; padding: 5px 9px !important; border: 1px solid rgba(214, 178, 106, .4) !important; border-radius: 999px !important; background: rgba(214, 178, 106, .08) !important; }

  /* Dungeon-Abend: schlank neben der Kopfzeile */
  html body #view .party-top .party-night { margin: 0 !important; padding: 8px 14px !important; gap: 12px !important; align-self: stretch !important; height: auto !important; align-items: center !important; }
  html body #view .party-top .party-night__sigil { font-size: 26px !important; }
  html body #view .party-top .party-night b { font-size: 14px !important; margin: 3px 0 0 !important; }
  html body #view .party-top .party-night em { display: none !important; }

  /* Raster: Karten oben, darunter Formular + offene Gruppen */
  html body #view .party-grid { display: grid !important; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) !important; grid-template-areas: "cat cat" "form reg" !important; gap: 10px !important; align-items: stretch !important; }
  html body #view .party-grid > .party-catalog { grid-area: cat !important; gap: 10px !important; }
  html body #view .party-grid > .party-formation { grid-area: form !important; }
  html body #view .party-grid > .party-register { grid-area: reg !important; max-height: 340px !important; overflow: auto !important; scrollbar-width: thin !important; }

  /* Dungeon-Karten */
  html body #view .party-dungeon { min-height: clamp(110px, 21vh, 280px) !important; padding: 12px 16px !important; border-radius: 12px !important; filter: saturate(.8) brightness(.85) !important; transition: filter .2s, border-color .2s !important; }
  html body #view .party-dungeon:hover { filter: none !important; }
  html body #view .party-dungeon.selected { filter: none !important; border-color: #f0cf8c !important; box-shadow: 0 0 0 1px rgba(240, 207, 140, .5), 0 0 22px rgba(240, 207, 140, .25) !important; }
  html body #view .party-dungeon b { font-size: 22px !important; text-shadow: 0 2px 8px rgba(0, 0, 0, .8) !important; }
  html body #view .party-dungeon em { text-shadow: 0 1px 4px rgba(0, 0, 0, .9) !important; }
  html body #view .party-dungeon .party-req { justify-self: start !important; font: 800 10px/1 Manrope, sans-serif !important; font-style: normal !important; letter-spacing: .12em !important; padding: 5px 9px !important; border-radius: 999px !important; margin-top: 4px !important; }
  html body #view .party-dungeon .party-req.ok { color: #1c1306 !important; background: #d9b866 !important; }
  html body #view .party-dungeon .party-req.lock { color: #ffd2cc !important; background: rgba(120, 30, 30, .75) !important; border: 1px solid rgba(255, 140, 130, .5) !important; }

  /* Formular */
  html body #view .party-formation { padding: 12px 16px !important; }
  html body #view .party-formation > header { margin: 0 0 6px !important; }
  html body #view .party-formation h2, html body #view .party-register h2 { font-size: 17px !important; margin: 2px 0 8px !important; }
  html body #view .party-grid .party-form { grid-template-columns: 1fr 1fr !important; gap: 8px 10px !important; }
  html body #view .party-grid .party-form .button { min-height: 44px !important; width: 100% !important; }
  html body #view .party-grid .party-form select { min-height: 40px !important; }
  html body #view .party-grid .party-formation > p { margin: 8px 0 0 !important; font-size: 12px !important; line-height: 1.4 !important; color: #b9b0c8 !important; }
  html body #view .party-register { padding: 12px 16px !important; }
  html body #view .party-register > article { padding: 8px 0 !important; }
  html body #view .party-register > p { margin: 4px 0 0 !important; font-size: 12px !important; color: #b9b0c8 !important; }

  /* Handy: untereinander, Karten niedriger */
  @media (max-width: 900px) {
    html body #view .party-top { grid-template-columns: 1fr !important; }
    html body #view .party-heading { grid-template-columns: 1fr auto !important; padding: 10px 14px !important; }
    html body #view .party-heading > h1 { font-size: 19px !important; }
    html body #view .party-heading > p { display: none !important; }
    html body #view .party-me { flex-direction: row !important; grid-area: s !important; justify-self: start !important; }
    html body #view .party-grid { grid-template-columns: 1fr !important; grid-template-areas: "cat" "form" "reg" !important; }
    html body #view .party-grid > .party-catalog { grid-template-columns: 1fr !important; gap: 8px !important; }
    html body #view .party-dungeon { min-height: 104px !important; padding: 10px 14px !important; }
    html body #view .party-dungeon b { font-size: 18px !important; }
    html body #view .party-dungeon em { display: none !important; }
    html body #view .party-grid > .party-register { max-height: none !important; overflow: visible !important; }
  }
}

/* Rolle + Schwierigkeit als Karten (02.11.2026, Teil 2): HQ-Heldenbilder statt Auswahllisten */
@layer vhq {
  html body #view .party-grid .party-form { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  html body #view .party-form > .party-pick { grid-column: 1 / -1 !important; }
  html body #view .party-pick { display: grid !important; gap: 8px !important; }
  html body #view .party-roles { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  html body #view .party-diffs { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  html body #view .party-role, html body #view .party-diff {
    position: relative !important; display: flex !important; align-items: center !important; gap: 10px !important; min-height: 56px !important; padding: 6px 12px 6px 6px !important; margin: 0 !important; text-align: left !important;
    border: 1px solid rgba(214, 178, 106, .28) !important; border-radius: 10px !important; background: linear-gradient(180deg, #1b1626, #110f19) !important; color: #cfc4dc !important; box-shadow: none !important; cursor: pointer !important;
    transition: border-color .15s, box-shadow .15s, background .15s !important;
  }
  html body #view .party-role:hover:not(:disabled), html body #view .party-diff:hover:not(:disabled) { border-color: rgba(240, 207, 140, .65) !important; }
  html body #view .party-role.selected, html body #view .party-diff.selected { border-color: #f0cf8c !important; background: linear-gradient(180deg, #2c2233, #17121f) !important; box-shadow: 0 0 0 1px rgba(240, 207, 140, .45), 0 0 18px rgba(240, 207, 140, .2) !important; color: #fff2c9 !important; }
  html body #view .party-role img { flex: 0 0 auto !important; width: 44px !important; height: 44px !important; object-fit: cover !important; object-position: 50% 18% !important; border-radius: 8px !important; border: 1px solid rgba(214, 178, 106, .4) !important; background: #0b0a12 !important; }
  html body #view .party-role span { display: grid !important; gap: 3px !important; min-width: 0 !important; }
  html body #view .party-role b, html body #view .party-diff b { font: 700 13px/1.1 Cinzel, Georgia, serif !important; letter-spacing: .12em !important; text-transform: uppercase !important; }
  html body #view .party-role small, html body #view .party-diff small { font: 700 9px/1.2 Manrope, sans-serif !important; letter-spacing: .1em !important; color: #a99dbb !important; }
  html body #view .party-role.selected small, html body #view .party-diff.selected small { color: #dcc18c !important; }
  html body #view .party-diff { flex-direction: column !important; align-items: flex-start !important; justify-content: center !important; gap: 4px !important; padding: 8px 14px !important; }
  html body #view .party-diff.asc.selected { border-color: #ff9a6b !important; box-shadow: 0 0 0 1px rgba(255, 154, 107, .5), 0 0 18px rgba(255, 120, 70, .25) !important; }
  html body #view .party-diff:disabled { opacity: .55 !important; cursor: not-allowed !important; }
  html body #view .party-grid .party-form .button { min-height: 46px !important; }
  html body #view .party-grid .party-form .party-quick, html body #view .party-grid .party-form [data-party-action="create"] { width: 100% !important; min-width: 0 !important; }
  @media (max-width: 900px) {
    html body #view .party-roles { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 6px !important; }
    html body #view .party-role { flex-direction: column !important; justify-content: center !important; gap: 4px !important; min-height: 92px !important; padding: 8px 4px !important; text-align: center !important; }
    html body #view .party-role img { width: 46px !important; height: 46px !important; }
    html body #view .party-role span { justify-items: center !important; }
    html body #view .party-role b { font-size: 12px !important; letter-spacing: .08em !important; }
    html body #view .party-diffs { grid-template-columns: 1fr !important; }
    html body #view .party-formation h2 { display: none !important; }
  }
}

/* Teil 3 (02.11.2026): Bereitschaft, Kampf, Belohnung im VEYDRIS-Stil – Heldenkarten mit Plaketten, Wächter-Stationen, klarer Sieg, lesbare Kampfliste */
@layer vhq {
  html body #view .party-page:is([data-party-mode="forming"], [data-party-mode="battle"]) > .party-top { display: none !important; }

  /* Heldenkarten */
  html body #view .party-roster { gap: 10px !important; margin: 10px 0 !important; }
  html body #view .party-hero { position: relative !important; gap: 12px !important; padding: 10px 12px 10px 10px !important; border: 1px solid rgba(214, 178, 106, .25) !important; border-left: 3px solid var(--role, #b9a9d0) !important; border-radius: 12px !important; background: linear-gradient(180deg, rgba(34, 27, 45, .92), rgba(15, 13, 22, .92)) !important; }
  html body #view .party-hero.role-tank { --role: #e0b85c; } html body #view .party-hero.role-healer { --role: #6fd3ae; } html body #view .party-hero.role-damage { --role: #d9707a; }
  html body #view .party-hero img { width: 56px !important; height: 72px !important; border-radius: 9px !important; border: 1px solid rgba(214, 178, 106, .4) !important; background: #0b0a12 !important; object-position: 50% 12% !important; }
  html body #view .party-hero > span { gap: 5px !important; }
  html body #view .party-hero small { display: flex !important; flex-wrap: wrap !important; align-items: center !important; gap: 5px !important; font: 800 10px/1 Manrope, sans-serif !important; letter-spacing: .14em !important; text-transform: uppercase !important; color: var(--role, #dcc18c) !important; }
  html body #view .party-hero small i { font-style: normal !important; font: 800 9px/1 Manrope, sans-serif !important; letter-spacing: .08em !important; padding: 3px 6px !important; border-radius: 999px !important; color: #e8dfd0 !important; background: rgba(255, 255, 255, .09) !important; }
  html body #view .party-hero small i.party-helper { color: #1c1306 !important; background: #b9a9d0 !important; }
  html body #view .party-hero b { font: 700 14px/1.2 Manrope, sans-serif !important; color: #f3e6c8 !important; }
  html body #view .party-hero em { font: 600 10px/1.3 Manrope, sans-serif !important; font-style: normal !important; color: #b9b0c8 !important; }
  html body #view .party-hero em.party-state { justify-self: start !important; padding: 3px 8px !important; border-radius: 999px !important; letter-spacing: .1em !important; background: rgba(255, 255, 255, .07) !important; }
  html body #view .party-hero em.party-state.is-ready { color: #1c1306 !important; background: #8fe0bd !important; font-weight: 800 !important; }
  html body #view .party-health { height: 8px !important; border-radius: 4px !important; background: #0d0a14 !important; border: 1px solid rgba(255, 255, 255, .08) !important; }
  html body #view .party-health i { background: linear-gradient(90deg, #3fb184, #8fe0bd) !important; }
  html body #view .party-hero.is-down { filter: grayscale(1) brightness(.6) !important; }
  html body #view .party-hero.is-down::after { content: "FALLEN" !important; position: absolute !important; top: 8px !important; right: 10px !important; font: 800 9px/1 Manrope, sans-serif !important; letter-spacing: .14em !important; color: #ffb0a8 !important; }

  /* Kampf-Platte */
  html body #view .party-battle { padding: 16px 20px !important; border: 1px solid rgba(214, 178, 106, .5) !important; border-radius: 14px !important; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), inset 0 0 60px rgba(0, 0, 0, .5) !important; }
  html body #view .party-battle > header { display: grid !important; gap: 4px !important; }
  html body #view .party-battle > header > small { font: 800 11px/1 Manrope, sans-serif !important; letter-spacing: .2em !important; color: #dcc18c !important; }
  html body #view .party-battle h2 { margin: 2px 0 4px !important; font: 600 30px/1.1 Cinzel, Georgia, serif !important; color: #f6dfa4 !important; text-shadow: 0 2px 14px rgba(0, 0, 0, .8) !important; }
  html body #view .party-pips { display: flex !important; gap: 8px !important; margin: 0 0 4px !important; }
  html body #view .party-pips i { width: 11px !important; height: 11px !important; transform: rotate(45deg) !important; border: 1px solid rgba(214, 178, 106, .6) !important; background: transparent !important; }
  html body #view .party-pips i.done { background: #d9b866 !important; border-color: #f6dfa4 !important; }
  html body #view .party-pips i.now { background: #ff9a6b !important; border-color: #ffd2b0 !important; box-shadow: 0 0 10px rgba(255, 140, 90, .8) !important; }
  html body #view .party-boss-health { height: 28px !important; max-width: none !important; border: 2px solid #d9b866 !important; border-radius: 8px !important; background: #1a0b12 !important; box-shadow: 0 0 18px rgba(0, 0, 0, .6) !important; }
  html body #view .party-boss-health i { background: linear-gradient(90deg, #6e1f2c, #c24a56 60%, #e0707a) !important; }
  html body #view .party-boss-health span { font: 800 12px/1 Manrope, sans-serif !important; letter-spacing: .06em !important; }
  html body #view .party-battle > header > p { margin: 4px 0 0 !important; font: 500 13px/1.3 Manrope, sans-serif !important; color: #cdbfd8 !important; }

  /* Aktionen */
  html body #view .party-controls { display: flex !important; gap: 10px !important; margin: 4px 0 8px !important; }
  html body #view .party-battle .party-controls .button { flex: 1 1 0 !important; min-height: 50px !important; max-width: 280px !important; font-size: 13px !important; letter-spacing: .1em !important; }
  html body #view .party-battle .party-controls .button.primary:not(:disabled) { box-shadow: 0 0 20px rgba(240, 207, 140, .35) !important; }
  html body #view .party-battle > small { display: block !important; margin: 0 0 6px !important; font: 600 12px/1.3 Manrope, sans-serif !important; color: #b9b0c8 !important; }

  /* Kampfliste: neueste Zeile oben, ohne Nummern */
  html body #view .party-combat-log { display: block !important; list-style: none !important; margin: 0 0 8px !important; padding: 8px 14px !important; max-height: none !important; overflow: visible !important; border: 1px solid rgba(255, 255, 255, .07) !important; border-radius: 10px !important; background: rgba(8, 6, 14, .72) !important; font: 500 12px/1.5 Manrope, sans-serif !important; color: #9c92ad !important; }
  html body #view .party-combat-log li { list-style: none !important; }
  html body #view .party-combat-log li:not(:nth-last-child(-n+5)) { display: none !important; }
  html body #view .party-combat-log li:last-child { color: #f3e6c8 !important; font-weight: 700 !important; }

  /* Sieg / Niederlage */
  html body #view .party-page[data-party-result="won"] .party-battle { border-color: #f0cf8c !important; box-shadow: 0 0 0 1px rgba(240, 207, 140, .5), 0 0 34px rgba(240, 207, 140, .3), inset 0 0 60px rgba(0, 0, 0, .5) !important; }
  html body #view .party-page[data-party-result="won"] .party-battle > header > small { color: #ffe9b0 !important; text-shadow: 0 0 14px rgba(255, 220, 140, .7) !important; font-size: 13px !important; }
  html body #view .party-page[data-party-result="lost"] .party-battle { border-color: #b8505a !important; }
  html body #view .party-page[data-party-result="lost"] .party-battle > header > small { color: #ffb0a8 !important; }
  html body #view .party-page[data-party-result="won"] [data-party-action="claim"]:not(:disabled) { min-height: 58px !important; max-width: 340px !important; font-size: 15px !important; box-shadow: 0 0 28px rgba(240, 207, 140, .55) !important; }

  /* Bereitschafts-Check */
  html body #view .party-formation > header > h2 { font-size: 24px !important; }
  html body #view .party-roster .party-empty { min-height: 92px !important; border: 1px dashed rgba(214, 178, 106, .3) !important; border-radius: 12px !important; }

  @media (max-width: 900px) {
    html body #view .party-roster { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 6px !important; }
    html body #view .party-hero { gap: 8px !important; padding: 7px 8px !important; }
    html body #view .party-hero img { width: 38px !important; height: 50px !important; }
    html body #view .party-hero b { font-size: 12px !important; }
    html body #view .party-hero small { font-size: 9px !important; gap: 4px !important; }
    html body #view .party-hero small i { font-size: 8px !important; padding: 2px 5px !important; }
    html body #view .party-hero em { font-size: 9px !important; }
    html body #view .party-roster .party-hero:first-child { grid-column: 1 / -1 !important; }
    html body #view .party-battle { padding: 14px !important; }
    html body #view .party-battle h2 { font-size: 24px !important; }
    html body #view .party-battle .party-controls { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 6px !important; }
    html body #view .party-battle .party-controls .button { max-width: none !important; min-height: 48px !important; padding: 0 4px !important; font-size: 11px !important; letter-spacing: .05em !important; }
    html body #view .party-page[data-party-result="won"] .party-battle .party-controls { grid-template-columns: 1fr !important; }
  }
}
