/**
 * Help Button Component Styles
 */

/* ============================================================================
   HELP BUTTON
   ============================================================================ */

.btn-help {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: var(--kc-text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

.btn-help::before {
    content: '';
    position: absolute;
    inset: -8px;
}

.btn-help:hover {
    background: rgba(0, 199, 139, 0.15);
    border-color: var(--kc-turquoise);
    color: var(--kc-turquoise);
}

.btn-help:active {
    transform: scale(0.95);
}

/* ============================================================================
   HELP MODAL CONTENT
   ============================================================================ */

.help-content {
    padding: 0.5rem 0;
}

.help-section {
    margin-bottom: 1.25rem;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--kc-turquoise);
    margin-bottom: 0.4rem;
}

.help-section p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--kc-text-muted);
}

/* ============================================================================
   PAGE HEADER WITH HELP BUTTON
   ============================================================================ */

.page-header-with-help {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 767px) {
    .btn-help {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .btn-help::before {
        inset: -6px;
    }
}

/* ============================================================================
   HELP BRIEFING — broadcast-style modal layout with TOC
   ============================================================================ */

.modal-dialog:has(.help-briefing) .modal-header {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.modal-dialog:has(.help-briefing) .modal-body {
    padding: 0;
    overflow-x: hidden;
    max-height: 75vh;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 199, 139, 0.45) rgba(255, 255, 255, 0.04);
}

.modal-dialog:has(.help-briefing) .modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-dialog:has(.help-briefing) .modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-left: 1px solid rgba(0, 199, 139, 0.1);
}

.modal-dialog:has(.help-briefing) .modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(0, 199, 139, 0.55) 0%, rgba(0, 230, 160, 0.35) 100%);
    border-radius: 4px;
    border: 1px solid rgba(0, 199, 139, 0.3);
    box-shadow: 0 0 8px rgba(0, 199, 139, 0.25);
}

.modal-dialog:has(.help-briefing) .modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(0, 199, 139, 0.75) 0%, rgba(0, 230, 160, 0.5) 100%);
    box-shadow: 0 0 12px rgba(0, 199, 139, 0.45);
}

.modal-dialog:has(.help-briefing) .modal-footer {
    background: #060606;
    border-top: 1px solid rgba(0, 199, 139, 0.18);
    padding: 1rem 1.5rem;
}

.help-briefing {
    color: var(--kc-text-primary, #fff);
    font-size: 0.875rem;
}

/* ─── Hero ─── */
.hb-hero {
    position: relative;
    height: 168px;
    overflow: hidden;
    border-bottom: 1px solid rgba(0, 199, 139, 0.22);
}

.hb-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(0, 199, 139, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 80%, rgba(245, 158, 11, 0.12) 0%, transparent 50%),
        linear-gradient(135deg, #0a0a0a 0%, #131313 50%, #0a0a0a 100%);
}

.hb-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.hb-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.55) 100%);
    pointer-events: none;
}

.hb-hero-content {
    position: relative;
    z-index: 1;
    height: 100%;
    padding: 1.25rem 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.5rem;
}

.hb-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-start;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    padding: 0.25rem 0.625rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.35);
}

.hb-hero-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 2.1rem;
    letter-spacing: 0.04em;
    line-height: 1;
    margin: 0;
    text-transform: uppercase;
}

.hb-hero-title .accent {
    background: linear-gradient(135deg, var(--kc-turquoise) 0%, #00e6a0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hb-hero-sub {
    margin: 0;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.8125rem;
    line-height: 1.4;
    max-width: 36rem;
}

/* ─── Table of Contents ─── */
.hb-toc {
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 199, 139, 0.18);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex-wrap: wrap;
}

.hb-toc-label {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.625rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--kc-turquoise);
    flex-shrink: 0;
}

.hb-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    flex: 1;
}

.hb-toc-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.375rem 0.625rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 150ms ease;
    user-select: none;
}

.hb-toc-item:hover {
    border-color: rgba(0, 199, 139, 0.4);
    color: #fff;
    background: rgba(0, 199, 139, 0.08);
}

.hb-toc-item.is-active {
    border-color: var(--kc-turquoise);
    color: #fff;
    background: rgba(0, 199, 139, 0.15);
    box-shadow: 0 0 16px rgba(0, 199, 139, 0.25);
}

.hb-toc-num {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.6875rem;
    color: var(--kc-turquoise);
    letter-spacing: 0.05em;
}

