        :root {
            --bg-dark: #151515;
            --bg-deep: #0c0c0c;
            --surface: #1c1c1c;
            --surface-2: #262626;
            --primary: #f7dc24;
            --primary-2: #f7dc24;
            --text-soft: #b7b7b7;
            --border: rgba(255, 255, 255, 0.09);
            --good: #22d3a8;
            --warning: #ffb454;
        }

        html,
        body {
            min-height: 100%;
            background:
                radial-gradient(900px 420px at 15% -10%, rgba(247, 220, 36, 0.12), transparent 55%),
                radial-gradient(900px 420px at 85% -20%, rgba(130, 130, 130, 0.15), transparent 60%),
                var(--bg-dark);
            color: #fff;
            font-family: "Manrope", sans-serif;
        }

        h1,
        h2,
        h3,
        h4 {
            font-family: "Poppins", sans-serif;
            font-weight: 800;
        }

        .hero {
            position: relative;
            overflow: hidden;
            background: linear-gradient(180deg, #181818 0%, #0f0f0f 100%);
            border-bottom: 1px solid var(--border);
        }

        .hero::before,
        .hero::after {
            content: "";
            position: absolute;
            border-radius: 50%;
            filter: blur(80px);
            z-index: 0;
        }

        .hero::before {
            width: 360px;
            height: 360px;
            background: rgba(247, 220, 36, 0.2);
            top: -140px;
            left: -100px;
        }

        .hero::after {
            width: 340px;
            height: 340px;
            background: rgba(130, 130, 130, 0.2);
            right: -70px;
            bottom: -140px;
        }

        .hero-inner {
            position: relative;
            z-index: 1;
            max-width: 1180px;
            margin: 0 auto;
            padding: 84px 20px 72px;
            display: grid;
            grid-template-columns: 1.35fr 1fr;
            gap: 26px;
            align-items: center;
        }

        .hero-title {
            font-size: clamp(2.2rem, 4.4vw, 3.9rem);
            line-height: 1.04;
            margin-bottom: 1rem;
        }

        .hero-sub {
            font-size: 1.05rem;
            color: var(--text-soft);
            max-width: 680px;
            line-height: 1.65;
            margin-bottom: 1.4rem;
        }

        .hero-badge {
            display: inline-flex;
            align-items: center;
            gap: .5rem;
            border-radius: 999px;
            padding: .42rem .8rem;
            margin-bottom: 1rem;
            border: 1px solid rgba(247, 220, 36, 0.36);
            background: rgba(247, 220, 36, 0.12);
            color: #ececec;
            font-size: .84rem;
            font-weight: 700;
        }

        .hero-actions {
            display: flex;
            gap: .75rem;
            flex-wrap: wrap;
        }

        .button.is-soft {
            background: rgba(255, 255, 255, 0.07);
            border: 1px solid rgba(255, 255, 255, 0.18);
            color: #fff;
        }

        .button.is-soft:hover {
            background: rgba(255, 255, 255, 0.14);
            color: #fff;
        }

        section {
            padding: 3.1rem 1rem;
        }

        .shell {
            max-width: 1180px;
            margin: 0 auto;
        }

        .section-title {
            text-align: center;
            margin-bottom: .5rem;
            font-size: 1.85rem;
        }

        .section-sub {
            text-align: center;
            color: var(--text-soft);
            margin-bottom: 1.7rem;
        }

        .toolbar {
            border: 1px solid var(--border);
            border-radius: 1rem;
            background: linear-gradient(180deg, rgba(29, 29, 29, 0.9), rgba(15, 15, 15, 0.9));
            padding: 1rem;
            margin-bottom: 1.2rem;
        }

        .toolbar-top {
            display: grid;
            grid-template-columns: 1.6fr .8fr auto;
            gap: .7rem;
            align-items: center;
        }

        .toolbar .input,
        .toolbar .select select {
            background: #161616;
            color: #fff;
            border-color: rgba(255, 255, 255, 0.16);
            border-radius: .8rem;
        }

        .toolbar .input::placeholder {
            color: #9f9f9f;
        }

        .toolbar .button {
            border-radius: .8rem;
        }

        .toolbar-stats {
            margin-top: .75rem;
            font-size: .84rem;
            color: var(--text-soft);
        }

        .controls-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
            gap: 1.1rem;
            min-height: 220px;
        }

        .ctrl-card {
            border: 1px solid var(--border);
            border-radius: 1rem;
            background: linear-gradient(160deg, rgba(28, 28, 28, 0.98), rgba(16, 16, 16, 0.98));
            padding: 1.25rem;
            display: flex;
            flex-direction: column;
            gap: .65rem;
            transition: border-color .2s, box-shadow .2s;
        }

        .ctrl-card:hover {
            border-color: rgba(247, 220, 36, 0.3);
            box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
        }

        .ctrl-card-header {
            display: flex;
            align-items: flex-start;
            gap: .75rem;
        }

        .ctrl-icon {
            width: 42px;
            height: 42px;
            border-radius: .6rem;
            background: rgba(130, 130, 130, 0.18);
            border: 1px solid rgba(247, 220, 36, 0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary-2);
            font-size: 1.1rem;
            flex-shrink: 0;
        }

        .ctrl-name {
            font-family: "Poppins", sans-serif;
            font-weight: 700;
            font-size: 1rem;
            color: #fff;
            margin: 0;
        }

        .ctrl-author {
            font-size: .8rem;
            color: var(--text-soft);
            margin: 0;
        }

        .ctrl-desc {
            font-size: .88rem;
            color: var(--text-soft);
            line-height: 1.5;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .ctrl-tags {
            display: flex;
            flex-wrap: wrap;
            gap: .35rem;
        }

        .ctrl-tag {
            font-size: .75rem;
            padding: .2rem .55rem;
            border-radius: 999px;
            background: rgba(130, 130, 130, 0.15);
            border: 1px solid rgba(130, 130, 130, 0.25);
            color: #cdcdcd;
        }

        .ctrl-stats {
            display: flex;
            gap: 1rem;
            font-size: .8rem;
            color: var(--text-soft);
        }

        .ctrl-stats span {
            display: inline-flex;
            align-items: center;
            gap: .3rem;
        }

        .ctrl-actions {
            display: flex;
            gap: .5rem;
            margin-top: auto;
        }

        .ctrl-actions .button {
            border-radius: .7rem;
            font-size: .85rem;
        }

        .modal-card {
            border-radius: 1rem;
            background: #181818;
            border: 1px solid var(--border);
        }

        #uploadModal {
            position: fixed;
            inset: 0;
            z-index: 10000;
            align-items: center;
            justify-content: center;
            padding: 5vh 20px;
        }

        #uploadModal.is-active {
            display: flex;
        }

        #uploadModal .modal-background {
            position: absolute;
            inset: 0;
            background: rgba(7, 7, 7, .82);
            backdrop-filter: blur(6px);
        }

        #uploadModal .modal-card {
            position: relative;
            z-index: 1;
            width: min(680px, 100%);
            max-height: 90vh;
            margin: 0;
            overflow: hidden;
        }

        #uploadModal .modal-card-body {
            overflow-y: auto;
        }

        body.controls-modal-open {
            overflow: hidden;
        }

        .modal-card-head {
            background: #141414;
            border-bottom: 1px solid var(--border);
            border-radius: 1rem 1rem 0 0;
        }

        .modal-card-title {
            color: #fff;
            font-family: "Poppins", sans-serif;
            font-weight: 700;
        }

        .modal-card-body {
            background: #181818;
            color: #fff;
        }

        .modal-card-foot {
            background: #141414;
            border-top: 1px solid var(--border);
            border-radius: 0 0 1rem 1rem;
        }

        .modal-card-body .label {
            color: #d6d6d6;
        }

        .modal-card-body .input,
        .modal-card-body .textarea,
        .modal-card-body .select select,
        .modal-card-body .file-cta {
            background: #161616;
            color: #fff;
            border-color: rgba(255, 255, 255, 0.16);
            border-radius: .7rem;
        }

        .modal-card-body .input::placeholder,
        .modal-card-body .textarea::placeholder {
            color: #9f9f9f;
        }

        .empty-state {
            text-align: center;
            padding: 4rem 1rem;
            color: var(--text-soft);
        }

        .empty-state i {
            font-size: 3rem;
            margin-bottom: 1rem;
            color: rgba(247, 220, 36, 0.3);
        }

        .empty-state p {
            font-size: 1rem;
        }

        .pagination-bar {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: .75rem;
            margin-top: 2rem;
        }

        .pagination-bar .button {
            border-radius: .7rem;
        }

        .pagination-info {
            font-size: .9rem;
            color: var(--text-soft);
            min-width: 80px;
            text-align: center;
        }

        .ctrl-skeleton {
            border: 1px solid var(--border);
            border-radius: 1rem;
            background: rgba(28, 28, 28, 0.6);
            padding: 1.25rem;
            display: flex;
            flex-direction: column;
            gap: .65rem;
        }

        .skel-line {
            border-radius: .4rem;
            background: linear-gradient(90deg, rgba(255, 255, 255, .06) 25%, rgba(255, 255, 255, .12) 50%, rgba(255, 255, 255, .06) 75%);
            background-size: 200% 100%;
            animation: skel-shimmer 1.4s infinite;
        }

        @keyframes skel-shimmer {
            0% {
                background-position: 200% 0;
            }

            100% {
                background-position: -200% 0;
            }
        }

        @media (max-width: 900px) {
            .hero-inner {
                grid-template-columns: 1fr;
                padding: 54px 20px 44px;
            }
        }

        @media (max-width: 780px) {
            .toolbar-top {
                grid-template-columns: 1fr;
            }

            .hero-actions {
                width: 100%;
            }

            .hero-actions .button {
                flex: 1;
            }
        }

