/* ============================================================
   Michel Ney — Français Impérial Estetik
   ============================================================ */

:root {
    --cream:          #f5f0e6;
    --dark-navy:      #0b1220;
    --french-blue:    #1e4a8a;
    --royal-blue:     #2556a6;
    --gold:           #c9a84c;
    --imperial-red:   #bf1a2f;
    --overlay-heavy:  rgba(6, 10, 22, 0.86);
    --overlay-mid:    rgba(6, 10, 22, 0.66);
    --overlay-light:  rgba(6, 10, 22, 0.30);

    /* Bakåtkompatibilitet för ärvda klasser */
    --dark-brown:     var(--dark-navy);
    --blood-red:      var(--imperial-red);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:focus-visible { outline: none; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible { outline: 1px solid rgba(200, 169, 110, 0.5); outline-offset: 2px; }

html, body {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    background: var(--dark-navy);
}

body {
    font-family: 'Crimson Text', Georgia, serif;
    color: var(--cream);
    font-size: 18px;
}

/* ── Shared: bakgrundsbild ── */
.bg-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    filter: sepia(0.2) brightness(0.62);
    z-index: 0;
    transition: background-image 1.2s ease;
}

/* ── Shared: stämpeldekor ── */
.stamp {
    display: inline-block;
    font-family: 'Playfair Display', serif;
    font-size: 0.65rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--gold);
    border: 1.5px solid var(--gold);
    padding: 0.2rem 0.9rem;
    margin-bottom: 1.4rem;
    opacity: 0.85;
}
.stamp.red { color: var(--imperial-red); border-color: var(--imperial-red); }
.stamp.gold { color: var(--gold); border-color: var(--gold); }

/* ── Shared: ornament ── */
.ornament {
    color: var(--gold);
    letter-spacing: 0.6em;
    margin: 1.4rem 0;
    opacity: 0.65;
    text-align: center;
    font-size: 0.9rem;
}

/* ── Shared: trikolorstreck ── */
.tricolor-bar {
    display: flex;
    height: 3px;
    width: 100%;
    margin-bottom: 1.2rem;
}
.tricolor-bar span:nth-child(1) { flex: 1; background: var(--french-blue); }
.tricolor-bar span:nth-child(2) { flex: 1; background: var(--cream); opacity: 0.6; }
.tricolor-bar span:nth-child(3) { flex: 1; background: var(--imperial-red); }

/* ============================================================
   STARTSKÄRM
   ============================================================ */
.start-screen {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.start-screen .bg-image {
    position: fixed;
}

.start-overlay {
    position: relative;
    z-index: 1;
    max-width: 660px;
    width: 92%;
    margin: auto;
    padding: 4.5rem 3.5rem;
    background: var(--overlay-heavy);
    border: 1px solid rgba(201, 168, 76, 0.35);
    box-shadow: 0 0 80px rgba(0,0,0,0.9), inset 0 0 40px rgba(0,0,0,0.4);
    text-align: center;
}

.game-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--cream);
    margin-bottom: 0.4rem;
}

.game-subtitle {
    font-style: italic;
    font-size: 1rem;
    color: rgba(245, 240, 232, 0.6);
    margin-bottom: 1.6rem;
}

.intro-text {
    text-align: left;
    font-size: 1rem;
    line-height: 1.75;
    color: rgba(245, 240, 232, 0.82);
    margin-bottom: 1.8rem;
}
.intro-text p + p { margin-top: 0.7rem; }
.intro-text strong { color: var(--cream); }

.start-metrics {
    display: flex;
    justify-content: space-around;
    padding: 1rem 0;
    border-top: 1px solid rgba(201, 168, 76, 0.25);
    border-bottom: 1px solid rgba(201, 168, 76, 0.25);
    margin-bottom: 1.8rem;
}
.start-metric { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.sm-label {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(245, 240, 232, 0.45);
}
.sm-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
}
.sm-value.green { color: #90b890; }
.sm-value.gold  { color: var(--gold); }

.btn-start {
    font-family: 'Playfair Display', serif;
    font-size: 0.95rem;
    letter-spacing: 0.18em;
    color: var(--cream);
    background: transparent;
    border: 1px solid var(--gold);
    padding: 0.7rem 2.6rem;
    cursor: pointer;
    transition: background 0.25s, color 0.25s;
    margin-bottom: 1.2rem;
}
.btn-start:hover:not(:disabled) { background: var(--gold); color: var(--dark-navy); }
.btn-start:disabled { opacity: 0.45; cursor: default; }
.btn-resume-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}
.btn-resume-group .btn-start { margin-bottom: 0; }
.btn-resume { border-color: rgba(201, 168, 76, 0.55); }
.btn-desert {
    border-color: rgba(191, 26, 47, 0.4);
    color: rgba(245, 240, 232, 0.6);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}
.btn-desert:hover:not(:disabled) { background: rgba(191, 26, 47, 0.55); color: var(--cream); }
.btn-desert-sub {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    font-style: italic;
    opacity: 0.7;
    text-transform: none;
}

.start-name-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.4rem;
}
.start-name-input {
    font-family: 'Playfair Display', serif;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    color: var(--cream);
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(201, 168, 76, 0.45);
    padding: 0.35rem 0.6rem;
    text-align: center;
    width: 220px;
    outline: none;
    transition: border-color 0.2s;
}
.start-name-input::placeholder { color: rgba(245, 240, 232, 0.3); }
.start-name-input:focus { border-bottom-color: var(--gold); }
.start-name-error {
    font-size: 0.72rem;
    color: #c07070;
    letter-spacing: 0.05em;
}

.disclaimer {
    font-style: italic;
    font-size: 0.78rem;
    color: rgba(245, 240, 232, 0.35);
}

/* ============================================================
   SPELSKÄRM
   ============================================================ */
.game-screen {
    position: relative;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.game-overlay {
    position: relative;
    z-index: 1;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Mätarlist ── */
.metrics-bar {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 2rem;
    background: rgba(4, 8, 18, 0.96);
    position: relative;
}
/* Trikolorgräns under mätarlisten */
.metrics-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        to right,
        var(--french-blue) 33.33%,
        rgba(245, 240, 232, 0.75) 33.33%,
        rgba(245, 240, 232, 0.75) 66.66%,
        var(--imperial-red) 66.66%
    );
}

.act-info { display: flex; flex-direction: column; gap: 0.1rem; }
.act-label {
    font-family: 'Playfair Display', serif;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: rgba(245, 240, 232, 0.65);
}

