/* ==========================================================================
   style.css
   --------------------------------------------------------------------------
   Mörkt tema: svart bakgrund, grå innehållsboxar och diskreta ramlinjer.
   ========================================================================== */

:root {
    --bg: #050505;
    --panel: #1a1a1a;
    --panel-soft: #222;
    --border: #444;
    --border-soft: #333;
    --text: #f2f2f2;
    --muted: #b8b8b8;
    --accent: #d2d2d2;
    --error: #ffb4b4;
    --success: #b9f6c1;
    --warning: #ffe6a3;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

.page-shell {
    width: min(980px, calc(100% - 32px));
    margin: 40px auto;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

h1,
h2 {
    margin-top: 0;
    line-height: 1.2;
}

.intro {
    color: var(--muted);
    max-width: 70ch;
}

fieldset {
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    margin: 0 0 18px;
    padding: 16px;
    background: var(--panel-soft);
}

legend {
    padding: 0 8px;
    color: var(--accent);
    font-weight: 700;
}

.choice-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

input,
select,
button {
    font: inherit;
}

input[type="text"],
select {
    width: 100%;
    background: #101010;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 6px;
}

button {
    cursor: pointer;
}

.button-primary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid #777;
    background: #eeeeee;
    color: #111;
    font-weight: 700;
}

.button-primary:hover {
    background: #ffffff;
}

.result-panel {
    text-align: center;
}

.result-word {
    font-size: clamp(2.2rem, 7vw, 5rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    margin: 28px 0 12px;
    overflow-wrap: anywhere;
}

.result-meta {
    color: var(--muted);
}

.error-box,
.notice {
    border-radius: 10px;
    padding: 12px 14px;
    margin: 14px 0;
}

.error-box,
.notice-error {
    background: rgba(255, 120, 120, 0.12);
    border: 1px solid rgba(255, 180, 180, 0.5);
    color: var(--error);
}

.notice-success {
    background: rgba(120, 255, 150, 0.12);
    border: 1px solid rgba(185, 246, 193, 0.5);
    color: var(--success);
}

.notice-warning {
    background: rgba(255, 220, 120, 0.12);
    border: 1px solid rgba(255, 230, 163, 0.5);
    color: var(--warning);
}

.notice-info {
    background: rgba(180, 180, 180, 0.12);
    border: 1px solid rgba(210, 210, 210, 0.35);
    color: var(--text);
}

.hidden {
    display: none;
}

.admin-form {
    display: grid;
    gap: 16px;
    max-width: 520px;
}

.admin-form label:not(.choice-row) {
    display: block;
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 10px;
}

th,
td {
    border-bottom: 1px solid var(--border-soft);
    padding: 10px 12px;
    text-align: left;
}

th {
    color: var(--accent);
    background: var(--panel-soft);
}

@media (max-width: 700px) {
    .page-shell {
        width: min(100% - 20px, 980px);
        margin: 20px auto;
    }

    .panel {
        padding: 18px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.generator-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.generator-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel-soft);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.generator-nav-link:hover,
.generator-nav-link.active {
    background: #eeeeee;
    color: #111;
    border-color: #eeeeee;
}

.choice-section {
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin-top: 18px;
}

.word-class-group {
    border: 1px solid var(--border);
    background: var(--panel-soft);
    border-radius: 10px;
    padding: 14px 16px 16px;
}

.group-heading {
    margin: 0 0 10px;
    font-size: 1.05rem;
    color: var(--text);
}

.choice-fieldset {
    margin: 0 0 10px;
    padding: 10px 12px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.choice-fieldset:last-child {
    margin-bottom: 0;
}

.choice-fieldset legend {
    padding: 0 6px;
    font-weight: 700;
    color: var(--muted);
}

.choice-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

.choice-row {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    white-space: nowrap;
    font-size: 0.95rem;
}

.choice-row input[type="checkbox"] {
    margin: 0;
}

.result-phrase {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    margin: 28px 0 12px;
    overflow-wrap: anywhere;
}