/* Keep the upload dialog readable independently of Bulma's light notifications
   and the shared paragraph colors in battly-design.css. */
#uploadModal {
    --upload-text: #f4f5f1;
    --upload-muted: #b9c2ce;
    --upload-edge: #707b88;
    --upload-info-bg: #2b2818;
    --upload-info-text: #f5e8ad;
    --upload-error-bg: #351d26;
    --upload-error-text: #ffd0d7;
    --upload-success-bg: #183127;
    --upload-success-text: #c3efda;
    color-scheme: dark;
}
#uploadModal .modal-card-title,
#uploadModal .label {
    color: var(--upload-text);
}
#uploadModal .modal-card-title { line-height: 1.35; }
#uploadModal .label > span { color: var(--upload-muted); }
#uploadModal .input::placeholder,
#uploadModal .textarea::placeholder {
    color: var(--upload-muted);
    opacity: 1;
}
#uploadModal .input,
#uploadModal .textarea {
    border-color: var(--upload-edge) !important;
}
#uploadModal .file-label { min-width: 0; }
#uploadModal .file-cta,
#uploadModal .file-name {
    background: #191919 !important;
    color: var(--upload-text) !important;
    border-color: var(--upload-edge) !important;
}
#uploadModal .file-name {
    flex: 1;
    min-width: 0;
    color: var(--upload-muted) !important;
}
#uploadModal .file-cta:hover { background: #2b2b2b !important; }
#uploadModal .notification {
    border: 1px solid;
    box-shadow: none;
    line-height: 1.55;
    overflow-wrap: anywhere;
}
#uploadModal .upload-notice {
    background: var(--upload-info-bg);
    color: var(--upload-info-text);
    border-color: #9c8b42;
}
#uploadModal .notification.is-danger {
    background: var(--upload-error-bg);
    color: var(--upload-error-text);
    border-color: #ce7b8a;
}
#uploadModal .notification.is-success {
    background: var(--upload-success-bg);
    color: var(--upload-success-text);
    border-color: #6ba88c;
}
#uploadModal .help.is-danger { color: var(--upload-error-text); }
#uploadModal :is(input, textarea, button):focus-visible,
#uploadModal .file-label:focus-within {
    outline: 2px solid var(--primary-2);
    outline-offset: 3px;
}
#uploadModal .delete {
    width: 36px;
    height: 36px;
    max-width: none;
    max-height: none;
    flex-shrink: 0;
    background: #303741;
    color: var(--upload-text);
}
#uploadModal .delete:hover { background: #454f5b; }
#uploadModal .modal-card-foot {
    gap: .5rem;
    flex-wrap: wrap;
}
@media (max-width: 480px) {
    #uploadModal { padding: 16px; }
    #uploadModal .modal-card { max-height: calc(100dvh - 32px); }
    #uploadModal :is(.modal-card-head, .modal-card-body, .modal-card-foot) { padding: 20px; }
    #uploadModal .modal-card-title { font-size: 1.25rem; }
    #uploadModal .file-label { flex-wrap: wrap; }
    #uploadModal .file-cta { width: 100%; border-radius: 6px 6px 0 0; }
    #uploadModal .file-name { flex-basis: 100%; max-width: 100%; border-left-width: 1px; border-radius: 0 0 6px 6px; }
    #uploadModal .modal-card-foot .button { flex: 1 1 auto; }
}