.metrics { display: flex; align-items: center; gap: 1rem; }
.metrics-values { display: flex; gap: 2.5rem; align-items: center; }
.metric { display: flex; align-items: baseline; gap: 0.6rem; }
.metric-label {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(245, 240, 232, 0.42);
    text-align: right;
}

.metric-casualties {
    font-family: 'Playfair Display', serif;
    font-size: 0.85rem;
    color: var(--imperial-red);
    transition: color 0.6s;
}

.metric-honor-group { display: flex; align-items: baseline; gap: 0.6rem; }

.audio-control {
    position: relative;
}
.audio-menu-btn {
    background: transparent;
    border: none;
    color: rgba(201, 168, 76, 0.45);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 0.2rem;
    display: flex;
    align-items: center;
    line-height: 1;
    transition: color 0.2s;
}
.audio-menu-btn:hover,
.audio-menu-btn.active { color: var(--gold); }
.audio-btn-icon {
    height: 1.1rem;
    width: auto;
    display: block;
    transition: filter 0.2s;
}
.audio-menu-btn:hover .audio-btn-icon,
.audio-menu-btn.active .audio-btn-icon {
    filter: drop-shadow(0 0 4px rgba(201, 168, 76, 0.9));
}
.metric-label-icon {
    display: none;
    height: 1rem;
    width: auto;
    align-self: center;
    transition: filter 0.2s;
}
.metric:hover .metric-label-icon {
    filter: drop-shadow(0 0 4px rgba(201, 168, 76, 0.9));
}
.audio-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
}
.audio-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 1000;
    background: rgba(8, 14, 28, 0.97);
    border: 1px solid rgba(201, 168, 76, 0.3);
    padding: 0.75rem 1rem;
    min-width: 190px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}
.audio-panel-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(201, 168, 76, 0.85);
    font-family: 'Playfair Display', serif;
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
}
.audio-panel-row input[type="checkbox"] {
    accent-color: var(--gold);
    cursor: pointer;
}
.audio-slider {
    width: 100%;
    accent-color: var(--gold);
    cursor: pointer;
    margin: 0;
}
@supports (-webkit-touch-callout: none) {
    .audio-slider { display: none; }
}

/* ── Hälsomätare ── */
.honor-bar-container {
    width: 90px;
    height: 7px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(30, 74, 138, 0.35);
}
.honor-bar {
    height: 100%;
    background: var(--french-blue);
    transition: width 0.9s ease-out;
}
.honor-bar--critical {
    background: var(--imperial-red);
}

/* ── Äravärde ── */
.metric-honor-value {
    font-family: 'Playfair Display', serif;
    font-size: 0.85rem;
    color: var(--gold);
    min-width: 32px;
}

/* ── Ney-porträtt (hälsoindikator) ── */
.ney-portrait {
    position: absolute;
    top: 0;
    right: 0;
    width: 105px;
    height: 125px;
    background-image: url('/images/health.png');
    background-size: 500% 200%;
    background-repeat: no-repeat;
    border-left: 2px solid rgba(30, 74, 138, 0.35);
    border-bottom: 2px solid rgba(30, 74, 138, 0.35);
    box-shadow: -4px 4px 20px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    z-index: 2;
}

@keyframes portrait-flash {
    0%   { opacity: 1; }
    25%  { opacity: 0.15; }
    50%  { opacity: 1; }
    75%  { opacity: 0.4; }
    100% { opacity: 1; }
}

.ney-portrait--flash {
    animation: portrait-flash 0.55s ease-out;
}

/* ── Scencontainer ── */
.scene-container {
    flex: 1;
    min-height: 0;
    position: relative;
}

.scene-scroll {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 2.5rem 2rem;
    background: linear-gradient(
        to top,
        rgba(4, 8, 18, 0.98)  0%,
        var(--overlay-heavy)  28%,
        var(--overlay-mid)    56%,
        var(--overlay-light)  78%,
        transparent           100%
    );
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    gap: 1rem;
}

.scene-spacer { flex: 1; min-height: 0; }

/* ── Textplatta ── */
.scene-panel {
    position: relative;
    background: rgba(4, 8, 18, 0.90);
    border: 1px solid rgba(30, 74, 138, 0.28);
    border-left: 3px solid var(--french-blue);
    padding: 1.5rem 1.75rem;
    padding-right: calc(105px + 1.75rem);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-width: 760px;
    backdrop-filter: blur(3px);
    box-shadow: 0 6px 40px rgba(0,0,0,0.7), inset 0 1px 0 rgba(30,74,138,0.08);
    animation: scene-enter 0.7s ease both;
}

/* ── Sekundära handlingsknappar (stöd/feedback) ── */
.action-footer {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.9rem;
}
.action-btn {
    flex: 1;
    font-family: 'Crimson Text', serif;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(245, 240, 232, 0.5);
    background: transparent;
    border: 1px solid rgba(30, 74, 138, 0.25);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: color 0.2s, border-color 0.2s;
}
.action-btn:hover {
    color: rgba(245, 240, 232, 0.85);
    border-color: rgba(30, 74, 138, 0.6);
}
.action-btn--pulse {
    animation: pulse-blue 2.4s ease-in-out 2;
}
.action-btn--pulse:hover {
    animation: none;
}
@keyframes pulse-blue {
    0%   { border-color: rgba(30, 74, 138, 0.25); color: rgba(245, 240, 232, 0.5); box-shadow: none; }
    50%  { border-color: rgba(30, 74, 138, 0.7); color: rgba(245, 240, 232, 0.9); box-shadow: 0 0 8px rgba(30, 74, 138, 0.3); }
    100% { border-color: rgba(30, 74, 138, 0.25); color: rgba(245, 240, 232, 0.5); box-shadow: none; }
}

/* ── Scenhuvud ── */
.scene-header {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(201, 168, 76, 0.20);
}
.scene-date {
    font-family: 'Playfair Display', serif;
    font-size: 0.68rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.92;
}
.scene-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.55rem;
    color: var(--cream);
    font-weight: 700;
    text-shadow: 0 2px 12px rgba(0,0,0,0.7);
}
.scene-location {
    font-size: 0.78rem;
    font-style: italic;
    color: rgba(245, 240, 232, 0.50);
    letter-spacing: 0.04em;
}

/* ── Scentext ── */
.scene-text { max-width: 740px; }
.scene-text p {
    font-size: 1.12rem;
    line-height: 1.78;
    color: rgba(245, 240, 232, 0.92);
    margin-bottom: 0.6rem;
}

