:root {
    --bg: #0b0f14;
    --card: #121824;
    --muted: #93a1b0;
    --accent: #6aa3ff;
    --ok: #18c29c;
    --bad: #ff5d73;
    --ink: #e8eef7;
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    min-height: 100vh;
    /* full viewport height */
    display: flex;
    flex-direction: column;
    /* stack vertically */
    align-items: center;
    /* horizontal centering */
    justify-content: center;
    /* vertical centering */
    background: linear-gradient(180deg, #0a0e13, #0e1420 30%, #0b0f14);
    color: var(--ink);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Helvetica, Arial, sans-serif;
    padding: 24px;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
    border-bottom: 1px solid transparent;
}

a:hover,
a:focus {
    color: var(--ink);
    border-color: var(--accent);
}

a:active {
    color: var(--ok);
}

a.muted {
    color: var(--muted);
}

a.muted:hover {
    color: var(--accent);
}

.app {
    width: min(1100px, 100%);
    margin: 0 auto;
}

.site-logo {
    text-align: center;
    margin-bottom: 24px;
}

.site-logo h1 {
    font-family: 'Segoe UI', Roboto, sans-serif;
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--accent);
    margin: 0;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 18px;
    flex-wrap: wrap;
    text-align: left;
}

.controls {
  display: flex;
  flex-wrap: wrap;          /* allow a second line */
  align-items: center;
  justify-content: flex-end;/* keep buttons at top-right */
  gap: 8px;
}

.btn-group { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; width:100%; }

.site-footer {
    margin-top: 40px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.4;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.site-footer p {
    margin: 6px 0;
}

.title {
    font-size: clamp(20px, 4.5vw, 30px);
    font-weight: 800;
    letter-spacing: .2px
}

.muted {
    color: var(--muted);
    font-size: 15px
}

.card {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    border-radius: 18px;
    padding: 16px
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px
}

.col {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.col h2 {
    margin: 2px 4px 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .12em
}

.list {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.item {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, .08);
    background: #101624;
    color: var(--ink);
    padding: 16px 16px;
    text-align: left;
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    isolation: isolate;
    transition: transform .06s ease, border-color .15s ease, background .2s ease;
    width: 100%;
    display: block;
    font-size: clamp(18px, 2.5vw, 22px);
    line-height: 1.4
}

.item:hover {
    transform: translateY(-1px)
}

.item[disabled] {
    opacity: .5;
    cursor: default;
    pointer-events: none
}

.item .hint {
    color: var(--muted);
    font-style: italic
}

.selected {
    outline: 2px solid var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(106, 163, 255, .18) inset
}

@keyframes pop {
    0% {
        transform: scale(1)
    }

    35% {
        transform: scale(1.05)
    }

    100% {
        transform: scale(1)
    }
}

.correct {
    border-color: var(--ok) !important;
    background: rgba(24, 194, 156, .12) !important;
    animation: pop .24s ease both
}

@keyframes shake {

    10%,
    90% {
        transform: translateX(-1px)
    }

    20%,
    80% {
        transform: translateX(2px)
    }

    30%,
    50%,
    70% {
        transform: translateX(-4px)
    }

    40%,
    60% {
        transform: translateX(4px)
    }
}

.incorrect {
    border-color: var(--bad) !important;
    background: rgba(255, 93, 115, .1) !important;
    animation: shake .35s ease
}

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    flex-wrap: wrap
}

.btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .12);
    color: var(--ink);
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer
}

.btn:hover {
    border-color: var(--accent)
}

.seg {
    display: inline-flex;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
    margin-right: 8px
}

.seg button {
    border: 0;
    background: transparent;
    color: var(--ink);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600
}

.seg button[aria-pressed="true"] {
    background: var(--accent);
    color: #0b1120
}

.seg button:hover {
    filter: brightness(1.1)
}

/* Full-width settings panel that wraps items to new lines */
.seg.seg--checkboxes {
  display: flex;
  flex-wrap: wrap;                 /* ← allow wrapping */
  gap: 10px;
  width: 100%;
  max-width: 100%;
  align-items: flex-start;
  justify-content: flex-start;     /* or flex-end if you want them right-aligned */
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  padding: 8px 10px;
  border-radius: 12px;
}

/* Each checkbox “pill” */
.seg.seg--checkboxes .chk {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: transparent;
  /* sizing: sit side-by-side, but wrap when needed */
  flex: 0 1 auto;                  /* don’t stretch to fill row */
  max-width: 100%;                 /* never overflow container */
  white-space: normal;             /* allow wrapping inside a long label */
  line-height: 1.2;
}

/* Let long words/phrases wrap instead of pushing layout */
.seg.seg--checkboxes .chk span {
  overflow-wrap: anywhere;         /* break long tokens if needed */
}

.dissolve {
    animation: fadeOut .45s ease both
}

#typeFilters {
  flex: 0 0 100%;           /* take the full line below */
  order: 99;                /* always after the buttons on the first row */
  margin-top: 8px;
}

.hidden { display: none !important; }

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(10px)
    }
}

@media (max-width: 760px) {
    body {
        justify-content: flex-start;
        /* push content to the top */
        padding-top: 20px;
        /* some breathing space */
    }

    .grid {
        grid-template-columns: 1fr 1fr;
        /* keep two columns */
        gap: 8px;
        /* tighten spacing */
    }

    .item {
        font-size: clamp(14px, 4vw, 18px);
        /* smaller text for mobile */
        padding: 12px;
    }

    .col h2 {
        font-size: 12px;
        /* smaller headers */
    }
}