.ctrl-card .ctrl-card-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 9px;
  background: #222b30;
  color: #b6c4b8;
  font-size: 24px;
}
.ctrl-card-preview .control-preview-stage { pointer-events: none; }
.ctrl-card a, .ctrl-detail a { overflow-wrap: anywhere; }
.ctrl-card .ctrl-name a { color: #f0f5f0; }
.ctrl-card .ctrl-name a:hover, .ctrl-detail-back:hover { color: #ffe683; }
.ctrl-card .ctrl-actions, .ctrl-detail .ctrl-actions { flex-wrap: wrap; }
body.battly-horizon[data-battly-view="controls"] .ctrl-detail {
  width: min(960px, calc(100% - 32px));
  padding: clamp(36px, 6vw, 72px) 0;
  min-height: 65vh;
}
.ctrl-detail-back { display: inline-flex; gap: 8px; align-items: center; margin-bottom: 22px; color: #c5d0c6; }
.ctrl-detail-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.ctrl-detail-heading h1 {
  margin: 0;
  color: #f1f5f0;
  font: 650 clamp(25px, 4vw, 42px)/1.15 "Poppins", sans-serif;
  overflow-wrap: anywhere;
}
.ctrl-detail-heading .ctrl-actions { margin-top: 0; }
.ctrl-detail .btn-like[aria-pressed="true"] { color: #ff9aab; }
.ctrl-detail-desc { margin: 18px 0; color: #d3ded5; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.ctrl-detail .ctrl-tags { margin-block: 12px; }
.ctrl-detail #likeError { color: #ffb6ba; }

.ctrl-actions .button { gap: .45rem; }
.ctrl-card .ctrl-actions .button { font-size: .82rem; padding-inline: 12px; }
.ctrl-detail #detailPreview { max-width: 760px; }
.ctrl-hero-visual[hidden] { display: none; }
.hero-inner:has(.ctrl-hero-visual[hidden]) { grid-template-columns: minmax(0, 1fr); }
.ctrl-hero-visual {
  min-width: 0;
  padding: 8px;
  margin: 0;
  border: 1px solid #536759;
  border-radius: 20px;
  background: #19231c;
}
.ctrl-hero-screen { overflow: hidden; border-radius: 13px; }
.ctrl-hero-screen .control-preview-stage {
  border: 0;
  border-radius: 0;
  background-color: #1a2a27;
}
.ctrl-hero-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  padding: 11px 8px 4px;
  color: #b7c7ba;
  font-size: .79rem;
}
.ctrl-hero-caption a { color: #f0f3ed; font-weight: 650; overflow-wrap: anywhere; }
.ctrl-hero-caption a:hover { color: #f7dc24; }

.ctrl-rating {
  margin-top: 24px;
  padding: clamp(14px, 3vw, 22px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  border: 1px solid #34463a;
  border-radius: 12px;
  background: #172019;
}
.ctrl-rating h2 { margin: 0 0 5px; color: #eef4ed; font-size: 1rem; font-weight: 700; }
.ctrl-rating-overview i { color: #f7dc24; }
.ctrl-rating-summary { margin-inline-start: 4px; color: #c4d2c4; font-weight: 650; font-variant-numeric: tabular-nums; }
.ctrl-rating-form { min-width: 0; max-width: 100%; }
.ctrl-rating fieldset { min-width: 0; }
.ctrl-rating legend { margin-bottom: 5px; font-size: .84rem; font-weight: 650; color: #eef4ed; }
.ctrl-rating-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ctrl-rating-options { display: flex; gap: 2px; }
.ctrl-rating-options label { position: relative; }
.ctrl-rating-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ctrl-rating-options span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #92aa98;
  font-size: 1.24rem;
  border-radius: 8px;
  cursor: pointer;
}
.ctrl-rating-options label:has(input:checked) span,
.ctrl-rating-options label:has(~ label input:checked) span { color: #f7dc24; }
.ctrl-rating-options label:hover span { background: #f7dc2414; color: #ffe978; }
.ctrl-rating-options :focus-visible + span { outline: 2px solid #fff; outline-offset: -2px; }
.ctrl-rating [role="status"]:not(:empty) { margin-top: 8px; }