/* ── Hint ── */
.hint-text {
    max-width: 740px;
    padding: 0.45rem 1rem;
    border-left: 2px solid var(--french-blue);
    color: rgba(245, 240, 232, 0.65);
    font-size: 0.92rem;
    font-style: italic;
}

/* ── API-felmeddelande ── */
.api-error-panel {
    max-width: 740px;
    padding: 1rem 1.2rem;
    border-left: 2px solid rgba(191, 26, 47, 0.7);
    margin-top: 1rem;
}

.api-error-text {
    color: rgba(245, 240, 232, 0.65);
    font-size: 0.9rem;
    font-style: italic;
    margin: 0 0 1rem;
}

.btn-retry {
    font-family: 'Playfair Display', serif;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: transparent;
    color: var(--gold);
    border: 1px solid rgba(201, 168, 76, 0.5);
    padding: 0.45rem 1.1rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.btn-retry:hover { background: rgba(201, 168, 76, 0.12); border-color: var(--gold); }

.btn-advance {
    font-family: 'Playfair Display', serif;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    background: transparent;
    color: var(--gold);
    border: 1px solid rgba(201, 168, 76, 0.55);
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 1rem;
    width: 8rem;
    height: 2.2rem;
    margin-left: auto;
    margin-right: auto;
    transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}
.btn-advance:hover:not(:disabled) {
    background: rgba(201, 168, 76, 0.12);
    border-color: var(--gold);
}
.btn-advance:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ── Olycksrapport ── */
.olycka-rapport {
    max-width: 740px;
    padding: 0.4rem 1rem;
    border-left: 2px solid #8b1c1c;
    color: rgba(220, 180, 180, 0.75);
    font-size: 0.88rem;
    font-style: italic;
    margin-top: 0.25rem;
}

/* ── Karaktärspanel (placeholder — ersätts med Ney-assets) ── */
.character-portrait {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border: 1px solid rgba(201, 168, 76, 0.30);
    filter: sepia(0.15) brightness(0.9);
    flex-shrink: 0;
}

/* ── Val-etikett ── */
.choices-label {
    font-family: 'Playfair Display', serif;
    font-size: 0.72rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(201, 168, 76, 0.65);
    margin-bottom: 0.25rem;
    padding-bottom: 0.1rem;
}

/* ── Val-knappar ── */
.choices-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    max-width: 740px;
}
.choice-button {
    font-family: 'Crimson Text', serif;
    font-size: 0.97rem;
    line-height: 1.45;
    color: rgba(245, 240, 232, 0.88);
    background: rgba(4, 8, 18, 0.82);
    border: 1px solid rgba(30, 74, 138, 0.35);
    padding: 0.75rem 1.1rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.choice-button:hover:not(:disabled) {
    background: rgba(30, 74, 138, 0.16);
    border-color: rgba(30, 74, 138, 0.75);
    color: var(--cream);
}
.choice-button:disabled { opacity: 0.35; cursor: default; }

/* ── Nästa scen ── */
.outcome-panel {
    padding-left: 1rem;
    margin-top: 0.5rem;
}

.transition-video {
    display: block;
    width: 100%;
    max-width: 480px;
    margin-top: 1rem;
    border-radius: 4px;
    border: 1px solid rgba(30, 74, 138, 0.4);
}
.next-scene-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}
.btn-next-scene {
    font-family: 'Playfair Display', serif;
    font-size: 0.85rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--cream);
    background: transparent;
    border: 1px solid rgba(30, 74, 138, 0.60);
    padding: 0.6rem 2rem;
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.btn-next-scene:hover {
    background: rgba(191, 26, 47, 0.18);
    border-color: rgba(191, 26, 47, 0.75);
    color: var(--cream);
}

/* ── Laddning ── */
.loading-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
}
.initial-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    font-family: 'Playfair Display', serif;
    color: rgba(245, 240, 232, 0.6);
}
.loading-label {
    font-style: italic;
    font-size: 0.82rem;
    color: rgba(245, 240, 232, 0.45);
    margin-left: 0.25rem;
}
.dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--gold);
    border-radius: 50%;
    animation: blink 1.4s ease-in-out infinite;
}
.dot:nth-child(2) { animation-delay: 0.22s; }
.dot:nth-child(3) { animation-delay: 0.44s; }
@keyframes blink {
    0%, 100% { opacity: 0.25; transform: scale(0.75); }
    50%       { opacity: 1;    transform: scale(1);    }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes scene-enter {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   SLUTSKÄRM
   ============================================================ */
.end-screen .bg-image {
    position: fixed;
}

.end-screen {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.end-overlay {
    position: relative;
    z-index: 1;
    max-width: 700px;
    width: 92%;
    padding: 2.8rem 3.5rem;
    background: var(--overlay-heavy);
    border: 1px solid rgba(201, 168, 76, 0.28);
    text-align: center;
    margin: 2rem auto;
}
.end-overlay h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.score-section { display: flex; flex-direction: column; gap: 1.2rem; margin-bottom: 1.6rem; }
.score-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem 1.2rem;
    border: 1px solid rgba(30, 74, 138, 0.22);
    text-align: left;
}
.score-label {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(245, 240, 232, 0.42);
}
.score-value {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
}
.score-value.red   { color: var(--imperial-red); }
.score-value.gold  { color: var(--gold); }
.score-value.green { color: #90b890; }
.score-historical {
    font-size: 0.78rem;
    color: rgba(245, 240, 232, 0.35);
    font-style: italic;
}
.score-comment {
    font-size: 0.88rem;
    color: rgba(245, 240, 232, 0.68);
}

.end-honor-bar-wrap {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(30, 74, 138, 0.28);
    margin: 0.3rem 0;
}
.end-honor-bar { height: 100%; background: var(--french-blue); transition: width 1.2s ease-out; }

.end-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    margin-top: 1.6rem;
}

.narration {
    font-size: 0.97rem;
    line-height: 1.82;
    color: rgba(245, 240, 232, 0.78);
    text-align: left;
    margin-bottom: 1.4rem;
}
.final-message {
    font-style: italic;
    font-size: 0.88rem;
    color: rgba(245, 240, 232, 0.48);
    margin-bottom: 2rem;
}

.btn-restart {
    font-family: 'Playfair Display', serif;
    font-size: 0.82rem;
    letter-spacing: 0.18em;
    color: rgba(245, 240, 232, 0.5);
    background: transparent;
    border: 1px solid rgba(245, 240, 232, 0.18);
    padding: 0.55rem 1.8rem;
    cursor: pointer;
    transition: color 0.25s, border-color 0.25s;
}
.btn-restart:hover { color: var(--cream); border-color: rgba(245, 240, 232, 0.5); }

/* ============================================================
   RECONNECT-MODAL
   ============================================================ */
#components-reconnect-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(6, 10, 22, 0.90);
    align-items: center;
    justify-content: center;
}
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

.reconnect-panel {
    max-width: 440px;
    width: 90%;
    padding: 2.4rem 2.8rem;
    background: var(--overlay-heavy);
    border: 1px solid rgba(201, 168, 76, 0.35);
    box-shadow: 0 0 60px rgba(0,0,0,0.9);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
}

.reconnect-emblem {
    color: var(--gold);
    font-size: 1.6rem;
    opacity: 0.7;
    letter-spacing: 0.5em;
}

.reconnect-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    color: var(--cream);
    display: none;
}
.reconnect-body {
    font-size: 0.92rem;
    line-height: 1.7;
    color: rgba(245, 240, 232, 0.65);
    font-style: italic;
    display: none;
}
.reconnect-dots { display: none; }
.reconnect-btn {
    display: none;
    font-family: 'Playfair Display', serif;
    font-size: 0.82rem;
    letter-spacing: 0.15em;
    color: var(--cream);
    background: transparent;
    border: 1px solid var(--gold);
    padding: 0.55rem 1.8rem;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.2s, color 0.2s;
}
.reconnect-btn:hover { background: var(--gold); color: var(--dark-navy); }

