/* ===== Base layout & typography ===== */
body {
    background-color: #121212;
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}
h1 { margin: 1.5rem 0; font-size: 2rem; text-align: center; width: 100%; }
h2, h3 { text-align: center; margin: 1rem 0; }
.top-element { margin-top: 5rem; }

/* ===== Views & stacks (replaces ID-based container styles) ===== */
.view {
    margin: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.stack-center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== Utilities (replaces former inline styles) ===== */
.mb-2_5 { margin-bottom: 2.5rem; }
.m-1 { margin: 1rem; }

/* ===== Buttons ===== */
button {
    background-color: #000;
    color: #fff;
    border: 2px solid #fff;
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 999px;
    cursor: pointer;
    margin: 0.75rem 0;
}
button:hover { background-color: #111; border-color: #ccc; }
button:active { transform: scale(0.98); }

/* Visible focus for keyboard users */
button:focus-visible, a:focus-visible, input:focus-visible {
    outline: 3px solid #7aa2ff;
    outline-offset: 2px;
}

/* Slider level adjust lable */
.level-label {
    display: block;
    text-align: center;
    margin-bottom: 0.5rem;
}

/* Generate buttons (replaces #generateBtn… rules) */
.generate-btn {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-top: 2.5rem;
}
.generate-btn:disabled {
    background-color: #121212;
    color: #666;
    border: 1px solid #999;
    opacity: 0.7;
    cursor: not-allowed;
}

/* Cooldown text (replaces #cooldownText… rules) */
.cooldown-text {
    margin-top: 1.5rem;
    display: block;
    text-align: center;
    width: 100%;
}

/* ===== Inputs & sliders ===== */
input[type="text"],
input[type="password"] {
    width: 200px;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #121212;
    color: white;
}
input[type="range"] {
    -webkit-appearance: none;
    width: 200px;
    height: 6px;
    background: #444;
    border-radius: 5px;
    outline: none;
}
/* Chrome, Safari, Edge */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #000;
}
/* Firefox */
input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #000;
}

/* Chrome autofill fix */
input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px #121212 inset !important;
    -webkit-text-fill-color: #fff !important;
    caret-color: #fff !important;
}

/* ===== State helpers ===== */
.hidden { display: none !important; }
/* prevent focusing hidden sections */
[inert] { pointer-events: none; }

/* ===== Blocks ===== */
.inner-generate-block { display: block; width: 100%; max-width: 640px; }
.slider-block { margin: 1.5rem; text-align: center; }
.slider-block label { display: block; margin-bottom: 0.5rem; }
.exit-button { margin-top: 5rem; margin-bottom: 5rem; }
.exit-composer-room { margin-top: 2.5rem; margin-bottom: 5rem; }

/* ===== Gallery ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 220px);
    gap: 12px;
    justify-content: center;
    width: 100%;
    max-width: 960px;
    margin: 1rem auto;
}
.gallery-grid a { width: 220px; }
.gallery-grid img { display: block; width: 100%; height: auto; border-radius: 8px; }
.gallery-grid .empty-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1rem 0;
    opacity: 0.85;
}

/* Study "latest" layout (replaces #studyLatest rules) */
.gallery-grid.study-latest { grid-template-columns: 220px; justify-content: center; }

@media (max-width: 500px) {
    .gallery-grid { grid-template-columns: repeat(auto-fill, 160px); }
    .gallery-grid a { width: 160px; }
    .gallery-grid.study-latest { grid-template-columns: 160px; }
}

/* ===== Composer portraits ===== */
.composer-img {
    max-width: 200px; height: auto; display: block; margin: 1rem auto;
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Center the two composer action buttons */
.composer .play-btn,
.composer .exit-composer-room {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Ensure composer stack centers its children */
.composer {
    display: flex;
    flex-direction: column;
    align-items: center; /* keep this */
}

/* Center the generate section inside composer rooms */
.composer .inner-generate-block {
    width: min(100%, 640px);
    margin-left: auto;
    margin-right: auto;
    align-self: center; /* belt-and-suspenders with the flex parent */
}

/* Form layout */
.form {
    display: flex;
    flex-direction: column;
    align-items: center;      /* centrer hele formularen på siden */
}

/* Et felt (label + input) */
.form-group {
    width: 200px;             /* matcher input-bredden */
    margin: 0.75rem 0;        /* lodret spacing mellem felter */
}

/* Label matcher knap-typografi og venstrejusteres mod input */
.form-label {
    display: block;
    width: 100%;              /* følger .form-group (200px) */
    margin-bottom: 0.35rem;
    text-align: left;
    font-size: 1rem;          /* som knapper */
    font-weight: bold;        /* som knapper */
}

/* Sørg for at input udfylder gruppens bredde */
.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
}

/* Knapperne i formularen */
.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 0.75rem;
}

/* Statusbesked under formularen (samme venstre kant som felter) */
.form-message {
    width: 200px;
    margin: 0.5rem auto 0;    /* centrer boksen, men hold tekst venstre */
    text-align: left;
    min-height: 1.25rem;      /* undgå hop når der skiftes tekst */
}

/* (Valgfrit) hvis du hellere vil bruge klasser i JS end .style.color */
.form-message.success { color: lightgreen; }
.form-message.error   { color: tomato; }


