/*
 * StarshipOS — Jump Calculation Puzzle Styles (CC_062)
 * Star chart aesthetic: dark space background, grid glow, marker animations.
 * Extends puzzle-base.css variables.
 */

/* ── Container ─────────────────────────────────────────────────────────── */
.jump-puzzle-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    color: var(--puzzle-text);
    background: var(--puzzle-bg);
    font-family: 'Courier New', Courier, monospace;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.jump-puzzle-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 180, 255, 0.07);
    border: 1px solid rgba(0, 180, 255, 0.35);
    border-radius: var(--puzzle-radius, 6px);
}

.jump-puzzle-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #00c8ff;
    text-shadow: 0 0 10px rgba(0, 200, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.jump-puzzle-subtitle {
    font-size: 0.75rem;
    color: var(--puzzle-text-muted, #6a8aaa);
    letter-spacing: 0.06em;
}

/* ── Main Layout ─────────────────────────────────────────────────────────── */
.jump-puzzle-main {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    flex-wrap: nowrap;   /* horizontal nebeneinander, kein Umbruch */
}

/* ── Map Panel ───────────────────────────────────────────────────────────── */
.jump-map-panel {
    flex: 0 0 auto;
}

.jump-panel-label {
    margin: 0 0 0.4rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--puzzle-text-muted, #6a8aaa);
}

.jump-map-wrapper {
    border: 1px solid rgba(0, 150, 220, 0.4);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 150, 220, 0.15), inset 0 0 30px rgba(0, 0, 0, 0.5);
    /* SVG ist 500×500 px — nahezu volle Größe anzeigen */
    max-width: 460px;
    flex-shrink: 0;
}

/* SVG skaliert sich innerhalb des Wrappers */
.jump-map-wrapper .jump-map-svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Grid glow animation on the SVG inside the wrapper */
.jump-map-wrapper .jump-map-svg .jump-grid {
    animation: grid-pulse 4s ease-in-out infinite alternate;
}

@keyframes grid-pulse {
    from { opacity: 0.4; }
    to   { opacity: 0.75; }
}

/* Ship marker pulse */
.jump-map-wrapper .jump-ship-marker circle:first-child {
    animation: ship-pulse 2s ease-in-out infinite alternate;
}

@keyframes ship-pulse {
    from { r: 7; opacity: 0.6; }
    to   { r: 10; opacity: 1.0; }
}

/* Target marker pulse */
.jump-map-wrapper .jump-target-marker polygon {
    animation: target-flash 1.5s ease-in-out infinite alternate;
}

@keyframes target-flash {
    from { opacity: 0.7; }
    to   { opacity: 1.0; }
}

/* ── Input Panel ─────────────────────────────────────────────────────────── */
.jump-input-panel {
    flex: 1 1 260px;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    min-width: 240px;
}

/* ── Reference Box ───────────────────────────────────────────────────────── */
.jump-reference-box {
    padding: 0.65rem 0.75rem;
    background: rgba(10, 30, 50, 0.8);
    border: 1px solid rgba(0, 150, 200, 0.3);
    border-radius: 4px;
}

.jump-data-list {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 1rem;
    row-gap: 0.2rem;
    margin: 0;
    font-size: 0.82rem;
}

.jump-data-list dt {
    color: var(--puzzle-text-muted, #6a8aaa);
    font-weight: 400;
}

.jump-data-list dd {
    margin: 0;
    color: #b0d8f0;
    font-weight: 600;
}

/* ── Hint Boxes ──────────────────────────────────────────────────────────── */
.jump-hint-box {
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    border-left: 3px solid;
}

.jump-hint-box--distance {
    background: rgba(0, 200, 100, 0.07);
    border-color: #00c864;
}

.jump-hint-box--energy {
    background: rgba(200, 150, 0, 0.07);
    border-color: #c8a000;
}

.jump-hint-label {
    margin: 0 0 0.25rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--puzzle-text-muted, #6a8aaa);
}

.jump-hint-formula {
    display: block;
    font-size: 0.82rem;
    color: #d0f0d0;
    letter-spacing: 0.02em;
}

/* ── Input Form ──────────────────────────────────────────────────────────── */
.jump-input-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.jump-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.jump-field-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--puzzle-text-muted, #6a8aaa);
}

.jump-field-input {
    background: rgba(0, 20, 40, 0.9);
    border: 1px solid rgba(0, 150, 220, 0.4);
    border-radius: 3px;
    color: #b0d8f0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    padding: 0.35rem 0.5rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.jump-field-input:focus {
    border-color: #00c8ff;
    box-shadow: 0 0 8px rgba(0, 200, 255, 0.3);
}

.jump-field-input::placeholder {
    color: #2a4a6a;
}

/* ── Submit Button ───────────────────────────────────────────────────────── */
.jump-submit-btn {
    margin-top: 0.35rem;
    padding: 0.55rem 1rem;
    background: rgba(0, 80, 160, 0.6);
    border: 1px solid rgba(0, 150, 255, 0.6);
    border-radius: 4px;
    color: #80c8ff;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}

.jump-submit-btn:hover {
    background: rgba(0, 120, 220, 0.8);
    box-shadow: 0 0 14px rgba(0, 160, 255, 0.45);
    color: #d0eeff;
}

.jump-submit-btn:active {
    background: rgba(0, 60, 130, 0.9);
}

/* ── Result Area ─────────────────────────────────────────────────────────── */
.jump-result-area {
    min-height: 1.5rem;
    font-size: 0.85rem;
    color: var(--puzzle-text, #c0d8f0);
}

/* ── CC_196: Hilfe-Knopf „?" und Anleitung ─────────────────────────────── */
.jump-puzzle-header {
    justify-content: space-between;
    align-items: center;
}
.jump-puzzle-heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.jump-help-btn {
    flex: 0 0 auto;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: 1px solid rgba(0, 200, 255, 0.7);
    background: rgba(0, 60, 110, 0.6);
    color: #9fe6ff;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}
.jump-help-btn:hover,
.jump-help-btn.is-open {
    background: rgba(0, 140, 220, 0.8);
    box-shadow: 0 0 12px rgba(0, 200, 255, 0.5);
    color: #fff;
}
.jump-help {
    padding: 0.75rem 1rem;
    background: rgba(0, 40, 80, 0.55);
    border: 1px solid rgba(0, 180, 255, 0.35);
    border-left: 3px solid #00c8ff;
    border-radius: 4px;
    font-size: 0.85rem;
    line-height: 1.45;
}
.jump-help[hidden] { display: none; }
.jump-help-lead { margin: 0 0 0.5rem; }
.jump-help ul { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.3rem; }
.jump-help .c-ship { color: #00dc64; }
.jump-help .c-target { color: #ff5a5a; }
.jump-help .c-hazard { color: #ff9a40; }
.jump-help .c-gravity { color: #c79bff; }

/* ── CC_196: Scan-Hinweis ──────────────────────────────────────────────────── */
.jump-scan-banner {
    padding: 0.45rem 0.75rem;
    border-radius: 4px;
    font-size: 0.82rem;
}
.jump-scan-banner.is-scanned { background: rgba(0, 200, 120, 0.1); border: 1px solid rgba(0, 200, 120, 0.45); color: #7ff0b8; }
.jump-scan-banner.is-blind { background: rgba(255, 150, 0, 0.1); border: 1px solid rgba(255, 150, 0, 0.45); color: #ffc070; }

/* ── CC_196: Karte zum Antippen ────────────────────────────────────────────── */
.jump-map-wrapper .jump-map-svg { cursor: crosshair; touch-action: manipulation; }
.jump-map-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.jump-tool-btn {
    padding: 0.4rem 0.7rem;
    background: rgba(0, 30, 60, 0.8);
    border: 1px solid rgba(0, 150, 220, 0.45);
    border-radius: 4px;
    color: #9cc8e8;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}
.jump-tool-btn:hover { border-color: #00c8ff; color: #d0eeff; }

/* ── CC_196: Bordcomputer ──────────────────────────────────────────────────── */
.jump-leg-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-bottom: 0.6rem; }
.jump-leg-table th {
    text-align: left;
    font-weight: 400;
    color: var(--puzzle-text-muted, #6a8aaa);
    border-bottom: 1px solid rgba(0, 150, 200, 0.3);
    padding: 0.2rem 0.3rem;
}
.jump-leg-table td { padding: 0.25rem 0.3rem; color: #b0d8f0; vertical-align: top; }
.jump-leg-table tr.leg-clear td:last-child { color: #00e0a0; }
.jump-leg-table tr.leg-zone td:last-child { color: #ffb020; }
.jump-leg-table tr.leg-core td:last-child { color: #ff5050; font-weight: 700; }
.jump-verdict { margin: 0.6rem 0 0; font-size: 0.85rem; font-weight: 700; min-height: 1.2em; }
.jump-verdict.verdict-clear { color: #00e0a0; }
.jump-verdict.verdict-zone { color: #ffb020; }
.jump-verdict.verdict-core { color: #ff5050; }
.jump-submit-btn:disabled { opacity: 0.6; cursor: default; }

/* CC_193 — Smartphone: Karte über den Eingaben statt daneben. Nebeneinander ragte das
   Eingabefeld rechts aus dem Bild, die Felder waren nur halb sichtbar. */
@media (max-width: 760px) {
    .jump-puzzle-main {
        flex-direction: column;
        flex-wrap: wrap;
        align-items: stretch;
    }
    .jump-map-panel,
    .jump-map-wrapper {
        max-width: 100%;
        flex-shrink: 1;
    }
    .jump-input-panel {
        min-width: 0;
        flex-basis: auto;
    }
}