/* Visa rätt innehåll per tillstånd */
.components-reconnect-show  [data-reconnect] { display: block; }
.components-reconnect-show  .reconnect-dots  { display: flex; gap: 0.5rem; justify-content: center; }
.components-reconnect-failed  [data-failed]  { display: block; }
.components-reconnect-rejected [data-rejected] { display: block; }

/* ============================================================
   RESPONSIVT
   ============================================================ */
@media (max-width: 680px) {
    .choices-container { grid-template-columns: 1fr; }
    .start-overlay, .end-overlay { padding: 2rem 1.5rem; }
    .game-title { font-size: 2rem; }
    .scene-scroll { padding: 1rem 1.2rem 1.5rem; }
    .scene-panel { padding: 1rem 1.1rem; }

    /* Kompakt metrics-bar på mobil */
    .metrics-bar { padding: 0.4rem 0.8rem; }
    .act-info { display: none; }
    .metrics { gap: 0.6rem; flex-wrap: nowrap; width: 100%; justify-content: space-between; }
    .metrics-values { gap: 0.8rem; flex-wrap: nowrap; overflow: hidden; min-width: 0; }
    .audio-menu-btn { min-height: 2.75rem; min-width: 2.75rem; justify-content: center; padding: 0; }
    .metric { gap: 0.25rem; align-items: center; }
    .metric-label { font-size: 0.58rem; }
    .metric-label-text { display: none; }
    .metric-label-icon { display: inline-block; }
    .metric-casualties { font-size: 0.92rem; min-width: unset; line-height: 1; transform: translateY(-2px); }
    .honor-bar-container { width: 50px; }
    .metric-honor-value { font-size: 0.78rem; min-width: 26px; line-height: 1; transform: translateY(-2px); }

    /* Mer bild synlig – gradienten börjar längre ned */
    .scene-scroll {
        background: linear-gradient(
            to top,
            rgba(4, 8, 18, 0.98) 0%,
            var(--overlay-heavy) 22%,
            var(--overlay-mid)   48%,
            var(--overlay-light) 70%,
            transparent          100%
        );
    }
}

@media (max-width: 400px) {
    .metrics-bar { padding: 0.35rem 0.6rem; }
    .metrics { gap: 0.5rem; }
    .metrics-values { gap: 0.6rem; }
    .honor-bar-container { display: none; }
    .audio-menu-btn { font-size: 0.85rem; }
    .ney-portrait { display: none; }
    .scene-panel { padding-right: 1.1rem; }
}

/* ============================================================
   ADMIN
   ============================================================ */
.admin-login,
.admin-page {
    height: 100dvh;
    overflow-y: auto;
    background: var(--dark-navy);
    color: var(--cream);
    font-family: 'Crimson Text', Georgia, serif;
    padding: 2rem;
}

.admin-login {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
}

.admin-login h1,
.admin-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 0.5rem;
    gap: 1.2rem;
}
.admin-page h1 {
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    font-size: 1.6rem;
}
.admin-logout {
    margin-left: auto;
    background: transparent;
    border: none;
    font-family: 'Playfair Display', serif;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(245, 240, 232, 0.3);
    cursor: pointer;
    transition: color 0.2s;
}
.admin-logout:hover { color: var(--imperial-red); }

.admin-login form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 320px;
}

.admin-login input[type="email"],
.admin-login input[type="password"] {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--gold);
    color: var(--cream);
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 2px;
    outline: none;
}

