button.nobulay-note-meter[aria-haspopup="dialog"] {
    appearance: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.nobulay-note-meter:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.nobulay-finale-workshop {
    --score-accent: #ff67cf;
    --score-secondary: #ffd687;
    --score-deep: #501747;
    --score-line: color-mix(in srgb, var(--score-accent) 34%, transparent);
    --score-muted: color-mix(in srgb, var(--score-accent) 13%, #e9e0f2);
    --score-gutter: clamp(13px, 3vw, 28px);
    width: min(900px, calc(100% - 24px));
    max-height: calc(100dvh - 24px);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--score-line);
    border-radius: 19px;
    background: radial-gradient(ellipse at 14% 25%, var(--score-deep), transparent 64%), linear-gradient(145deg, #160c20, #0d0c18 75%);
    box-shadow: 0 25px 80px #000d, 0 0 34px var(--score-line);
    color: #fff;
    font: 500 .96rem/1.45 Outfit, system-ui, sans-serif;
}

.nobulay-finale-workshop[data-skin="csillag"] { --score-accent: #a994ff; --score-secondary: #9ad4ff; --score-deep: #212659; }
.nobulay-finale-workshop[data-skin="melyviz"] { --score-accent: #5ae7e4; --score-secondary: #c2b5ff; --score-deep: #153763; }
.nobulay-finale-workshop[data-skin="kalandor"] { --score-accent: #dba45c; --score-secondary: #ffdfa0; --score-deep: #412719; }
.nobulay-finale-workshop[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.nobulay-finale-workshop::backdrop { background: #060512da; backdrop-filter: blur(8px); }

.nobulay-finale-workshop > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px var(--score-gutter);
    border-bottom: 1px solid var(--score-line);
    background: radial-gradient(ellipse at left top, var(--score-line), transparent 72%);
}

.nobulay-finale-workshop > header small {
    color: var(--score-secondary);
    font-size: .72rem;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.nobulay-finale-workshop h2,
.nobulay-finale-workshop h3,
.nobulay-finale-workshop p { margin: 0; }
.nobulay-finale-workshop h2 { font: 750 clamp(1.46rem, 3.3vw, 2.05rem)/1.15 Outfit, sans-serif; }

.nobulay-finale-workshop__close {
    flex: 0 0 42px;
    height: 42px;
    border: 1px solid var(--score-line);
    border-radius: 50%;
    background: #090a13a0;
    color: #fff;
    font: 700 1.35rem/1 Outfit, sans-serif;
    cursor: pointer;
}

.nobulay-finale-workshop :focus-visible { outline: 2px solid var(--score-secondary); outline-offset: 2px; }

.nobulay-finale-workshop__body {
    display: grid;
    gap: 14px;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-color: var(--score-line) transparent;
    padding: 14px var(--score-gutter) 20px;
}

.nobulay-finale-workshop__score {
    display: grid;
    grid-template-columns: clamp(62px, 14vw, 115px) minmax(0, 1fr);
    gap: clamp(10px, 3vw, 23px);
    align-items: center;
}

.nobulay-finale-workshop__record {
    position: relative;
    display: grid;
    place-items: center;
    isolation: isolate;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid var(--score-line);
    background: repeating-radial-gradient(circle, #0d0817 0 3px, color-mix(in srgb, var(--score-deep) 70%, #111) 4px);
    box-shadow: 0 0 22px var(--score-line);
}

.nobulay-finale-workshop__record i {
    position: absolute;
    inset: 14%;
    border-radius: 50%;
    background: repeating-conic-gradient(from 18deg, transparent 0 42deg, var(--score-accent) 43deg 46deg);
    mask-image: radial-gradient(closest-side, transparent 87%, #000 91% 96%, transparent);
    animation: nobulayWorkshopRecord 22s linear infinite;
}

.nobulay-finale-workshop[data-near-finale="true"] .nobulay-finale-workshop__record i { animation-duration: 9s; }

.nobulay-finale-workshop__record img {
    position: relative;
    width: 66%;
    aspect-ratio: 1;
    object-fit: contain;
    filter: drop-shadow(0 0 9px var(--score-accent));
}

.nobulay-finale-workshop__meter h3 { color: var(--score-secondary); font-size: .88rem; }
.nobulay-finale-workshop__meter div { display: flex; align-items: baseline; gap: 6px; margin: 4px 0 7px; color: var(--score-muted); }
.nobulay-finale-workshop__meter strong { color: #fff; font: 800 clamp(1.8rem, 5vw, 2.9rem)/1 Outfit, sans-serif; }
.nobulay-finale-workshop progress { display: block; width: 100%; height: 10px; accent-color: var(--score-accent); }
.nobulay-finale-workshop__meter p { margin-top: 6px; color: var(--score-muted); font-size: .86rem; }
.nobulay-finale-workshop__allies h3 { margin-bottom: 6px; font-size: 1rem; color: var(--score-secondary); }

.nobulay-finale-workshop table {
    width: 100%;
    table-layout: fixed;
    border-spacing: 0 4px;
    font-size: .82rem;
}

.nobulay-finale-workshop :is(th, td) {
    padding: 5px 4px;
    text-align: center;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.nobulay-finale-workshop thead th { color: var(--score-muted); font-size: .72rem; line-height: 1.14; font-weight: 600; }
.nobulay-finale-workshop thead img { display: block; width: 25px; height: 25px; margin: 0 auto 3px; object-fit: contain; }
.nobulay-finale-workshop thead th:first-child { width: 23%; text-align: left; }
.nobulay-finale-workshop thead th:last-child { width: 28%; text-align: left; padding-inline-start: 9px; }

.nobulay-finale-workshop tbody :is(th, td) {
    border-block: 1px solid #fff1;
    background: #080710a0;
}

.nobulay-finale-workshop tbody th { text-align: left; border-inline-start: 1px solid #fff1; border-radius: 8px 0 0 8px; }
.nobulay-finale-workshop tbody td:last-child { border-inline-end: 1px solid #fff1; border-radius: 0 8px 8px 0; }
.nobulay-finale-workshop tbody th span { display: flex; align-items: center; gap: 6px; }
.nobulay-finale-workshop tbody th img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.nobulay-finale-workshop tbody tr.is-ready :is(th, td) { border-color: var(--score-line); }
.nobulay-finale-workshop tbody tr.is-defeated { color: var(--score-muted); }

.nobulay-finale-workshop__note {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: clamp(22px, 5vw, 39px);
    aspect-ratio: 1;
    border: 1px dashed #fff3;
    border-radius: 7px;
    color: var(--score-muted);
}

.nobulay-finale-workshop__note img { width: 100%; height: 100%; object-fit: contain; opacity: .29; filter: grayscale(1); }
.nobulay-finale-workshop__note.is-purple { --note-light: #b78afe; }
.nobulay-finale-workshop__note.is-blue { --note-light: #73beff; }
.nobulay-finale-workshop__note.is-green { --note-light: #80e99b; }
.nobulay-finale-workshop__note.is-pink { --note-light: #f499df; }
.nobulay-finale-workshop__note.is-held { border: 1px solid var(--note-light); color: var(--note-light); background: color-mix(in srgb, var(--note-light) 20%, #15101e); }
.nobulay-finale-workshop__note.is-held img { opacity: 1; filter: none; }
.nobulay-finale-workshop__note b {
    position: absolute;
    right: -2px;
    bottom: -3px;
    min-width: 12px;
    height: 13px;
    border-radius: 9px;
    background: #14101d;
    font-size: .63rem;
    line-height: 13px;
}

.nobulay-finale-workshop tbody .nobulay-finale-workshop__status { padding-inline-start: 9px; text-align: left; line-height: 1.2; }
.nobulay-finale-workshop__status small { display: block; margin-top: 2px; color: var(--score-secondary); }
.nobulay-finale-workshop__rule { color: var(--score-muted); font-size: .84rem; }

@keyframes nobulayWorkshopRecord { to { transform: rotate(1turn); } }

@media (max-width: 505px) {
    .nobulay-finale-workshop thead th:first-child { width: 23%; }
    .nobulay-finale-workshop thead th:last-child { width: 31%; }
    .nobulay-finale-workshop :is(th, td) { padding-inline: 2px; }
    .nobulay-finale-workshop thead th span,
    .nobulay-finale-workshop tbody th img { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .nobulay-finale-workshop__record i { animation: none; }
}