.hb-toc-item.is-active .hb-toc-num { color: #fff; }

.hb-toc-lbl {
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* ─── Chapters ─── */
.hb-chapters {
    padding: 1.25rem 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.hb-chapter {
    scroll-margin-top: 80px;
}

.hb-chapter-head {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    margin-bottom: 0.875rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hb-chapter-num {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1.75rem;
    line-height: 1;
    background: linear-gradient(135deg, var(--kc-turquoise) 0%, #00e6a0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    flex-shrink: 0;
    min-width: 2.25rem;
}

.hb-chapter-titles { flex: 1; min-width: 0; }

.hb-chapter-heading {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.005em;
}

.hb-chapter-kicker {
    margin: 0.125rem 0 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.3;
}

/* ─── Mode cards (Bedienung) ─── */
.hb-modes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
}

.hb-mode {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.hb-mode-badge {
    flex-shrink: 0;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 199, 139, 0.18) 0%, rgba(0, 199, 139, 0.05) 100%);
    border: 1px solid rgba(0, 199, 139, 0.4);
    border-radius: 6px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--kc-turquoise);
}

.hb-mode-body { flex: 1; min-width: 0; }

.hb-mode-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.125rem;
}

.hb-mode-text {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.45;
}

/* ─── Fit Matrix ─── */
.hb-fit-matrix {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.hb-fit-row {
    display: grid;
    grid-template-columns: 4.5rem 1fr 2fr;
    align-items: center;
    gap: 0.875rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--tone-border);
    border-radius: 8px;
    background: var(--tone-bg);
}

.hb-fit-row.tone-ideal   { --tone-border: rgba(0, 199, 139, 0.45);  --tone-bg: rgba(0, 199, 139, 0.06);  --tone-fg: var(--kc-turquoise); }
.hb-fit-row.tone-similar { --tone-border: rgba(245, 158, 11, 0.5);  --tone-bg: rgba(245, 158, 11, 0.06); --tone-fg: #fbbf24; }
.hb-fit-row.tone-unfit   { --tone-border: rgba(239, 68, 68, 0.5);   --tone-bg: rgba(239, 68, 68, 0.06);  --tone-fg: #f87171; }

.hb-fit-pen {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--tone-fg);
    text-align: center;
}

.hb-fit-info { display: flex; flex-direction: column; }

.hb-fit-lbl {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #fff;
}

.hb-fit-ex {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hb-fit-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.4;
}

/* ─── Callout (Sonderregel / Warnung) ─── */
.hb-callout {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    background: rgba(0, 199, 139, 0.08);
    border: 1px dashed rgba(0, 199, 139, 0.4);
    border-radius: 8px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.45;
}

.hb-callout.warn {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.4);
}

.hb-callout-tag {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.625rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--kc-turquoise);
    flex-shrink: 0;
    padding-top: 0.05rem;
}

.hb-callout.warn .hb-callout-tag { color: #fbbf24; }

/* ─── Strategy ─── */
.hb-formula {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.625rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.hb-formula .part {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hb-formula .part.accent {
    background: linear-gradient(135deg, var(--kc-turquoise) 0%, #00e6a0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hb-formula .op {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
}

.hb-strat-row { margin-bottom: 0.625rem; }

.hb-strat-row-lbl {
    display: block;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.625rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.375rem;
}

.hb-strat-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.375rem;
}

.hb-strat-opt {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--tone-border, rgba(255, 255, 255, 0.08));
    border-radius: 6px;
    background: var(--tone-bg, rgba(255, 255, 255, 0.02));
}

.hb-strat-opt.tone-attack  { --tone-border: rgba(239, 68, 68, 0.4); --tone-bg: rgba(239, 68, 68, 0.05); }
.hb-strat-opt.tone-defense { --tone-border: rgba(59, 130, 246, 0.4); --tone-bg: rgba(59, 130, 246, 0.05); }
.hb-strat-opt.tone-neutral { --tone-border: rgba(255, 255, 255, 0.1); --tone-bg: rgba(255, 255, 255, 0.025); }

.hb-strat-opt-lbl {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.hb-strat-opt-meta {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.35;
}

/* ─── Glyphs ─── */
.hb-glyphs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.hb-glyph {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--tone-border);
    border-radius: 8px;
    background: var(--tone-bg);
}

.hb-glyph.tone-gold     { --tone-border: rgba(245, 158, 11, 0.45); --tone-bg: rgba(245, 158, 11, 0.05); --tone-fg: #fbbf24; }
.hb-glyph.tone-danger   { --tone-border: rgba(239, 68, 68, 0.45);  --tone-bg: rgba(239, 68, 68, 0.05);  --tone-fg: #f87171; }
.hb-glyph.tone-warning  { --tone-border: rgba(245, 158, 11, 0.45); --tone-bg: rgba(245, 158, 11, 0.05); --tone-fg: #fbbf24; }
.hb-glyph.tone-similar  { --tone-border: rgba(245, 158, 11, 0.45); --tone-bg: rgba(245, 158, 11, 0.05); --tone-fg: #fbbf24; }

.hb-glyph-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--tone-fg);
    color: var(--tone-fg);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.4);
}

.hb-glyph-body { display: flex; flex-direction: column; min-width: 0; }

.hb-glyph-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #fff;
}

.hb-glyph-text {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

/* ─── Tips ─── */
.hb-tips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hb-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    background: linear-gradient(135deg, rgba(0, 199, 139, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-left: 3px solid var(--kc-turquoise);
    border-radius: 0 8px 8px 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.85);
}

.hb-tip-mark {
    flex-shrink: 0;
    color: var(--kc-turquoise);
    font-size: 0.875rem;
    line-height: 1.3;
}

.hb-tip-text { flex: 1; }

/* ─── Mobile ─── */
@media (max-width: 767px) {
    .hb-hero { height: 140px; }
    .hb-hero-content { padding: 1rem 1.125rem; }
    .hb-hero-title { font-size: 1.625rem; }
    .hb-hero-sub { font-size: 0.75rem; }

    .hb-toc { padding: 0.625rem 1.125rem; gap: 0.5rem; }
    .hb-toc-label { width: 100%; }
    .hb-toc-item { font-size: 0.6875rem; padding: 0.3rem 0.5rem; }

    .hb-chapters { padding: 1rem 1.125rem 1.25rem; gap: 1.25rem; }

    .hb-chapter-num { font-size: 1.5rem; min-width: 1.875rem; }
    .hb-chapter-heading { font-size: 0.9375rem; }

    .hb-modes,
    .hb-glyphs { grid-template-columns: 1fr; }

    .hb-strat-options { grid-template-columns: 1fr; }

    .hb-fit-row {
        grid-template-columns: 3.5rem 1fr;
        grid-template-rows: auto auto;
    }
    .hb-fit-pen { grid-row: 1 / span 2; font-size: 1.125rem; }
    .hb-fit-text { grid-column: 2; font-size: 0.6875rem; }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
    .help-briefing * { transition: none !important; animation: none !important; }
}