.admin-login button {
    font-family: 'Playfair Display', serif;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 0.4rem 1.4rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.admin-login button:hover { background: var(--gold); color: var(--dark-navy); }

.admin-error   { color: var(--imperial-red); font-size: 0.9rem; }
.admin-success { color: var(--gold); font-size: 0.9rem; }
.admin-back-link { font-size: 0.85rem; color: var(--gold); opacity: 0.7; text-decoration: none; }
.admin-back-link:hover { opacity: 1; }

.admin-chart-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.admin-chart-toggle-btn {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-family: 'Playfair Display', serif;
    font-size: 0.85rem;
    padding: 0.25rem 0.85rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.admin-chart-toggle-btn:hover { opacity: 0.8; }

.admin-chart-toggle-btn--active {
    background: rgba(201, 168, 76, 0.15);
    opacity: 1;
}

.admin-grand-total {
    font-size: 0.95rem;
    color: var(--gold);
    margin-bottom: 1.5rem;
}

.admin-group-heading {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--gold);
    margin: 1.8rem 0 0.5rem;
    border-bottom: 1px solid rgba(201,168,76,0.3);
    padding-bottom: 0.25rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
}

.admin-table th,
.admin-table td {
    padding: 0.3rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.admin-table th {
    color: var(--gold);
    font-family: 'Playfair Display', serif;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    font-weight: normal;
}

.admin-table td.num,
.admin-table th.num { text-align: right; }

.admin-table td.mono { font-family: 'Courier New', monospace; font-size: 0.8rem; }

.admin-session-delete-cell { width: 2rem; text-align: center; }
.admin-session-delete-cell .admin-feedback-btn--delete { padding: 0.1rem 0.4rem; font-size: 0.75rem; }

.admin-session-row--active { background: rgba(80, 160, 80, 0.07); }
.admin-session-row--deserted { opacity: 0.6; }
.admin-deserted-badge {
    display: inline-block;
    margin-right: 4px;
    vertical-align: middle;
    font-size: 0.65rem;
    color: rgba(191, 26, 47, 0.85);
    cursor: default;
}
.admin-device-badge {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.05rem 0.35rem;
    font-family: monospace;
    font-size: 0.7rem;
    color: rgba(201, 168, 76, 0.75);
    border: 1px solid rgba(201, 168, 76, 0.3);
    vertical-align: middle;
    cursor: default;
    letter-spacing: 0.05em;
}

.admin-active-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
    box-shadow: 0 0 4px #4caf50;
    animation: pulse-green 2s ease-in-out infinite;
}
.admin-active-dot--inline { margin-right: 4px; vertical-align: middle; }

.admin-col-indicator {
    width: 18px;
    min-width: 18px;
    text-align: center;
    padding-left: 4px !important;
    padding-right: 4px !important;
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.admin-circuit-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.7rem;
    margin-bottom: 0.6rem;
    background: rgba(40, 60, 40, 0.35);
    border: 1px solid rgba(80, 160, 80, 0.25);
    border-radius: 3px;
    font-size: 0.82rem;
    color: #b0c8b0;
}
.admin-circuit-sep { color: #555; }
.admin-circuit-item { display: flex; align-items: center; gap: 0.35rem; }

.admin-subtotal td {
    font-weight: bold;
    color: var(--gold);
    border-top: 1px solid rgba(201,168,76,0.4);
    border-bottom: none;
}

/* ============================================================
   DONATIONSSIDA
   ============================================================ */
.donation-screen .bg-image {
    position: fixed;
}

.donation-screen {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.donation-curtain {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100dvh;
}

.donation-overlay {
    position: relative;
    z-index: 1;
    max-width: 640px;
    width: 92%;
    padding: 4rem 3.5rem;
    animation: fadeIn 1.2s ease both;
    background: var(--overlay-heavy);
    border: 1px solid rgba(201, 168, 76, 0.35);
    box-shadow: 0 0 80px rgba(0,0,0,0.9), inset 0 0 40px rgba(0,0,0,0.4);
    text-align: center;
    margin: auto;
}

.donation-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--cream);
    margin: 0.8rem 0 0.3rem;
    line-height: 1.2;
}

.donation-text {
    margin: 1.5rem 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    text-align: left;
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(245, 240, 232, 0.88);
}

.donation-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.donation-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 1rem 1.5rem;
    border: 1px solid rgba(201, 168, 76, 0.45);
    background: rgba(201, 168, 76, 0.08);
    color: var(--cream);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
    min-width: 110px;
}
.donation-btn:hover {
    background: rgba(201, 168, 76, 0.2);
    border-color: var(--gold);
}

.donation-btn-featured {
    border-color: var(--gold);
    background: rgba(201, 168, 76, 0.15);
}

.donation-amount {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--gold);
    line-height: 1;
}

.donation-label {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: rgba(245, 240, 232, 0.6);
}

.btn-donate {
    font-family: 'Playfair Display', serif;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    color: var(--gold);
    background: rgba(201, 168, 76, 0.12);
    border: 1px solid rgba(201, 168, 76, 0.55);
    padding: 0.65rem 2rem;
    cursor: pointer;
    margin-bottom: 0.8rem;
    display: block;
    width: 100%;
    transition: background 0.2s, border-color 0.2s;
}
.btn-donate:hover { background: rgba(201, 168, 76, 0.25); border-color: var(--gold); }

.btn-no-thanks {
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.85rem;
    font-style: italic;
    color: rgba(245, 240, 232, 0.35);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.3rem 0;
    transition: color 0.2s;
}
.btn-no-thanks:hover { color: rgba(245, 240, 232, 0.6); }

.swish-amount { color: #6DBBF0; }

.swish-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swish-modal {
    position: relative;
    background: var(--dark-navy);
    border: 1px solid rgba(201, 168, 76, 0.4);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 320px;
    width: 90%;
}

.swish-close {
    position: absolute;
    top: 0.6rem;
    right: 0.8rem;
    background: transparent;
    border: none;
    color: rgba(245, 240, 232, 0.5);
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.swish-close:hover { color: var(--cream); }

.swish-label {
    font-family: 'Playfair Display', serif;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--gold);
}

.swish-qr {
    width: 100%;
    max-width: 240px;
    display: block;
}

.swish-open-btn {
    margin-top: 0.5rem;
    padding: 0.6rem 1.4rem;
    background: #6DBBF0;
    color: #060e1c;
    border: none;
    border-radius: 4px;
    font-family: 'Playfair Display', serif;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.2s;
}

.swish-open-btn:hover { background: #8fcdf5; }

@media (max-width: 680px) {
    .donation-overlay { padding: 2.5rem 1.5rem; }
    .donation-title { font-size: 1.6rem; }
    .donation-buttons { gap: 0.7rem; }
    .donation-btn { padding: 0.8rem 1rem; min-width: 90px; }
}

@media (max-height: 500px) and (orientation: landscape) {
    .donation-overlay { padding: 1.2rem 1.5rem; margin: 0.5rem auto; }
    .donation-title { font-size: 1.4rem; margin: 0.4rem 0 0.2rem; }
    .donation-text { margin: 0.8rem 0 1rem; gap: 0.5rem; font-size: 0.88rem; line-height: 1.5; }
    .donation-buttons { margin-bottom: 1rem; gap: 0.5rem; }
    .donation-btn { padding: 0.6rem 0.8rem; min-width: 80px; }
    .donation-amount { font-size: 1.2rem; }
}

/* ============================================================
   INTERTITEL
   ============================================================ */
.intertitle-screen {
    position: absolute;
    inset: 0;
    background: #060e1c;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    animation: fadeIn 1.2s ease both;
}

.intertitle-border {
    max-width: 680px;
    width: 88%;
    padding: 3rem 4rem;
    border: 2px solid rgba(201, 168, 76, 0.6);
    outline: 1px solid rgba(201, 168, 76, 0.2);
    outline-offset: -10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;
}

.intertitle-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    line-height: 1.9;
    color: #e8d9a8;
    letter-spacing: 0.04em;
}

.intertitle-text span:first-child {
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.intertitle-continue {
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.8rem;
    font-style: italic;
    letter-spacing: 0.12em;
    color: rgba(220, 195, 130, 0.4);
}

@media (max-width: 680px) {
    .intertitle-border { padding: 2rem 1.8rem; }
    .intertitle-text { font-size: 1.05rem; }
    .intertitle-text span:first-child { font-size: 1.25rem; }
}


/* ============================================================
   FEEDBACK-DIALOG
   ============================================================ */
.feedback-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 20, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 600;
    animation: fadeIn 0.15s ease;
}

.feedback-modal {
    background: #0e1828;
    border: 1px solid rgba(30, 74, 138, 0.45);
    padding: 1.75rem;
    max-width: 440px;
    width: 92%;
    color: rgba(245, 240, 232, 0.85);
    box-shadow: 0 10px 40px rgba(0,0,0,0.7);
}

.feedback-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(30, 74, 138, 0.25);
}

.feedback-header-text { flex: 1; }

.feedback-kuk-stamp {
    font-family: 'Playfair Display', serif;
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.75;
    margin-bottom: 0.35rem;
}

.feedback-subtitle {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: var(--cream);
    line-height: 1.3;
}

.feedback-portrait {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 1px solid rgba(201, 168, 76, 0.30);
    filter: sepia(0.15) brightness(0.85);
    flex-shrink: 0;
}

.feedback-intro {
    font-style: italic;
    font-size: 0.82rem;
    color: rgba(245, 240, 232, 0.5);
    margin: 0 0 1.1rem;
    line-height: 1.5;
}

.feedback-form { display: flex; flex-direction: column; gap: 0.75rem; }

.feedback-field { display: flex; flex-direction: column; gap: 0.3rem; }

.feedback-label {
    font-family: 'Playfair Display', serif;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.7;
}

.feedback-input,
.feedback-textarea {
    background: rgba(5, 10, 22, 0.65);
    border: 1px solid rgba(30, 74, 138, 0.25);
    color: var(--cream);
    font-family: 'Crimson Text', serif;
    font-size: 0.95rem;
    padding: 0.45rem 0.65rem;
    outline: none;
    transition: border-color 0.2s;
    resize: vertical;
}
.feedback-input:focus,
.feedback-textarea:focus {
    border-color: rgba(30, 74, 138, 0.6);
}
.feedback-input::placeholder,
.feedback-textarea::placeholder {
    color: rgba(245, 240, 232, 0.25);
}

.feedback-error {
    font-size: 0.8rem;
    color: var(--imperial-red);
    margin: 0;
}

.feedback-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 0.25rem;
}

.feedback-btn-cancel,
.feedback-btn-submit,
.feedback-btn-close {
    font-family: 'Playfair Display', serif;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    border: 1px solid rgba(30, 74, 138, 0.35);
    padding: 0.45rem 1rem;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.feedback-btn-cancel {
    background: transparent;
    color: rgba(245, 240, 232, 0.45);
}
.feedback-btn-cancel:hover {
    color: rgba(245, 240, 232, 0.75);
    border-color: rgba(245, 240, 232, 0.3);
}

.feedback-btn-submit {
    background: rgba(30, 74, 138, 0.15);
    color: rgba(180, 210, 255, 0.85);
    border-color: rgba(30, 74, 138, 0.4);
}
.feedback-btn-submit:hover:not(:disabled) {
    background: rgba(30, 74, 138, 0.28);
    border-color: rgba(30, 74, 138, 0.7);
}
.feedback-btn-submit:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Success state */
.feedback-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    padding: 0.5rem 0;
    text-align: center;
}
.feedback-success-text {
    font-style: italic;
    font-size: 0.92rem;
    color: rgba(245, 240, 232, 0.7);
    line-height: 1.6;
    max-width: 300px;
}
.feedback-btn-close {
    background: transparent;
    color: rgba(30, 74, 138, 0.75);
    margin-top: 0.25rem;
}
.feedback-btn-close:hover {
    border-color: rgba(30, 74, 138, 0.7);
    color: var(--cream);
}

/* ============================================================
   BETA-TESTARDIALOG
   ============================================================ */
.beta-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 20, 0.84);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 650;
    animation: fadeIn 0.15s ease;
    overflow-y: auto;
    padding: 1.5rem 0.75rem;
}

.beta-dialog-modal {
    background: #0e1828;
    border: 1px solid rgba(30, 74, 138, 0.50);
    padding: 1.75rem 1.5rem;
    max-width: 520px;
    width: 100%;
    color: rgba(245, 240, 232, 0.88);
    box-shadow: 0 12px 48px rgba(0,0,0,0.75);
    flex-shrink: 0;
}

.beta-dialog-header {
    margin-bottom: 1.25rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(30, 74, 138, 0.28);
}

.beta-dialog-stamp {
    font-family: 'Playfair Display', serif;
    font-size: 0.7rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.75;
    margin-bottom: 0.45rem;
}

.beta-dialog-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: var(--cream);
    margin: 0;
    font-weight: normal;
}

.beta-dialog-body {
    font-size: 0.92rem;
    line-height: 1.65;
}

.beta-dialog-body p { margin: 0 0 0.85rem; }

.beta-dialog-list {
    padding-left: 1.3rem;
    margin: 0 0 0.85rem;
}

.beta-dialog-list li {
    margin-bottom: 0.6rem;
}

.beta-dialog-closing {
    font-style: italic;
    color: var(--gold);
    opacity: 0.85;
    font-family: 'Playfair Display', serif;
}

.beta-dialog-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.beta-dialog-btn {
    background: transparent;
    border: 1px solid rgba(201, 168, 76, 0.5);
    color: var(--gold);
    font-family: 'Playfair Display', serif;
    font-size: 0.88rem;
    letter-spacing: 0.06em;
    padding: 0.6rem 1.3rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.beta-dialog-btn:hover {
    border-color: var(--gold);
    background: rgba(201, 168, 76, 0.08);
}

/* ============================================================
   ADMIN — SYSTEMINSTÄLLNINGAR
   ============================================================ */
.admin-settings {
    max-width: 560px;
}

.admin-setting-row {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(30, 74, 138, 0.18);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.admin-setting-label {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-family: 'Playfair Display', serif;
    font-size: 0.95rem;
    color: var(--cream);
    cursor: pointer;
}

.admin-setting-checkbox {
    width: 1rem;
    height: 1rem;
    accent-color: var(--gold);
    cursor: pointer;
    flex-shrink: 0;
}

.admin-setting-description {
    margin: 0.55rem 0 0 1.65rem;
    font-size: 0.82rem;
    color: rgba(245, 240, 232, 0.5);
    line-height: 1.5;
}

.admin-announcement-controls {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.admin-announcement-textarea {
    width: 100%;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(30, 74, 138, 0.35);
    color: var(--cream);
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.95rem;
    padding: 0.6rem 0.75rem;
    resize: vertical;
    line-height: 1.5;
}

.admin-announcement-textarea:focus {
    outline: 1px solid rgba(30, 74, 138, 0.65);
    border-color: rgba(30, 74, 138, 0.55);
}

.admin-announcement-toggle {
    align-self: flex-start;
    background: rgba(30, 74, 138, 0.12);
    border: 1px solid rgba(30, 74, 138, 0.4);
    color: rgba(180, 210, 255, 0.85);
    font-family: 'Playfair Display', serif;
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.45rem 1.1rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.admin-announcement-toggle:hover {
    background: rgba(30, 74, 138, 0.22);
    border-color: rgba(30, 74, 138, 0.65);
}

.admin-announcement-toggle--active {
    background: rgba(191, 26, 47, 0.18);
    border-color: rgba(191, 26, 47, 0.55);
    color: #e07060;
}

.admin-announcement-toggle--active:hover {
    background: rgba(191, 26, 47, 0.28);
}

.admin-donation-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.admin-donation-label {
    font-size: 0.82rem;
    color: rgba(245, 240, 232, 0.6);
    white-space: nowrap;
}

.admin-donation-input {
    width: 120px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(30, 74, 138, 0.35);
    color: var(--cream);
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.95rem;
    padding: 0.45rem 0.6rem;
}

.admin-donation-input:focus {
    outline: 1px solid rgba(30, 74, 138, 0.65);
    border-color: rgba(30, 74, 138, 0.55);
}

.admin-donation-add {
    background: rgba(30, 74, 138, 0.12);
    border: 1px solid rgba(30, 74, 138, 0.4);
    color: rgba(180, 210, 255, 0.85);
    font-size: 1.2rem;
    line-height: 1;
    width: 2.1rem;
    height: 2.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.admin-donation-add:hover {
    background: rgba(30, 74, 138, 0.28);
}

.admin-donation-balance {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    padding: 0.3rem 0.9rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(30, 74, 138, 0.22);
}

.admin-donation-balance-label {
    font-family: 'Playfair Display', serif;
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(245, 240, 232, 0.4);
}

.admin-donation-balance-amount {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.02em;
    line-height: 1.15;
}

.admin-donation-balance--negative .admin-donation-balance-amount {
    color: #e07060;
}

/* ============================================================
   GLOBALMEDDELANDE — BANNER
   ============================================================ */
.announcement-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: rgba(8, 14, 30, 0.97);
    border-bottom: 2px solid var(--gold);
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    font-family: 'Playfair Display', serif;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    color: var(--cream);
    text-align: center;
    box-shadow: 0 2px 16px rgba(0,0,0,0.6);
    animation: banner-appear 0.3s ease;
}

.announcement-icon {
    color: var(--gold);
    font-size: 1rem;
    flex-shrink: 0;
}

@keyframes banner-appear {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ============================================================
   ADMIN — FLIKAR
   ============================================================ */
.admin-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(30, 74, 138, 0.25);
}

.admin-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(245, 240, 232, 0.45);
    font-family: 'Playfair Display', serif;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.5rem 1.2rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    position: relative;
    bottom: -1px;
}
.admin-tab:hover { color: rgba(245, 240, 232, 0.75); }
.admin-tab--active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}
.admin-tab--refresh {
    margin-left: auto;
    font-size: 1.1rem;
    letter-spacing: 0;
    padding: 0.5rem 0.8rem;
    opacity: 0.5;
}
.admin-tab--refresh:hover { opacity: 1; color: var(--gold); }

.admin-tab-badge {
    display: inline-block;
    background: var(--imperial-red);
    color: #fff;
    font-size: 0.65rem;
    font-family: 'Crimson Text', serif;
    border-radius: 50%;
    min-width: 1.2em;
    height: 1.2em;
    line-height: 1.2em;
    text-align: center;
    padding: 0 0.2em;
    margin-left: 0.35rem;
    letter-spacing: 0;
    text-transform: none;
    vertical-align: middle;
}
.admin-tab-badge--error { background: #8b1c1c; }

/* ============================================================
   ADMIN — API-FEL
   ============================================================ */
.admin-errors-header {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
}
.admin-errors-header .admin-group-heading { margin-bottom: 0; }

.admin-error-message {
    font-size: 0.82rem;
    color: rgba(245, 240, 232, 0.6);
    font-family: 'Courier New', monospace;
    word-break: break-word;
    max-width: 520px;
}

.admin-error-row--expandable { cursor: pointer; }
.admin-error-row--expandable:hover td { background: rgba(255,255,255,0.03); }
.admin-error-row--expanded td { border-bottom: none; }

.admin-error-category {
    display: inline-block;
    font-size: 0.65rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.4rem;
    border-radius: 2px;
    text-transform: uppercase;
    white-space: nowrap;
}
.admin-error-category--network,
.admin-error-category--timeout,
.admin-error-category--parse {
    background: rgba(30, 74, 138, 0.18);
    color: rgba(180, 210, 255, 0.9);
    border: 1px solid rgba(30, 74, 138, 0.35);
}
.admin-error-category--unknown {
    background: rgba(191, 26, 47, 0.2);
    color: rgba(220, 100, 100, 0.95);
    border: 1px solid rgba(191, 26, 47, 0.4);
}

.admin-error-expand-hint {
    font-size: 0.65rem;
    color: rgba(30, 74, 138, 0.7);
    margin-left: 0.5rem;
    vertical-align: middle;
}

.admin-error-trace-row td {
    padding: 0 0.8rem 0.8rem;
    background: rgba(0,0,0,0.25);
}

.admin-error-trace {
    margin: 0;
    font-size: 0.72rem;
    font-family: 'Courier New', monospace;
    color: rgba(245, 240, 232, 0.45);
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
}

/* ============================================================
   ADMIN — FEEDBACK-RAPPORTER
   ============================================================ */
.admin-feedback { display: flex; flex-direction: column; gap: 1rem; }

.admin-feedback-summary {
    font-size: 0.82rem;
    color: rgba(245, 240, 232, 0.45);
    margin: 0;
}

.admin-feedback-empty {
    font-style: italic;
    color: rgba(245, 240, 232, 0.35);
    font-size: 0.88rem;
}

.admin-feedback-card {
    border: 1px solid rgba(30, 74, 138, 0.28);
    padding: 1rem 1.1rem;
    background: rgba(8, 14, 24, 0.45);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    transition: opacity 0.2s;
}
.admin-feedback-card--resolved {
    opacity: 0.45;
    border-color: rgba(30, 74, 138, 0.12);
}

.admin-feedback-card-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    align-items: baseline;
}

.admin-feedback-name {
    font-family: 'Playfair Display', serif;
    font-size: 0.92rem;
    color: var(--gold);
}
.admin-feedback-email {
    font-size: 0.78rem;
    color: rgba(245, 240, 232, 0.5);
}
.admin-feedback-meta {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: rgba(245, 240, 232, 0.35);
}
.admin-feedback-date {
    margin-left: auto;
    font-size: 0.72rem;
    color: rgba(245, 240, 232, 0.3);
}

.admin-feedback-message {
    font-family: 'Crimson Text', serif;
    font-size: 0.93rem;
    line-height: 1.55;
    color: rgba(245, 240, 232, 0.8);
    white-space: pre-wrap;
    word-break: break-word;
}

.admin-feedback-card-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-end;
}

.admin-feedback-resolved-label {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(245, 240, 232, 0.3);
}

.admin-feedback-btn {
    background: transparent;
    border: 1px solid rgba(30, 74, 138, 0.28);
    color: rgba(180, 210, 255, 0.55);
    font-family: 'Playfair Display', serif;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.3rem 0.8rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.admin-feedback-btn:hover {
    border-color: rgba(30, 74, 138, 0.55);
    color: rgba(180, 210, 255, 0.9);
}
.admin-feedback-btn--resolve {
    color: rgba(100, 180, 100, 0.7);
    border-color: rgba(100, 180, 100, 0.25);
}
.admin-feedback-btn--resolve:hover {
    color: #7dcf7d;
    border-color: rgba(100, 180, 100, 0.6);
}
.admin-feedback-btn--delete {
    color: rgba(191, 26, 47, 0.6);
    border-color: rgba(191, 26, 47, 0.2);
}
.admin-feedback-btn--delete:hover {
    color: var(--imperial-red);
    border-color: rgba(191, 26, 47, 0.55);
}

/* --- Valutakurs & statistik --- */
.admin-exchange-rate {
    font-size: 0.78rem;
    color: rgba(245, 240, 232, 0.45);
    margin: -0.5rem 0 0.75rem;
}

/* --- Daglig statistik-graf --- */
.admin-stats { margin-top: 1rem; }

.admin-chart-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-chart-svg {
    width: 100%;
    min-width: 400px;
    display: block;
}

.chart-grid {
    stroke: rgba(245, 240, 232, 0.12);
    stroke-width: 1;
}

.chart-axis {
    stroke: rgba(245, 240, 232, 0.35);
    stroke-width: 1.5;
}

.chart-bar {
    fill: var(--gold);
    opacity: 0.82;
    transition: opacity 0.15s;
}

.chart-bar:hover { opacity: 1; }

.chart-ylabel {
    fill: rgba(245, 240, 232, 0.6);
    font-size: 11px;
    text-anchor: end;
    font-family: 'Courier New', monospace;
}

.chart-xlabel {
    fill: rgba(245, 240, 232, 0.55);
    font-size: 10px;
    text-anchor: end;
    font-family: 'Courier New', monospace;
}

.chart-axis-label {
    fill: rgba(245, 240, 232, 0.45);
    font-size: 11px;
    text-anchor: middle;
}

.scene-bar-label {
    fill: rgba(245, 240, 232, 0.7);
    font-size: 8px;
    font-family: 'Courier New', monospace;
    text-anchor: end;
}

.scene-bar-count {
    fill: var(--gold);
    font-size: 11px;
    font-family: 'Courier New', monospace;
    dominant-baseline: middle;
}

.chart-bar-zero {
    fill: rgba(245, 240, 232, 0.08);
}

/* ============================================================
   BETA-STÄMPEL
   ============================================================ */
.beta-stamp {
    position: absolute;
    top: 2.4rem;
    right: -1.8rem;
    z-index: 10;
    text-decoration: none;
    transform: rotate(32deg);
    transform-origin: top right;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.beta-stamp:hover { opacity: 1; }
.beta-stamp-text {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.35em;
    color: var(--imperial-red);
    border: 2px solid var(--imperial-red);
    padding: 0.1rem 0.7rem 0.05rem;
    line-height: 1;
    text-transform: uppercase;
}
.beta-stamp-date {
    font-family: 'Courier New', monospace;
    font-size: 1.0rem;
    letter-spacing: 0.1em;
    color: var(--imperial-red);
    margin-top: 0.2rem;
}

/* ============================================================
   VERSIONSHISTORIK
   ============================================================ */
.release-screen .bg-image {
    position: fixed;
}
.release-screen {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem 3rem;
}
.release-overlay {
    position: relative;
    z-index: 2;
    max-width: 680px;
    width: 100%;
    background: rgba(8, 14, 26, 0.92);
    border: 1px solid rgba(30, 74, 138, 0.28);
    padding: 2.5rem 2.5rem 2rem;
    margin: 2rem auto;
    text-align: center;
}
.release-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--gold);
    margin: 0.5rem 0 0;
    letter-spacing: 0.05em;
}
.release-version {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: rgba(245, 240, 232, 0.45);
    letter-spacing: 0.15em;
    margin: 0.2rem 0 0.8rem;
}
.release-content {
    text-align: left;
    margin-top: 1.5rem;
    color: rgba(245, 240, 232, 0.82);
    font-family: 'Crimson Text', serif;
    font-size: 1.05rem;
    line-height: 1.7;
}
.release-content h1 { display: none; }
.release-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: var(--gold);
    border-bottom: 1px solid rgba(30, 74, 138, 0.22);
    padding-bottom: 0.3rem;
    margin: 1.8rem 0 0.6rem;
    letter-spacing: 0.04em;
}
.release-content h2:first-of-type { margin-top: 0; }
.release-content h3 {
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(245, 240, 232, 0.55);
    margin: 1rem 0 0.3rem;
}
.release-content ul {
    margin: 0 0 0.5rem 1.2rem;
    padding: 0;
}
.release-content li { margin-bottom: 0.25rem; }
.release-content hr {
    border: none;
    border-top: 1px solid rgba(30, 74, 138, 0.18);
    margin: 1.5rem 0;
}
.release-content em { color: rgba(245, 240, 232, 0.4); font-size: 0.85rem; }
.release-content a { color: var(--gold); }
