:root {
    --ink: #1c1f24;
    --muted: #69707d;
    --line: #d9dde5;
    --page: #f6f7f3;
    --surface: #ffffff;
    --nuva: #f5c400;
    --nuva-dark: #816400;
    --green: #2d7d67;
    --red: #b84545;
    --shadow: 0 16px 40px rgba(28, 31, 36, .10);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-width: 0;
    overflow-x: hidden;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--page);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    padding: 10px max(16px, env(safe-area-inset-left)) 10px max(16px, env(safe-area-inset-right));
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
    max-width: 100%;
}

.brand img {
    flex: 0 0 auto;
    border-radius: 8px;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 15px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.brand small {
    color: var(--muted);
    font-size: 11px;
}

.header-action {
    flex: 0 0 auto;
    color: var(--nuva-dark);
    font-weight: 700;
    font-size: 13px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-menu {
    display: none;
}

.shell-nav {
    position: sticky;
    top: 64px;
    z-index: 15;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 16px;
    background: rgba(246, 247, 243, .96);
    border-bottom: 1px solid var(--line);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.shell-nav::-webkit-scrollbar {
    display: none;
}

.shell-nav a {
    flex: 0 0 auto;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.shell-nav a.is-active {
    border-color: var(--nuva);
    background: var(--nuva);
    color: var(--ink);
}

.page-shell {
    width: min(100%, 1060px);
    margin: 0 auto;
    padding: 22px 16px 48px;
    min-width: 0;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    min-height: calc(100dvh - 150px);
    align-content: center;
}

.auth-hero,
.welcome-card,
.panel,
.auth-panel,
.stacked-form,
.quick-grid a,
.stat-grid article {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.auth-hero,
.welcome-card {
    padding: 26px;
    background:
        linear-gradient(135deg, rgba(245, 196, 0, .34), rgba(45, 125, 103, .16)),
        var(--surface);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    font-size: clamp(26px, 8vw, 44px);
    line-height: 1.14;
}

h2 {
    margin: 0;
    font-size: 20px;
}

.auth-hero p:last-child,
.welcome-card p:last-child,
.page-heading p:last-child {
    color: var(--muted);
    line-height: 1.8;
}

.auth-panel,
.stacked-form,
.panel {
    padding: 20px;
}

label {
    display: grid;
    gap: 8px;
    margin-top: 16px;
    font-size: 13px;
    font-weight: 800;
}

.field-help {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
}

input,
select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(245, 196, 0, .35);
    border-color: var(--nuva);
}

input[type="radio"],
input[type="checkbox"] {
    width: auto;
    min-height: 0;
    padding: 0;
    accent-color: var(--nuva-dark);
}

.primary-button {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 48px;
    margin-top: 20px;
    border: 0;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.secondary-button {
    display: inline-grid;
    place-items: center;
    width: 100%;
    min-height: 48px;
    margin-top: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.danger-button {
    display: inline-grid;
    place-items: center;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(190, 54, 43, .3);
    border-radius: 8px;
    background: #fff1ef;
    color: #9e2d24;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.alert {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 800;
}

.alert.success {
    border: 1px solid rgba(36, 118, 90, .24);
    background: #e8f7ed;
    color: #1f644e;
}

.alert.error {
    border: 1px solid rgba(190, 54, 43, .28);
    background: #fff1ef;
    color: #9e2d24;
}

.public-news-editor form {
    display: grid;
    gap: 14px;
}

.public-news-editor textarea {
    min-height: 180px;
    resize: vertical;
}

.public-news-table th,
.public-news-table td {
    vertical-align: top;
}

.action-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.action-cell form {
    margin: 0;
}

.action-cell .secondary-button {
    width: auto;
    min-height: 38px;
    margin-top: 0;
    padding: 0 12px;
}

.auth-link {
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

.auth-link a {
    color: var(--nuva-dark);
    font-weight: 800;
}

.form-alert {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(184, 69, 69, .10);
    color: var(--red);
    font-weight: 700;
}

.signup-layout {
    display: grid;
    gap: 14px;
}

.signup-form,
.signup-confirm,
.signup-complete {
    display: grid;
    gap: 16px;
}

.signup-section {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
}

.signup-section h2 {
    font-size: 16px;
}

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

.signup-form label,
.choice-group label {
    margin-top: 0;
}

.choice-group {
    display: grid;
    gap: 8px;
}

.choice-group > span {
    font-size: 13px;
    font-weight: 800;
}

.radio-row,
.check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.privacy-box {
    max-height: 128px;
    overflow-y: auto;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.privacy-box p {
    margin: 0 0 8px;
}

.privacy-box p:last-child {
    margin-bottom: 0;
}

.confirm-list {
    display: grid;
    gap: 8px;
    margin: 0;
}

.confirm-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
}

.confirm-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.confirm-list dd {
    margin: 0;
    font-weight: 900;
    text-align: right;
    overflow-wrap: anywhere;
}

.signup-confirm-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.signup-confirm-actions .primary-button,
.signup-confirm-actions .secondary-button {
    margin-top: 0;
}

.dashboard {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.notice-list {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.notice-list h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.notice-item {
    display: block;
    padding: 12px 14px;
    border: 1px solid rgba(184, 69, 69, .22);
    border-radius: 8px;
    background: rgba(184, 69, 69, .08);
    color: var(--red);
    font-size: 14px;
    font-weight: 800;
}

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

.stat-grid article {
    min-height: 94px;
    padding: 16px;
    min-width: 0;
}

.stat-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.stat-grid strong {
    display: block;
    margin-top: 10px;
    font-size: clamp(22px, 7vw, 34px);
    line-height: 1;
}

.dashboard-title-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.dashboard-title-card div {
    min-width: 0;
}

.dashboard-title-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.dashboard-title-card strong {
    display: block;
    margin-top: 6px;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: clamp(20px, 6vw, 30px);
    line-height: 1.15;
}

.dashboard-title-card .secondary-button {
    flex: 0 0 auto;
    margin-top: 0;
}

.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.panel-title span {
    color: var(--muted);
    font-weight: 800;
    flex: 0 0 auto;
}

.progress-bar {
    height: 12px;
    margin-top: 18px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8e3cb;
}

.progress-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--nuva), var(--green));
}

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

.metric-grid div {
    min-height: 78px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
    min-width: 0;
}

.metric-grid dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.metric-grid dd {
    margin: 8px 0 0;
    font-size: 22px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.rank-series-grid {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.rank-series {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
    min-width: 0;
}

.rank-series h3 {
    margin: 0 0 12px;
    font-size: 15px;
}

.rank-series p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.rank-chart {
    display: block;
    width: 100%;
    height: auto;
    min-height: 138px;
    overflow: visible;
}

.rank-chart-grid {
    stroke: #dde2e7;
    stroke-width: 1;
}

.rank-chart-axis {
    stroke: #bfc7d0;
    stroke-width: 1.5;
}

.rank-chart-label {
    fill: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.rank-chart-line {
    fill: none;
    stroke: var(--green);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rank-chart-point {
    stroke: var(--surface);
    stroke-width: 2;
    fill: var(--green);
}

.rank-chart-point.rank-1 {
    fill: var(--nuva);
}

.rank-chart-point.rank-2 {
    fill: #8b98a5;
}

.rank-chart-point.rank-3 {
    fill: #b98542;
}

.rank-chart-point.rank-4 {
    fill: var(--red);
}

.quick-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.quick-grid a {
    display: grid;
    gap: 8px;
    min-height: 92px;
    padding: 18px;
    border-left: 5px solid var(--nuva);
    font-weight: 900;
    min-width: 0;
}

.quick-grid a span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.page-heading {
    margin-bottom: 18px;
}

.form-page {
    max-width: 720px;
    margin: 0 auto;
}

fieldset {
    margin: 18px 0 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

legend {
    font-size: 13px;
    font-weight: 800;
}

.radio-row,
.check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    margin-top: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    font-weight: 800;
}

.radio-row input,
.check-row input {
    width: auto;
    min-height: auto;
}

.table-panel {
    overflow-x: auto;
}

.filter-tabs,
.year-tabs,
.scope-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar,
.year-tabs::-webkit-scrollbar,
.scope-tabs::-webkit-scrollbar {
    display: none;
}

.filter-tabs a,
.year-tabs a,
.scope-tabs a {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.filter-tabs a.is-active,
.year-tabs a.is-active,
.scope-tabs a.is-active {
    border-color: var(--nuva);
    background: var(--nuva);
    color: var(--ink);
}

.scope-tabs {
    margin-bottom: 10px;
}

.scope-tabs a {
    min-height: 44px;
}

.year-tabs {
    margin-bottom: 10px;
}

.record-count {
    margin: -4px 0 14px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.record-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.record-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.record-summary {
    display: block;
    padding: 16px;
    cursor: pointer;
    list-style: none;
}

.record-summary::-webkit-details-marker {
    display: none;
}

.record-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.record-date {
    display: block;
    color: var(--muted);
    font-size: 15px;
    font-weight: 800;
}

.record-head h2 {
    margin-top: 3px;
    font-size: 18px;
}

.record-badge {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    min-width: 52px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f0ead0;
    font-weight: 900;
}

.record-score {
    margin: 16px 0;
    font-size: clamp(30px, 11vw, 42px);
    line-height: 1;
    font-weight: 950;
}

.point-positive {
    color: var(--green);
}

.point-negative {
    color: var(--red);
}

.record-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin: 0;
}

.record-detail-grid div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
}

.record-detail-grid dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.record-detail-grid dd {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    text-align: right;
    overflow-wrap: anywhere;
}

.record-expand-label {
    display: block;
    margin-top: 12px;
    color: var(--nuva-dark);
    font-size: 12px;
    font-weight: 900;
    text-align: right;
}

.record-card[open] .record-expand-label {
    color: var(--muted);
}

.record-card[open] .record-expand-label::before {
    content: "詳細を閉じる";
}

.record-card[open] .record-expand-label {
    font-size: 0;
}

.record-card[open] .record-expand-label::before {
    font-size: 12px;
}

.record-expanded {
    padding: 0 16px 16px;
    border-top: 1px solid var(--line);
    background: #fbfcf8;
}

.score-chart-box {
    padding-top: 14px;
}

.score-chart-box h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

.score-chart {
    display: block;
    width: 100%;
    height: auto;
    min-height: 210px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.score-chart-axis {
    stroke: #bfc7d0;
    stroke-width: 1.5;
}

.score-chart-grid {
    stroke: #e3e7ec;
    stroke-width: 1;
}

.score-chart-label {
    fill: var(--muted);
    font-size: 10px;
    font-weight: 800;
}

.score-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 10px;
}

.score-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.score-chart-legend i {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.record-player-list {
    display: grid;
    gap: 10px;
    padding-top: 14px;
}

.record-player {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.record-player-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.record-player-main > div {
    min-width: 0;
}

.record-player-main strong,
.record-player-main span {
    display: block;
}

.record-player-main strong {
    font-size: 15px;
}

.record-player-main span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.record-player-rank {
    display: block;
    flex: 0 0 auto;
    width: 40px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
    background: #f0ead0;
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
    line-height: 34px;
    text-align: center;
    white-space: nowrap;
}

.record-player dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.record-player dl div {
    min-width: 0;
    padding: 8px;
    border-radius: 8px;
    background: #fafbf8;
}

.record-player dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.record-player dd {
    margin: 5px 0 0;
    font-size: 13px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.record-detail-empty {
    margin: 0;
    padding-top: 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.empty-state {
    text-align: center;
}

.empty-state p {
    color: var(--muted);
    line-height: 1.8;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    min-width: 72px;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    font-size: 13px;
    font-weight: 900;
}

.pagination a {
    color: var(--nuva-dark);
}

.pagination span {
    color: var(--muted);
}

.ranking-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.ranking-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.ranking-card.is-podium {
    border-color: rgba(245, 196, 0, .75);
}

.ranking-head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ranking-rank {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font-size: 18px;
    font-weight: 950;
    line-height: 1;
}

.ranking-card.is-podium .ranking-rank {
    background: var(--nuva);
    color: var(--ink);
}

.ranking-head h2,
.ranking-head p {
    margin: 0;
}

.ranking-head h2 {
    font-size: 17px;
}

.ranking-head p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.ranking-score {
    margin: 18px 0 14px;
    font-size: clamp(30px, 9vw, 42px);
    line-height: 1;
    font-weight: 950;
}

.ranking-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0 0;
}

.ranking-metrics div {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
}

.ranking-metrics dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.ranking-metrics dd {
    margin: 6px 0 0;
    font-size: 16px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.ranking-table-panel {
    padding: 0;
}

.ranking-table-panel.is-data-table {
    overflow: hidden;
    background: var(--surface);
}

.ranking-table-scroll {
    max-height: min(72vh, 760px);
    overflow: auto;
    border-radius: 7px;
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
}

.ranking-table {
    min-width: 620px;
    border-collapse: separate;
    border-spacing: 0;
}

.ranking-table-wide {
    min-width: 1680px;
}

.ranking-table th,
.ranking-table td {
    text-align: center;
    background: var(--surface);
}

.ranking-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #f4f6ef;
}

.ranking-table th:first-child,
.ranking-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--line), -1px 0 0 var(--surface);
}

.ranking-table th:nth-child(2),
.ranking-table td:nth-child(2) {
    position: sticky;
    left: 48px;
    z-index: 3;
    width: 92px;
    min-width: 92px;
    max-width: 92px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--line), -2px 0 0 var(--surface);
}

.ranking-table thead th:first-child,
.ranking-table thead th:nth-child(2) {
    z-index: 6;
}

.ranking-table th:nth-child(2) {
    background: #f4f6ef;
}

.ranking-table tbody tr.is-podium {
    background: rgba(245, 196, 0, .16);
}

.ranking-table tbody tr.is-podium td {
    background: #fff9dc;
}

.ranking-table tbody tr.is-podium td:first-child,
.ranking-table tbody tr.is-podium td:nth-child(2) {
    background: #fff9dc;
}

.ranking-table td:first-child {
    font-weight: 950;
}

.ranking-sort-form {
    display: flex;
    align-items: end;
    gap: 10px;
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.ranking-sort-form label {
    flex: 1 1 auto;
    margin: 0;
}

.ranking-sort-form select {
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.ranking-sort-form button {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 9px 14px;
    border: 0;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font: inherit;
    font-weight: 900;
}

.ranking-period-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 10px;
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.ranking-period-form label {
    margin: 0;
}

.ranking-period-form input {
    min-height: 42px;
}

.ranking-period-form button {
    min-height: 42px;
    padding: 9px 14px;
    border: 0;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font: inherit;
    font-weight: 900;
}

.aggregate-panel,
.aggregate-complete {
    display: grid;
    gap: 16px;
}

.aggregate-form,
.aggregate-confirm-form {
    display: grid;
    gap: 16px;
}

.aggregate-form .field,
.aggregate-player .field {
    margin-top: 0;
}

.aggregate-player-list {
    display: grid;
    gap: 12px;
}

.aggregate-player {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) minmax(92px, .6fr);
    align-items: end;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
}

.aggregate-player h3 {
    margin: 0 0 12px;
    font-size: 15px;
    white-space: nowrap;
}

.aggregate-total,
.aggregate-summary {
    display: grid;
    gap: 8px;
}

.aggregate-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.aggregate-total,
.aggregate-summary div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
}

.aggregate-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.aggregate-total span,
.aggregate-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.aggregate-total strong,
.aggregate-summary strong {
    display: block;
    margin-top: 3px;
    font-size: 20px;
}

.aggregate-total strong {
    margin-top: 0;
}

.aggregate-total strong.is-valid {
    color: var(--green);
}

.aggregate-total strong.is-invalid {
    color: var(--red);
}

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

.aggregate-actions .primary-button,
.aggregate-actions .secondary-button {
    margin-top: 0;
}

.aggregate-table-panel {
    margin: 0;
}

.aggregate-result-table {
    min-width: 0;
    table-layout: fixed;
}

.aggregate-result-table th,
.aggregate-result-table td {
    white-space: normal;
    overflow-wrap: anywhere;
    padding: 9px 6px;
}

.aggregate-result-table th:nth-child(1),
.aggregate-result-table td:nth-child(1) {
    width: 42px;
}

.aggregate-result-table th:nth-child(2),
.aggregate-result-table td:nth-child(2) {
    position: static;
    width: 54px;
    min-width: 0;
    background: inherit;
    box-shadow: none;
}

.aggregate-result-table td:first-child {
    font-weight: 900;
}

.aggregate-live-errors {
    display: grid;
    gap: 4px;
    color: var(--red);
    font-size: 12px;
    font-weight: 800;
}

.grade-status-panel,
.grade-system-panel {
    margin-top: 16px;
}

.grade-status-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
}

.grade-status-main > strong {
    display: grid;
    place-items: center;
    min-width: 88px;
    min-height: 88px;
    padding: 12px;
    border-radius: 8px;
    background: var(--nuva);
    font-size: 26px;
    font-weight: 950;
}

.grade-status-main > div {
    display: grid;
    gap: 8px;
}

.grade-status-main span {
    color: var(--muted);
    font-weight: 900;
}

.grade-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
}

.grade-system-table {
    min-width: 640px;
    border-collapse: separate;
    border-spacing: 0;
}

.grade-system-table th,
.grade-system-table td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--line);
    text-align: center;
    white-space: nowrap;
}

.grade-system-table th {
    background: #f7f4e6;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.grade-system-table th:first-child,
.grade-system-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 92px;
    background: var(--surface);
    font-weight: 950;
    text-align: left;
}

.grade-system-table th:first-child {
    z-index: 2;
    background: #f7f4e6;
}

.grade-system-table tbody tr:last-child td {
    border-bottom: 0;
}

.grade-system-table tr.is-current-grade td {
    background: rgba(245, 196, 0, .22);
    font-weight: 950;
}

.grade-system-table tr.is-current-grade td:first-child {
    background: var(--nuva);
}

.grade-recalc-panel {
    margin-top: 16px;
}

.debug-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.debug-summary article {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
}

.debug-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.debug-summary strong {
    font-size: 24px;
    font-weight: 950;
}

.debug-note {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.debug-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
}

.grade-recalc-table {
    min-width: 980px;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.grade-recalc-table th,
.grade-recalc-table td {
    padding: 10px 9px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.grade-recalc-table th {
    background: #f7f4e6;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.grade-recalc-table td:first-child,
.grade-recalc-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 128px;
    max-width: 180px;
    background: var(--surface);
    font-weight: 950;
    white-space: normal;
    overflow-wrap: anywhere;
}

.grade-recalc-table th:first-child {
    z-index: 2;
    background: #f7f4e6;
}

.grade-recalc-table td strong,
.grade-recalc-table td span {
    display: block;
}

.grade-recalc-table td span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.grade-recalc-table .grade-diff-cell {
    min-width: 180px;
}

.grade-recalc-table .grade-diff-cell strong {
    color: var(--ink);
}

.grade-recalc-table .grade-diff-cell span {
    display: inline-block;
    margin: 4px 6px 0 0;
    padding: 3px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .72);
}

.grade-recalc-table tr.is-grade-diff td {
    background: rgba(245, 196, 0, .16);
}

.grade-recalc-table tr.is-grade-diff td:first-child {
    background: rgba(245, 196, 0, .28);
}

.grade-update-form {
    display: grid;
    gap: 10px;
    margin: 12px 0;
    padding: 12px;
    border: 1px solid rgba(184, 69, 69, .30);
    border-radius: 8px;
    background: rgba(184, 69, 69, .07);
}

.grade-update-form label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.5;
}

.grade-update-form input {
    flex: 0 0 auto;
    margin-top: 3px;
}

.grade-update-form button {
    justify-self: start;
    min-height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: var(--red);
    color: #fff;
    font-weight: 950;
    cursor: pointer;
}

.grade-update-form button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.grade-step-row > td {
    padding: 0;
    background: #fbfcf9;
}

.grade-step-row > td:first-child {
    position: static;
    max-width: none;
    background: #fbfcf9;
    white-space: normal;
}

.grade-step-details {
    padding: 0;
}

.grade-step-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 10px 12px;
    color: var(--nuva-dark);
    font-weight: 950;
    cursor: pointer;
    list-style-position: inside;
}

.grade-step-details summary strong {
    color: var(--muted);
    font-size: 12px;
}

.grade-step-table-wrap {
    max-height: 420px;
    overflow: auto;
    border-top: 1px solid var(--line);
    -webkit-overflow-scrolling: touch;
}

.grade-step-table {
    min-width: 820px;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.grade-step-table th,
.grade-step-table td {
    padding: 9px 8px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.grade-step-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f7f4e6;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.grade-step-table td strong,
.grade-step-table td span {
    display: block;
}

.grade-step-table td span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.grade-step-table tr.has-grade-event td {
    background: rgba(45, 125, 103, .10);
    font-weight: 900;
}

.hall-summary-panel,
.hall-panel {
    margin-top: 16px;
}

.hall-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
}

.hall-table {
    min-width: 520px;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.hall-table th,
.hall-table td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.hall-table th {
    background: #f7f4e6;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.hall-table td:first-child,
.hall-table th:first-child {
    width: 74px;
    text-align: center;
    font-weight: 950;
}

.hall-table td:nth-child(2) {
    font-weight: 950;
}

.hall-table tbody tr:last-child td {
    border-bottom: 0;
}

.legend-level-list {
    display: grid;
    gap: 10px;
}

.legend-level {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcf9;
}

.legend-level summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    padding: 11px 13px;
    color: var(--ink);
    font-weight: 950;
    cursor: pointer;
    list-style-position: inside;
}

.legend-level summary strong {
    color: var(--nuva-dark);
    font-size: 13px;
}

.legend-level .hall-table-wrap {
    border-width: 1px 0 0;
    border-radius: 0;
}

.tool-heading {
    margin-bottom: 14px;
}

.tool-start-panel,
.tool-complete-panel {
    display: grid;
    gap: 16px;
}

.tool-start-form {
    display: grid;
    gap: 14px;
}

.tool-seat-grid {
    display: grid;
    gap: 10px;
}

.tool-seat-field {
    margin-top: 0;
}

.tool-option-fieldset {
    margin-top: 0;
}

.tool-option-grid {
    display: grid;
    gap: 8px;
}

.tool-note {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.tool-point-preview {
    display: grid;
    place-items: center;
    min-height: 54px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    font-size: 18px;
    font-weight: 900;
    text-align: center;
}

.tool-play {
    display: grid;
    gap: 12px;
}

.tool-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tool-topbar h1 {
    margin: 2px 0 0;
    font-size: 26px;
}

.tool-round {
    flex: 0 0 auto;
    min-width: 132px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    text-align: right;
}

.tool-round.is-win-mode {
    min-width: 250px;
    border-color: rgba(15, 23, 42, 0.18);
    background: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
    text-align: center;
}

.tool-round strong,
.tool-round span {
    display: block;
}

.tool-round strong {
    font-size: 16px;
}

.tool-round span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.tool-score-board {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.tool-player-card {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.tool-player-card.is-dealer {
    border-color: var(--nuva);
    box-shadow: inset 0 0 0 2px rgba(245, 196, 0, .35);
}

.tool-player-card div {
    min-width: 0;
}

.tool-player-card span,
.tool-player-card strong {
    display: block;
}

.tool-player-card span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.tool-player-card strong {
    margin-top: 2px;
    overflow-wrap: anywhere;
    font-size: 15px;
}

.tool-player-card b {
    font-size: 24px;
    line-height: 1.1;
}

.tool-player-card button {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.tool-player-card button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.tool-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.tool-actions .primary-button,
.tool-actions .secondary-button {
    min-height: 42px;
    margin-top: 0;
    padding: 8px;
    font-size: 13px;
}

.tool-control-panel {
    display: grid;
    gap: 12px;
}

.tool-control-panel[hidden] {
    display: none;
}

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

.tool-control-grid .field {
    margin-top: 0;
}

.tool-check-grid {
    display: grid;
    grid-template-areas:
        ". top ."
        "left center right"
        ". bottom .";
    grid-template-columns: 132px 64px 132px;
    justify-content: center;
    gap: 10px;
    align-items: center;
}

.tool-check-grid label {
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    gap: 8px;
    width: 132px;
    min-height: 48px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
}

.tool-check-grid label span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.tool-check-grid::before {
    content: "";
    grid-area: center;
    width: 54px;
    height: 54px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(245, 196, 0, .16);
}

.tool-check-grid label:nth-child(1) {
    grid-area: bottom;
}

.tool-check-grid label:nth-child(2) {
    grid-area: right;
}

.tool-check-grid label:nth-child(3) {
    grid-area: top;
}

.tool-check-grid label:nth-child(4) {
    grid-area: left;
}

.tool-final-list {
    display: grid;
    gap: 8px;
}

.tool-final-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
}

.tool-final-list span {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 800;
}

.tool-final-list strong {
    flex: 0 0 auto;
}

.tool-table {
    position: relative;
    width: min(100%, 760px);
    min-height: min(720px, calc(100dvh - 160px));
    margin: 0 auto;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: #f7f6f1;
    overflow: hidden;
}

.tool-corner-button {
    position: absolute;
    z-index: 4;
    width: 104px;
    height: 104px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 26px;
    font-weight: 900;
    cursor: pointer;
}

.tool-corner-button:focus,
.tool-seat-buttons button:focus {
    outline: 3px solid rgba(245, 196, 0, .35);
}

.tool-end-button {
    top: 8px;
    left: 8px;
}

.tool-fix-button {
    top: 8px;
    right: 8px;
}

.tool-draw-button {
    bottom: 8px;
    left: 8px;
}

.tool-timer {
    display: grid;
    grid-template-columns: minmax(150px, auto) auto auto auto;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: min(100%, 560px);
    margin: 0 auto;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .14);
}

.tool-timer strong {
    color: var(--ink);
    font-size: 44px;
    font-weight: 950;
    line-height: 1;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.tool-timer label {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.tool-timer input {
    width: 64px;
    min-height: 44px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
    color: var(--ink);
    font: inherit;
    font-size: 18px;
    font-weight: 950;
    text-align: center;
}

.tool-timer button {
    min-width: 76px;
    min-height: 48px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--nuva);
    color: var(--ink);
    font: inherit;
    font-size: 16px;
    font-weight: 950;
    cursor: pointer;
}

.tool-timer button.is-active {
    background: var(--surface);
}

.tool-table .tool-score-board {
    position: absolute;
    inset: 0;
    display: block;
}

.tool-table .tool-player-card {
    position: absolute;
    z-index: 2;
    display: grid;
    grid-template-rows: auto auto auto;
    gap: 4px;
    width: 232px;
    min-height: 148px;
    padding: 10px;
    border: 0;
    box-shadow: none;
    background: transparent;
    text-align: center;
}

.tool-table .tool-player-card.is-dealer {
    border: 3px solid #d6a400;
    background: rgba(255, 248, 204, .92);
    box-shadow: 0 0 0 3px rgba(245, 196, 0, .24);
}

.tool-seat-1 {
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
}

.tool-seat-2 {
    right: 22px;
    top: 50%;
    transform: translateY(-50%) rotate(270deg);
}

.tool-seat-3 {
    left: 50%;
    top: 28px;
    transform: translateX(-50%) rotate(180deg);
}

.tool-seat-4 {
    left: 22px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
}

.tool-seat-main {
    display: grid;
    gap: 1px;
}

.tool-player-badges {
    display: flex;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    overflow: visible;
}

.tool-player-badges span {
    display: -webkit-box;
    max-width: 132px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--nuva-dark);
    font-size: 16px;
    font-weight: 900;
    line-height: 1.2;
    overflow: hidden;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tool-player-badge-title {
    color: var(--ink);
}

.tool-seat-main strong {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 21px;
    line-height: 1.2;
}

.tool-player-card.is-kikakui-grade .tool-player-badge-grade,
.tool-player-card.is-kikakui-grade .tool-seat-main strong {
    color: #b98400;
    text-shadow: 0 0 2px rgba(255, 236, 150, .45);
    animation: toolGoldShine 1.8s ease-in-out infinite alternate;
    will-change: color, text-shadow;
}

.tool-player-card.is-legend-grade .tool-player-badge-grade,
.tool-player-card.is-legend-grade .tool-seat-main strong {
    background: linear-gradient(90deg, #ff1744 0%, #ff9100 8.33%, #ffea00 16.66%, #00c853 25%, #00b0ff 33.33%, #651fff 41.66%, #ff1744 50%, #ff9100 58.33%, #ffea00 66.66%, #00c853 75%, #00b0ff 83.33%, #651fff 91.66%, #ff1744 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    animation: toolRainbowShine 3.2s linear infinite, toolLegendPulse 1.8s ease-in-out infinite alternate;
    will-change: background-position, filter;
}

.tool-player-card.is-kikakui-grade .tool-player-badge-title,
.tool-player-card.is-legend-grade .tool-player-badge-title {
    color: var(--ink);
    background: transparent;
    -webkit-background-clip: initial;
    background-clip: initial;
    text-shadow: none;
    filter: none;
    animation: none;
}

@keyframes toolGoldShine {
    0% {
        color: #a56d00;
        text-shadow: 0 0 1px rgba(255, 244, 170, .35);
    }
    100% {
        color: #d59a00;
        text-shadow: 0 0 2px rgba(255, 229, 120, .55);
    }
}

@keyframes toolRainbowShine {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: -100% 50%;
    }
}

@keyframes toolLegendPulse {
    0% {
        filter: brightness(1);
    }
    100% {
        filter: brightness(1.16);
    }
}

.tool-player-card .tool-score-button {
    display: block;
    width: 100%;
    min-height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 36px;
    font-weight: 900;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.tool-player-card .tool-score-button.is-gap-base {
    color: var(--nuva-dark);
}

.tool-player-card .tool-score-button.is-win-choice {
    min-height: 50px;
    border: 2px solid var(--ink);
    border-radius: 8px;
    background: var(--nuva);
    color: var(--ink);
    font-size: 28px;
}

.tool-seat-markers {
    display: flex;
    justify-content: center;
    gap: 6px;
    min-height: 14px;
}

.tool-seat-markers small {
    min-width: 40px;
    color: var(--nuva-dark);
    font-size: 13px;
    font-weight: 900;
}

.tool-seat-buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.tool-seat-buttons button {
    min-height: 44px;
    padding: 7px 4px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
}

.tool-seat-buttons button[data-riichi] {
    background: #1646c8;
    color: #fff;
}

.tool-seat-buttons button[data-huro] {
    background: #c52727;
    color: #fff;
}

.tool-seat-buttons button.is-active-riichi,
.tool-seat-buttons button.is-active-riichi:disabled {
    background: var(--surface);
    color: var(--ink);
    opacity: 1;
}

.tool-seat-buttons button.is-active-huro,
.tool-seat-buttons button.is-active-huro:disabled {
    background: var(--surface);
    color: var(--ink);
    opacity: 1;
}

.tool-seat-buttons button[data-clear-seat] {
    font-size: 13px;
    white-space: nowrap;
}

.tool-table .tool-round {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    width: 174px;
    height: 174px;
    min-width: 0;
    padding: 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    text-align: center;
    transform: translate(-50%, -50%);
}

.tool-table .tool-round.is-win-mode {
    width: 218px;
    height: 236px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
}

.tool-table.has-panel .tool-round {
    visibility: hidden;
}

.tool-table .tool-round strong,
.tool-table .tool-round span,
.tool-table .tool-round em {
    display: block;
    color: var(--ink);
    font-style: normal;
    font-weight: 900;
    line-height: 1.15;
}

.tool-table .tool-round strong {
    font-size: 40px;
}

.tool-table .tool-round span,
.tool-table .tool-round em {
    font-size: 32px;
}

.tool-win-center {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    width: 100%;
    height: 100%;
    padding: 4px;
    border-radius: 8px;
    background: #fff;
}

.tool-win-center strong {
    max-width: 100%;
    overflow-wrap: normal;
    color: var(--ink);
    font-size: 21px;
    line-height: 1.06;
    letter-spacing: 0;
    white-space: nowrap;
}

.tool-win-center .tool-win-honba-line {
    display: block;
    margin: 0;
    color: var(--muted);
    font-size: .72em;
    line-height: .92;
}

.tool-win-center div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
}

.tool-win-center select {
    min-height: 42px;
    padding: 5px 6px;
    font-size: 15px;
    font-weight: 900;
}

.tool-win-center span {
    font-size: 16px;
    line-height: 1.2;
}

.tool-win-center button {
    min-height: 34px;
    padding: 4px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    font-weight: 900;
}

.tool-panel-layer {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
}

.tool-processing {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 8;
    display: grid;
    place-items: center;
    gap: 8px;
    width: min(260px, calc(100% - 40px));
    min-height: 136px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow);
    text-align: center;
    transform: translate(-50%, -50%);
    pointer-events: auto;
}

.tool-processing strong {
    font-size: 24px;
}

.tool-processing span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.tool-panel-layer .tool-control-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(408px, calc(100% - 18px));
    max-height: calc(100% - 24px);
    overflow: auto;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7f6f1;
    box-shadow: var(--shadow);
    transform: translate(-50%, -50%);
    pointer-events: auto;
}

.tool-panel-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.tool-panel-actions .primary-button,
.tool-panel-actions .secondary-button {
    min-height: 50px;
    margin-top: 0;
    font-size: 15px;
}

.tool-fix-round-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.tool-fix-round-grid .field {
    margin-top: 0;
    gap: 4px;
}

.tool-fix-round-grid input,
.tool-fix-round-grid select {
    min-height: 40px;
    padding: 6px 7px;
    font-size: 13px;
}

.tool-fix-table-wrap {
    overflow-x: auto;
}

.tool-fix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tool-fix-table th,
.tool-fix-table td {
    padding: 5px 3px;
    text-align: center;
    vertical-align: middle;
}

.tool-fix-table th {
    width: 78px;
    overflow-wrap: anywhere;
    font-weight: 900;
}

.tool-fix-table input {
    width: 78px;
    min-height: 34px;
    padding: 4px 5px;
    font-size: 13px;
}

.tool-fix-table button {
    min-height: 32px;
    padding: 4px 6px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.settings-panel {
    margin-top: 16px;
}

.settings-list {
    display: grid;
    gap: 8px;
    margin: 0;
}

.settings-list div {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
}

.settings-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.settings-list dd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    margin: 0;
    font-weight: 900;
}

.settings-list dd span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.settings-list a,
.settings-panel .panel-title a {
    flex: 0 0 auto;
    color: var(--nuva-dark);
    font-size: 12px;
    font-weight: 900;
}

.settings-form {
    box-shadow: none;
}

.settings-form .secondary-button {
    margin-top: 0;
}

.gacha-panel {
    display: grid;
    gap: 14px;
}

.gacha-result {
    display: grid;
    place-items: center;
    gap: 8px;
    padding: 18px;
    border: 2px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
    text-align: center;
}

.gacha-result span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 950;
}

.gacha-result strong {
    color: var(--ink);
    font-size: clamp(26px, 8vw, 40px);
    line-height: 1.15;
}

.gacha-result p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.gacha-action-form .primary-button,
.gacha-action-form .secondary-button,
.gacha-result .secondary-button {
    margin-top: 0;
}

.gacha-balance {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gacha-balance span {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fafbf8;
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
}

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

.gacha-button-grid form {
    margin: 0;
}

.gacha-button-grid button {
    width: 100%;
    min-height: 58px;
    line-height: 1.25;
}

.gacha-button-grid button small {
    font-size: 11px;
    font-weight: 850;
}

.grant-form-grid {
    display: grid;
    gap: 12px;
}

.grant-form-grid .settings-form {
    align-content: start;
    margin: 0;
}

.grant-form-grid h3 {
    margin: 0;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.3;
}

.gacha-preset-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
}

.gacha-preset-form label {
    margin: 0;
}

.gacha-active-label {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.gacha-active-label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.gacha-active-label strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.25;
}

.gacha-preset-form .secondary-button {
    width: auto;
    min-width: 148px;
    margin-top: 0;
}

.gacha-preset-form .primary-button {
    width: auto;
    min-width: 148px;
    margin-top: 0;
}

.settings-form textarea {
    width: 100%;
    min-height: 180px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    line-height: 1.5;
}

.gacha-result-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.gacha-result-list article {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
}

.gacha-result-list span,
.gacha-result-list small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 950;
}

.gacha-result-list strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.2;
}

.gacha-result-list form {
    margin: 0;
}

.gacha-result-list button {
    width: 100%;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.gacha-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gacha-pool span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fafbf8;
    color: var(--ink);
    font-size: 12px;
    font-weight: 900;
}

.gacha-pool em {
    color: var(--muted);
    font-style: normal;
    font-size: 11px;
    font-weight: 950;
}

.gacha-pool b {
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(45, 125, 103, .12);
    color: var(--green);
    font-size: 10px;
    font-weight: 950;
}

.gacha-pool span.is-owned {
    border-color: rgba(45, 125, 103, .45);
    box-shadow: inset 0 0 0 1px rgba(45, 125, 103, .12);
}

.title-status-list {
    display: grid;
    gap: 8px;
}

.title-status-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
    overflow: hidden;
}

.title-status-card summary {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 10px;
    cursor: pointer;
}

.title-status-card summary::-webkit-details-marker {
    display: none;
}

.title-status-card summary span,
.title-status-card summary em,
.title-status-card summary b {
    min-width: 0;
}

.title-status-card summary strong,
.title-status-card summary small,
.title-status-card summary em,
.title-status-card summary b {
    display: block;
    overflow-wrap: anywhere;
}

.title-status-card summary strong {
    color: var(--ink);
    font-size: 14px;
    line-height: 1.25;
}

.title-status-card summary small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}

.title-status-card summary em {
    color: var(--green);
    font-style: normal;
    font-size: 12px;
    font-weight: 950;
}

.title-status-card summary b {
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(45, 125, 103, .1);
    color: var(--green);
    font-size: 11px;
    font-weight: 950;
}

.title-status-owned {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 10px 10px;
}

.title-status-owned span {
    display: inline-grid;
    gap: 2px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font-size: 12px;
    font-weight: 900;
}

.title-status-owned span em {
    color: var(--muted);
    font-style: normal;
    font-size: 10px;
    font-weight: 850;
}

.title-status-owned span.is-equipped {
    border-color: rgba(245, 196, 0, .5);
    background: rgba(245, 196, 0, .18);
}

.title-status-owned p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.rarity-r {
    border-color: rgba(45, 125, 103, .32) !important;
}

.rarity-sr {
    border-color: rgba(214, 164, 0, .42) !important;
    background: rgba(245, 196, 0, .16) !important;
}

.rarity-ssr {
    border-color: rgba(184, 69, 69, .35) !important;
    background: linear-gradient(135deg, rgba(245, 196, 0, .22), rgba(184, 69, 69, .12)) !important;
}

body.has-gacha-overlay {
    overflow: hidden;
}

.gacha-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(15, 23, 42, .72);
    opacity: 1;
    backdrop-filter: blur(5px);
}

.gacha-overlay.is-closing {
    opacity: 0;
    transition: opacity .24s ease;
}

.gacha-animation {
    position: relative;
    display: grid;
    place-items: center;
    gap: 16px;
    width: min(100%, 360px);
    min-height: 420px;
    text-align: center;
}

.gacha-burst {
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background:
        repeating-conic-gradient(from 0deg, rgba(245, 196, 0, .92) 0deg 8deg, transparent 8deg 18deg),
        radial-gradient(circle, rgba(255, 255, 255, .95) 0 18%, rgba(245, 196, 0, .55) 19% 40%, transparent 41%);
    filter: blur(.2px);
    opacity: .58;
    animation: gachaBurstSpin 1.2s linear infinite, gachaBurstPulse 1.1s ease-in-out infinite alternate;
}

.gacha-card {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    gap: 10px;
    width: 210px;
    min-height: 276px;
    padding: 22px;
    border: 3px solid #d6a400;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 52px rgba(0, 0, 0, .34);
    transform: rotateY(90deg) scale(.86);
    animation: gachaCardEnter 1.05s cubic-bezier(.16, 1, .3, 1) forwards;
    transform-style: preserve-3d;
}

.gacha-card::before {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(214, 164, 0, .34);
    border-radius: 6px;
    pointer-events: none;
}

.gacha-card span,
.gacha-card strong,
.gacha-animation p,
.gacha-animation button {
    opacity: 0;
    transform: translateY(8px);
}

.gacha-overlay-results {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: min(100%, 320px);
    max-height: 164px;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(8px);
}

.gacha-overlay.is-revealed .gacha-overlay-results {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .34s ease, transform .34s ease;
}

.gacha-overlay-results span {
    min-width: 0;
    padding: 6px 7px;
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: 8px;
    background: rgba(255, 255, 255, .9);
    color: var(--ink);
    font-size: 11px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.gacha-overlay.is-revealed .gacha-card span,
.gacha-overlay.is-revealed .gacha-card strong,
.gacha-overlay.is-revealed .gacha-animation p,
.gacha-overlay.is-revealed .gacha-animation button {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .34s ease, transform .34s ease;
}

.gacha-card span {
    color: var(--muted);
    font-size: 16px;
    font-weight: 950;
}

.gacha-card strong {
    color: var(--ink);
    font-size: clamp(25px, 7vw, 34px);
    line-height: 1.18;
}

.gacha-animation p {
    position: relative;
    z-index: 1;
    margin: 0;
    color: #fff;
    font-size: 17px;
    font-weight: 950;
}

.gacha-animation button {
    position: relative;
    z-index: 1;
    width: min(100%, 240px);
    margin-top: 0;
}

.gacha-overlay.rarity-r .gacha-card {
    border-color: #2d7d67;
    box-shadow: 0 24px 52px rgba(0, 0, 0, .34), 0 0 28px rgba(45, 125, 103, .45);
}

.gacha-overlay.rarity-sr .gacha-card {
    border-color: #d6a400;
    box-shadow: 0 24px 52px rgba(0, 0, 0, .34), 0 0 34px rgba(245, 196, 0, .62);
}

.gacha-overlay.rarity-ssr .gacha-burst {
    background:
        repeating-conic-gradient(from 0deg, #ff1744 0deg 8deg, #ff9100 8deg 16deg, #ffea00 16deg 24deg, #00c853 24deg 32deg, #00b0ff 32deg 40deg, #651fff 40deg 48deg),
        radial-gradient(circle, rgba(255, 255, 255, .95) 0 18%, rgba(245, 196, 0, .55) 19% 40%, transparent 41%);
}

.gacha-overlay.rarity-ssr .gacha-card {
    border-color: #ffea00;
    box-shadow: 0 24px 52px rgba(0, 0, 0, .34), 0 0 42px rgba(255, 234, 0, .72), 0 0 72px rgba(0, 176, 255, .48);
}

@keyframes gachaCardEnter {
    0% {
        transform: rotateY(90deg) scale(.86);
        filter: brightness(.7);
    }
    52% {
        transform: rotateY(-8deg) scale(1.05);
        filter: brightness(1.45);
    }
    100% {
        transform: rotateY(0deg) scale(1);
        filter: brightness(1);
    }
}

@keyframes gachaBurstSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes gachaBurstPulse {
    from {
        transform: scale(.88);
    }
    to {
        transform: scale(1.06);
    }
}

.room-studio {
    display: grid;
    gap: 14px;
    overflow: hidden;
}

.room-option {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.room-generated-stage {
    display: grid;
    place-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8faf5;
    overflow: hidden;
}

.room-generated-stage > img:not(.room-part) {
    display: block;
    width: min(100%, 760px);
    height: auto;
    border-radius: 8px;
    box-shadow: 0 12px 26px rgba(28, 31, 36, .14);
}

.room-layered-stage {
    position: relative;
    display: block;
    width: min(100%, 900px);
    height: auto;
    aspect-ratio: 900 / 650;
    min-height: 0;
    padding: 0;
    margin-inline: auto;
    background: linear-gradient(180deg, #f8faf5, #eef2ea);
}

.room-layered-stage .room-part {
    position: absolute;
    display: block;
    width: auto;
    height: auto;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
    pointer-events: none;
    user-select: none;
}

.room-part-wall {
    z-index: 1;
    left: 0;
    top: 2%;
    width: 100%;
}

.room-part-floor {
    z-index: 2;
    left: -1%;
    top: 51%;
    width: 102%;
}

.room-part-shelf {
    z-index: 4;
    right: 9%;
    top: 39%;
    width: 25%;
}

.room-part-plant {
    z-index: 5;
    right: 2%;
    top: 27%;
    width: 17%;
}

.room-part-table {
    z-index: 6;
    left: 38%;
    top: 66%;
    width: 28%;
}

.room-part-cushion {
    z-index: 6;
    right: 12%;
    top: 67%;
    width: 22%;
}

.room-part-avatar {
    z-index: 7;
    left: 18%;
    bottom: 4%;
    width: 14%;
}

.room-stage {
    min-height: 430px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #dfe9e2;
}

.avatar-room {
    --wall-a: #cfe4df;
    --wall-b: #edf5ef;
    --floor-a: #c59660;
    --floor-b: #a97845;
    --outfit: #2d7d67;
    --outfit-dark: #1f5d4b;
    position: relative;
    min-height: 430px;
    background: linear-gradient(180deg, var(--wall-a) 0 62%, var(--floor-a) 62% 100%);
}

.room-wall {
    position: absolute;
    inset: 0 0 38%;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .28) 1px, transparent 1px) 0 0 / 42px 42px,
        linear-gradient(180deg, var(--wall-a), var(--wall-b));
}

.room-floor {
    position: absolute;
    inset: 62% 0 0;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .15) 0 2px, transparent 2px 58px),
        linear-gradient(135deg, var(--floor-a), var(--floor-b));
}

.room-window {
    position: absolute;
    top: 24px;
    right: 22px;
    width: 96px;
    height: 76px;
    border: 6px solid #f8fbf6;
    border-radius: 8px;
    background: linear-gradient(180deg, #8ed0f0, #e8fbff);
    box-shadow: 0 8px 18px rgba(46, 71, 59, .12);
}

.room-window::before,
.room-window::after {
    content: "";
    position: absolute;
    background: rgba(248, 251, 246, .95);
}

.room-window::before {
    inset: 0 auto 0 50%;
    width: 5px;
    transform: translateX(-50%);
}

.room-window::after {
    inset: 50% 0 auto;
    height: 5px;
    transform: translateY(-50%);
}

.room-window span {
    position: absolute;
    left: 12px;
    top: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f6d365;
    box-shadow: 0 0 22px rgba(246, 211, 101, .7);
}

.room-poster {
    position: absolute;
    left: 18px;
    top: 28px;
    display: grid;
    place-items: center;
    width: 82px;
    height: 58px;
    border: 4px solid #fafbf8;
    border-radius: 6px;
    background: #253b34;
    color: #f5c400;
    font-size: 16px;
    font-weight: 950;
}

.room-shelf {
    position: absolute;
    left: 118px;
    top: 44px;
    display: flex;
    gap: 8px;
    align-items: end;
    width: 118px;
    height: 42px;
    padding: 0 10px 8px;
    border-bottom: 8px solid #8b5f3a;
}

.room-shelf span {
    display: block;
    width: 22px;
    border-radius: 5px 5px 2px 2px;
    background: #d86f45;
}

.room-shelf span:nth-child(1) {
    height: 28px;
}

.room-shelf span:nth-child(2) {
    height: 20px;
    background: #2d7d67;
}

.room-shelf span:nth-child(3) {
    height: 32px;
    background: #f5c400;
}

.room-rug {
    position: absolute;
    left: 50%;
    bottom: 24px;
    width: min(70%, 420px);
    height: 86px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(245, 196, 0, .34), rgba(45, 125, 103, .18) 64%, transparent 66%);
    transform: translateX(-50%);
}

.room-table {
    position: absolute;
    left: 50%;
    bottom: 70px;
    display: grid;
    place-items: center;
    width: 150px;
    height: 76px;
    border: 7px solid #5f3c27;
    border-radius: 18px;
    background: #2d7d67;
    box-shadow: 0 16px 26px rgba(38, 54, 47, .24);
    transform: translateX(-50%);
}

.room-table span {
    position: absolute;
    width: 28px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .8);
    border-radius: 4px;
    background: #f8fbf6;
}

.room-table span:nth-child(1) {
    top: 14px;
    left: 22px;
}

.room-table span:nth-child(2) {
    top: 14px;
    right: 22px;
}

.room-table span:nth-child(3) {
    bottom: 14px;
    left: 22px;
}

.room-table span:nth-child(4) {
    right: 22px;
    bottom: 14px;
}

.room-trophy,
.room-plant {
    position: absolute;
    display: none;
}

.room-trophy {
    right: 34px;
    bottom: 88px;
    width: 54px;
    height: 76px;
    border-radius: 8px 8px 18px 18px;
    background: linear-gradient(135deg, #f5c400, #fff1a6 48%, #d6a400);
    box-shadow: 0 14px 22px rgba(38, 54, 47, .22);
}

.room-trophy::before,
.room-trophy::after {
    content: "";
    position: absolute;
    top: 14px;
    width: 24px;
    height: 24px;
    border: 5px solid #d6a400;
    border-radius: 50%;
}

.room-trophy::before {
    left: -20px;
}

.room-trophy::after {
    right: -20px;
}

.room-plant {
    left: 34px;
    bottom: 76px;
    width: 62px;
    height: 104px;
}

.room-plant::after {
    content: "";
    position: absolute;
    left: 16px;
    bottom: 0;
    width: 30px;
    height: 38px;
    border-radius: 5px 5px 14px 14px;
    background: #9b5f43;
}

.room-plant span {
    position: absolute;
    left: 20px;
    bottom: 34px;
    width: 26px;
    height: 58px;
    border-radius: 999px 999px 0 999px;
    background: #2d7d67;
    transform: rotate(-30deg);
}

.room-plant span:nth-child(2) {
    left: 16px;
    bottom: 42px;
    transform: rotate(34deg);
    background: #3f9a69;
}

.css-avatar {
    position: absolute;
    left: 50%;
    bottom: 116px;
    width: 116px;
    height: 190px;
    transform: translateX(-50%);
}

.avatar-badge {
    position: absolute;
    left: 50%;
    top: -30px;
    z-index: 4;
    padding: 5px 10px;
    border: 1px solid rgba(214, 164, 0, .52);
    border-radius: 999px;
    background: #fff8cf;
    color: #6a4c00;
    font-size: 12px;
    font-weight: 950;
    white-space: nowrap;
    transform: translateX(-50%);
}

.avatar-head {
    position: absolute;
    left: 50%;
    top: 34px;
    z-index: 3;
    width: 70px;
    height: 74px;
    border: 3px solid rgba(63, 44, 33, .2);
    border-radius: 46% 46% 48% 48%;
    background: #f3c7a9;
    transform: translateX(-50%);
}

.avatar-hair {
    position: absolute;
    left: 50%;
    top: 20px;
    z-index: 4;
    width: 78px;
    height: 48px;
    border-radius: 48px 48px 16px 16px;
    background: #3d2b24;
    transform: translateX(-50%);
}

.avatar-hair::after {
    content: "";
    position: absolute;
    left: 8px;
    top: 22px;
    width: 22px;
    height: 34px;
    border-radius: 999px;
    background: #3d2b24;
    transform: rotate(12deg);
}

.avatar-eye {
    position: absolute;
    top: 32px;
    width: 7px;
    height: 10px;
    border-radius: 50%;
    background: #253b34;
}

.avatar-eye.left {
    left: 22px;
}

.avatar-eye.right {
    right: 22px;
}

.avatar-mouth {
    position: absolute;
    left: 50%;
    bottom: 18px;
    width: 18px;
    height: 8px;
    border-bottom: 3px solid #9d4b4b;
    border-radius: 0 0 999px 999px;
    transform: translateX(-50%);
}

.avatar-body {
    position: absolute;
    left: 50%;
    top: 102px;
    z-index: 2;
    width: 78px;
    height: 78px;
    border: 4px solid var(--outfit-dark);
    border-radius: 24px 24px 14px 14px;
    background:
        linear-gradient(90deg, transparent 46%, rgba(255, 255, 255, .44) 46% 54%, transparent 54%),
        var(--outfit);
    transform: translateX(-50%);
}

.avatar-arm,
.avatar-leg {
    position: absolute;
    z-index: 1;
    background: var(--outfit-dark);
}

.avatar-arm {
    top: 112px;
    width: 22px;
    height: 62px;
    border-radius: 999px;
}

.avatar-arm.left {
    left: 7px;
    transform: rotate(14deg);
}

.avatar-arm.right {
    right: 7px;
    transform: rotate(-14deg);
}

.avatar-leg {
    bottom: 0;
    width: 24px;
    height: 42px;
    border-radius: 0 0 999px 999px;
    background: #26362f;
}

.avatar-leg.left {
    left: 32px;
}

.avatar-leg.right {
    right: 32px;
}

.room-controls {
    display: grid;
    gap: 10px;
}

.room-controls fieldset {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.room-controls legend {
    padding: 0 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.room-controls label {
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fafbf8;
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.room-studio:has(#room-day:checked) label[for="room-day"],
.room-studio:has(#room-night:checked) label[for="room-night"],
.room-studio:has(#room-classic:checked) label[for="room-classic"],
.room-studio:has(#outfit-nuva:checked) label[for="outfit-nuva"],
.room-studio:has(#outfit-dealer:checked) label[for="outfit-dealer"],
.room-studio:has(#outfit-champion:checked) label[for="outfit-champion"],
.room-studio:has(#item-table:checked) label[for="item-table"],
.room-studio:has(#item-trophy:checked) label[for="item-trophy"],
.room-studio:has(#item-plant:checked) label[for="item-plant"] {
    border-color: rgba(45, 125, 103, .45);
    background: rgba(45, 125, 103, .12);
}

.room-studio:has(#room-night:checked) .avatar-room {
    --wall-a: #22363f;
    --wall-b: #344954;
    --floor-a: #6e5140;
    --floor-b: #493528;
}

.room-studio:has(#room-night:checked) .room-window {
    background: linear-gradient(180deg, #17223a, #43516b);
}

.room-studio:has(#room-night:checked) .room-window span {
    left: auto;
    right: 14px;
    background: #fff2a8;
    box-shadow: 0 0 20px rgba(255, 242, 168, .58);
}

.room-studio:has(#room-classic:checked) .avatar-room {
    --wall-a: #e4dcc8;
    --wall-b: #f5f0df;
    --floor-a: #8c9b68;
    --floor-b: #65714a;
}

.room-studio:has(#room-classic:checked) .room-wall {
    background:
        linear-gradient(90deg, rgba(126, 91, 58, .18) 1px, transparent 1px) 0 0 / 54px 54px,
        linear-gradient(180deg, var(--wall-a), var(--wall-b));
}

.room-studio:has(#outfit-dealer:checked) .avatar-room {
    --outfit: #1f2937;
    --outfit-dark: #111827;
}

.room-studio:has(#outfit-dealer:checked) .avatar-body::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 12px;
    width: 18px;
    height: 18px;
    border-radius: 2px;
    background: #f5c400;
    transform: translateX(-50%) rotate(45deg);
}

.room-studio:has(#outfit-champion:checked) .avatar-room {
    --outfit: #f5c400;
    --outfit-dark: #b58b00;
}

.room-studio:has(#outfit-champion:checked) .avatar-badge {
    background: linear-gradient(135deg, #fff3aa, #f5c400);
}

.room-studio:has(#item-trophy:checked) .room-table,
.room-studio:has(#item-plant:checked) .room-table {
    display: none;
}

.room-studio:has(#item-trophy:checked) .room-trophy,
.room-studio:has(#item-plant:checked) .room-plant {
    display: block;
}

.success-alert {
    border-color: rgba(45, 125, 103, .22);
    background: rgba(45, 125, 103, .12);
    color: var(--green);
}

.alert {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.5;
}

.alert.success {
    margin-top: 16px;
    border-color: rgba(45, 125, 103, .22);
    background: rgba(45, 125, 103, .12);
    color: var(--green);
}

.alert.error {
    margin-top: 16px;
    border-color: rgba(184, 69, 69, .25);
    background: rgba(184, 69, 69, .10);
    color: var(--red);
}

.participation-panel form {
    display: grid;
    gap: 16px;
}

.participation-help {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
}

.participation-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
}

.participation-table {
    width: 100%;
    min-width: 640px;
    border-collapse: separate;
    border-spacing: 0;
}

.participation-table th,
.participation-table td {
    padding: 7px;
    border-bottom: 1px solid var(--line);
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.participation-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f7f4e6;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.participation-table tbody th {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 70px;
    background: #f7f4e6;
    color: var(--ink);
    font-size: 12px;
    font-weight: 900;
}

.participation-table thead th:first-child {
    left: 0;
    z-index: 3;
}

.participation-table tbody tr:last-child th,
.participation-table tbody tr:last-child td {
    border-bottom: 0;
}

.slot-cell {
    display: block;
    position: relative;
    cursor: pointer;
    touch-action: manipulation;
}

.slot-cell,
.status-cell,
.status-cell-empty {
    width: 32px;
    height: 32px;
    margin: 0 auto;
}

.slot-cell input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.slot-cell span {
    display: grid;
    place-items: center;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
    color: var(--muted);
    font-size: 13px;
    font-weight: 950;
}

.slot-cell input:checked + span {
    border-color: #d6aa00;
    background: rgba(245, 196, 0, .34);
    color: var(--ink);
    box-shadow: inset 0 0 0 1px rgba(214, 170, 0, .5);
}

.status-cell {
    position: relative;
}

.status-cell summary {
    display: grid;
    place-items: center;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(245, 196, 0, .28);
    color: var(--ink);
    font-size: 13px;
    font-weight: 950;
    cursor: pointer;
    list-style: none;
}

.status-cell summary::-webkit-details-marker {
    display: none;
}

.status-cell-empty {
    display: block;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
}

.status-names {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 5px);
    z-index: 8;
    display: grid;
    gap: 3px;
    min-width: 112px;
    max-width: 180px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    transform: translateX(-50%);
}

.status-names span {
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    white-space: normal;
}

.time-short {
    display: none;
}

.quiz-heading {
    max-width: 760px;
}

.quiz-panel {
    max-width: 760px;
    margin-inline: auto;
}

.quiz-title span {
    white-space: nowrap;
}

.quiz-board {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, #f7faf4 0%, #eef5eb 100%);
}

.quiz-hand {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: clamp(2px, 1vw, 7px);
    min-width: 0;
    overflow: hidden;
}

.quiz-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    aspect-ratio: 44 / 60;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 7px 16px rgba(23, 31, 21, .11);
}

[hidden] {
    display: none !important;
}

.quiz-tile img,
.quiz-choice img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.quiz-answer-status {
    min-height: 24px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
    text-align: center;
}

.quiz-wait-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
    max-width: 360px;
    margin-inline: auto;
}

.quiz-choice {
    display: grid;
    place-items: center;
    min-height: 72px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
}

.quiz-choice img {
    width: 44px;
    height: 60px;
}

.quiz-choice.is-selected {
    border-color: var(--accent);
    background: #e9f3df;
    color: #274513;
    box-shadow: inset 0 0 0 2px rgba(79, 130, 43, .25);
}

.quiz-choice.is-answer {
    border-color: #d69b00;
    background: #fff4bf;
    color: #563b00;
}

.quiz-choice:disabled {
    cursor: default;
    opacity: 1;
}

.quiz-actions {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.quiz-result {
    display: grid;
    gap: 5px;
    margin-top: 14px;
    padding: 13px;
    border-radius: 8px;
    font-weight: 800;
}

.quiz-result strong {
    font-size: 17px;
}

.quiz-result span {
    font-size: 13px;
}

.quiz-result.is-correct {
    border: 1px solid rgba(46, 125, 50, .28);
    background: #edf8ed;
    color: #1b5e20;
}

.quiz-result.is-miss {
    border: 1px solid rgba(179, 38, 30, .25);
    background: #fff0ef;
    color: #8c1d18;
}

.quiz-score {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0 0;
}

.quiz-score div {
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
    text-align: center;
}

.quiz-score dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}

.quiz-score dd {
    margin: 4px 0 0;
    font-size: 22px;
    font-weight: 950;
}

.quiz-title-awards {
    position: relative;
    display: grid;
    gap: 8px;
    margin: 18px 0 4px;
    padding: 22px 16px;
    overflow: hidden;
    border: 2px solid #d7a927;
    border-radius: 8px;
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, .9), transparent 26%),
        linear-gradient(135deg, #fff6c7, #ffe08a 48%, #fff1b2);
    color: #5f3500;
    text-align: center;
    box-shadow: 0 16px 38px rgba(133, 89, 0, .18);
    animation: quiz-award-pop .56s cubic-bezier(.18, 1.28, .28, 1) both;
}

.quiz-title-awards-burst {
    font-size: clamp(22px, 5vw, 38px);
    font-weight: 950;
}

.quiz-title-awards-list {
    display: grid;
    gap: 6px;
    justify-items: center;
}

.quiz-title-awards-list strong {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    background: #25170a;
    color: #fff7d1;
    font-size: clamp(18px, 4vw, 28px);
    box-shadow: 0 8px 22px rgba(37, 23, 10, .22);
}

.quiz-title-awards p {
    margin: 0;
    font-size: 14px;
    font-weight: 850;
}

@keyframes quiz-award-pop {
    0% {
        opacity: 0;
        transform: scale(.82) translateY(14px);
    }
    70% {
        opacity: 1;
        transform: scale(1.04) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.quiz-start,
.quiz-play,
.quiz-finish {
    display: grid;
    gap: 16px;
}

.quiz-settings {
    display: grid;
    gap: 14px;
}

.quiz-settings fieldset {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.quiz-settings legend {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.quiz-settings label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
    font-size: 14px;
    font-weight: 900;
}

.quiz-rule-box {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.quiz-rule-box span {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7f4e6;
    font-size: 12px;
    font-weight: 900;
    text-align: center;
}

.quiz-hud {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.quiz-hud div {
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
    text-align: center;
}

.quiz-hud span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.quiz-hud strong {
    display: block;
    margin-top: 4px;
    font-size: 24px;
    font-weight: 950;
}

.quiz-ranking-preview {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.quiz-ranking-preview h2 {
    margin: 0;
    font-size: 16px;
}

.quiz-ranking-table {
    min-width: 560px;
    font-size: 13px;
}

.quiz-ranking-preview > div {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.quiz-ranking-table th,
.quiz-ranking-table td {
    text-align: center;
}

.mini-game-list {
    max-width: 760px;
}

.mini-title-list {
    display: grid;
    gap: 14px;
}

.mini-title-card {
    display: grid;
    gap: 12px;
}

.mini-title-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.6;
}

.mini-title-table-wrap {
    overflow-x: auto;
}

.mini-title-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
}

.mini-title-table th,
.mini-title-table td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    font-size: 13px;
}

.mini-title-table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.mini-title-table td:first-child {
    width: 34%;
}

.mini-title-table strong {
    font-weight: 950;
}

.mini-title-actions {
    margin-top: 14px;
}

.mcr-judge-heading,
.mcr-judge-panel {
    max-width: 760px;
    margin-inline: auto;
}

.mcr-judge-panel {
    display: grid;
    gap: 14px;
}

.mcr-judge-top {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.mcr-judge-top div {
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
    text-align: center;
}

.mcr-judge-top span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.mcr-judge-top strong {
    display: block;
    margin-top: 4px;
    font-size: 24px;
    font-weight: 950;
}

.mcr-judge-board {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7f4e6;
}

.mcr-judge-hand {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.mcr-tile-group {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 1px;
    min-width: 0;
}

.mcr-tile-group.is-open,
.mcr-tile-group.is-concealed-kong {
    gap: 1px;
    padding: 12px 3px 3px;
    border: 1px solid rgba(45, 125, 103, .22);
    border-radius: 6px;
    background: rgba(45, 125, 103, .08);
}

.mcr-tile-group.is-concealed-kong {
    border-color: rgba(38, 45, 34, .30);
    background: rgba(38, 45, 34, .08);
}

.mcr-group-label {
    position: absolute;
    top: 1px;
    left: 4px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 950;
    line-height: 1;
    white-space: nowrap;
}

.mcr-tile {
    display: grid;
    place-items: center;
    width: clamp(17px, 4.6vw, 32px);
    aspect-ratio: 44 / 60;
    border: 1px solid rgba(38, 45, 34, .18);
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(38, 45, 34, .10);
    overflow: hidden;
}

.mcr-tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mcr-tile.is-text {
    color: var(--ink);
    font-size: 15px;
    font-weight: 950;
}

.mcr-tile.is-win {
    border-color: rgba(174, 71, 71, .72);
    background: #fff2f2;
    box-shadow: 0 0 0 2px rgba(174, 71, 71, .18);
}

.mcr-judge-message {
    min-height: 28px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 900;
    text-align: center;
}

.mcr-judge-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.mcr-judge-result {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
}

.mcr-judge-result strong {
    font-size: 18px;
    font-weight: 950;
}

.mcr-judge-result span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
    line-height: 1.55;
}

.mcr-judge-result.is-correct {
    border-color: rgba(45, 125, 103, .35);
    background: rgba(45, 125, 103, .10);
}

.mcr-judge-result.is-wrong {
    border-color: rgba(174, 71, 71, .35);
    background: rgba(174, 71, 71, .10);
}

.mcr-report-message {
    padding: 10px 12px;
    border: 1px solid rgba(45, 125, 103, .25);
    border-radius: 8px;
    background: rgba(45, 125, 103, .08);
    color: var(--ink);
    font-size: 13px;
    font-weight: 850;
}

.mcr-report-list {
    display: grid;
    gap: 12px;
}

.mcr-report-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.mcr-report-card.is-fixed {
    opacity: .72;
    background: #f7f7f3;
}

.mcr-report-hand {
    justify-content: flex-start;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow-x: auto;
}

.mcr-report-hand .mcr-tile {
    width: 30px;
}

.mcr-report-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.mcr-report-card-head strong,
.mcr-report-card-head span {
    display: block;
}

.mcr-report-card-head strong {
    font-size: 14px;
    font-weight: 950;
}

.mcr-report-card-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.mcr-report-status {
    flex: 0 0 auto;
    padding: 4px 8px;
    border: 1px solid rgba(45, 125, 103, .25);
    border-radius: 999px;
    background: rgba(45, 125, 103, .08);
    color: var(--ink);
    font-size: 12px;
    font-weight: 950;
}

.mcr-report-card.is-fixed .mcr-report-status {
    border-color: rgba(92, 98, 88, .25);
    background: rgba(92, 98, 88, .10);
}

.mcr-report-detail {
    display: grid;
    gap: 7px;
    margin: 0;
}

.mcr-report-detail div {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 8px;
}

.mcr-report-detail dt,
.mcr-report-detail dd {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
}

.mcr-report-detail dt {
    color: var(--muted);
    font-weight: 950;
}

.mcr-report-detail dd {
    overflow-wrap: anywhere;
    font-weight: 800;
}

.mcr-report-raw summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.mcr-report-raw pre {
    max-height: 260px;
    overflow: auto;
    margin: 8px 0 0;
    padding: 10px;
    border-radius: 8px;
    background: #20251f;
    color: #f6f2df;
    font-size: 11px;
    line-height: 1.5;
}

.mcr-report-actions {
    display: flex;
    justify-content: flex-end;
}

.mcr-report-fixed-meta {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-align: right;
}

.minesweeper-heading,
.minesweeper-panel {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.minesweeper-panel {
    display: grid;
    gap: 14px;
}

.minesweeper-top {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.minesweeper-stat {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
    text-align: center;
}

.minesweeper-stat span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.minesweeper-stat strong {
    display: block;
    margin-top: 4px;
    font-size: 22px;
    font-weight: 950;
}

.minesweeper-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.minesweeper-controls .primary-button,
.minesweeper-controls .secondary-button {
    margin-top: 0;
}

.minesweeper-levels {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.minesweeper-levels button {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    font-weight: 900;
}

.minesweeper-levels button.is-active,
.minesweeper-controls .secondary-button.is-active {
    border-color: var(--nuva);
    background: var(--nuva);
}

.minesweeper-message {
    min-height: 24px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
    text-align: center;
}

.minesweeper-board-wrap {
    overflow: hidden;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef5eb;
}

.minesweeper-ranking {
    display: grid;
    gap: 10px;
}

.minesweeper-ranking-grid {
    display: grid;
    gap: 10px;
}

.minesweeper-ranking-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
}

.minesweeper-ranking-card h3 {
    margin: 0 0 8px;
    font-size: 15px;
}

.minesweeper-ranking-card .quiz-ranking-table {
    min-width: 0;
}

.minesweeper-ranking-card .empty-state {
    margin: 0;
}

@media (min-width: 760px) {
    .minesweeper-ranking-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.minesweeper-board {
    display: grid;
    grid-template-columns: repeat(var(--mine-cols, 9), minmax(0, 1fr));
    gap: 3px;
    width: min(100%, 620px);
    margin: 0 auto;
    touch-action: manipulation;
    user-select: none;
}

.mine-cell {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 1;
    min-width: 0;
    padding: 1px;
    border: 1px solid rgba(38, 45, 34, .18);
    border-radius: 5px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .8), rgba(45, 125, 103, .12)),
        var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 11px;
    font-weight: 950;
    cursor: pointer;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.mine-cell.is-open {
    border-color: rgba(38, 45, 34, .1);
    background: #f7f5ea;
    cursor: default;
}

.mine-cell.is-flag {
    position: relative;
    border-color: rgba(214, 164, 0, .55);
    background: #fff4bf;
    color: #816400;
}

.mine-cell.is-flag::before {
    content: "";
    width: 42%;
    height: 52%;
    border-left: 3px solid #816400;
    background:
        linear-gradient(135deg, #b84545 0 50%, transparent 51%);
    transform: translateX(10%);
}

.mine-cell.is-flag::after {
    content: "";
    position: absolute;
    bottom: 20%;
    left: 50%;
    width: 42%;
    height: 3px;
    border-radius: 999px;
    background: #816400;
    transform: translateX(-30%);
}

.mine-cell.is-mine {
    border-color: rgba(184, 69, 69, .45);
    background: #fff1ef;
    color: var(--red);
}

.mine-cell img {
    display: block;
    width: min(78%, 28px);
    height: min(90%, 38px);
    object-fit: contain;
}

.minesweeper-actions .secondary-button {
    margin-top: 0;
}

.nikaku-heading,
.nikaku-panel {
    max-width: 760px;
    margin-inline: auto;
}

.nikaku-panel {
    display: grid;
    gap: 12px;
}

.nikaku-stage-select,
.nikaku-play {
    display: grid;
    gap: 12px;
}

.nikaku-stamina-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
}

.nikaku-stamina-bar span,
.nikaku-stamina-bar small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.nikaku-stamina-bar strong {
    color: var(--ink);
    font-size: 18px;
    font-weight: 950;
    text-align: center;
}

.nikaku-stamina-debug {
    min-height: 30px;
    padding: 6px 10px;
    font-size: 12px;
}

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

.nikaku-stage-card {
    display: grid;
    gap: 4px;
    min-height: 86px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.nikaku-stage-card strong {
    font-size: 16px;
    font-weight: 950;
}

.nikaku-stage-card span,
.nikaku-stage-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.nikaku-stage-card.is-cleared {
    border-color: rgba(45, 125, 103, .35);
    background: rgba(45, 125, 103, .10);
}

.nikaku-stage-card:disabled {
    cursor: default;
    opacity: .48;
}

.nikaku-hud {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.nikaku-hud div {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
    text-align: center;
}

.nikaku-hud span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.nikaku-hud strong {
    display: block;
    margin-top: 3px;
    font-size: 23px;
    font-weight: 950;
}

.nikaku-board-wrap {
    overflow: hidden;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef5eb;
}

.nikaku-board {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--nikaku-cols, 8), minmax(0, 1fr));
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
    max-width: 460px;
    margin: 0 auto;
}

.nikaku-cell {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 44 / 60;
    height: auto;
    padding: 1px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    cursor: pointer;
}

.nikaku-cell.is-bomb-tile {
    overflow: hidden;
    border-color: rgba(184, 69, 69, .58);
    background:
        radial-gradient(circle at 50% 54%, #2e3035 0 35%, transparent 36%),
        radial-gradient(circle at 50% 54%, #4b4f56 0 47%, transparent 48%),
        linear-gradient(145deg, #fff6f2 0 18%, #ffd7d0 19% 55%, #fff 56% 100%);
    box-shadow: inset 0 0 0 2px rgba(184, 69, 69, .18);
}

.nikaku-cell.is-order-tile {
    border-color: rgba(45, 125, 103, .5);
    background:
        linear-gradient(180deg, rgba(45, 125, 103, .10), transparent 44%),
        #fffdf8;
    box-shadow: inset 0 0 0 2px rgba(45, 125, 103, .12);
}

.nikaku-cell.is-order-locked {
    opacity: .7;
}

.nikaku-special-face {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 62%;
    aspect-ratio: 1;
    border-radius: 999px;
    color: var(--ink);
    font-size: 22px;
    line-height: 1;
    font-weight: 950;
    text-align: center;
    pointer-events: none;
}

.nikaku-cell.is-bomb-tile .nikaku-special-face {
    width: 44%;
    background: #fff4bf;
    color: #9e2d24;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .48), 0 2px 8px rgba(0, 0, 0, .28);
}

.nikaku-cell.is-bomb-tile::before {
    content: "";
    position: absolute;
    top: 11%;
    left: 51%;
    width: 24%;
    height: 18%;
    border-top: 3px solid #2e3035;
    border-radius: 999px 999px 0 0;
    transform: rotate(23deg);
}

.nikaku-cell.is-bomb-tile::after {
    content: "";
    position: absolute;
    top: 8%;
    left: 70%;
    width: 11%;
    height: 11%;
    border-radius: 50%;
    background: #f5c400;
    box-shadow: 0 0 8px rgba(245, 196, 0, .85);
}

.nikaku-cell.is-order-tile .nikaku-special-face {
    width: 72%;
    border: 2px solid rgba(45, 125, 103, .22);
    border-radius: 8px;
    background: rgba(255, 255, 255, .86);
    color: var(--green);
}

.nikaku-cell img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nikaku-cell.is-selected {
    border-color: var(--accent);
    background: #e9f3df;
    box-shadow: inset 0 0 0 2px rgba(79, 130, 43, .28);
}

.nikaku-cell.is-path {
    background: #fff4bf;
}

.nikaku-cell.is-block {
    border-color: rgba(38, 45, 34, .22);
    background:
        linear-gradient(135deg, rgba(38, 45, 34, .18) 25%, transparent 25%),
        linear-gradient(225deg, rgba(38, 45, 34, .18) 25%, transparent 25%),
        #dfe4da;
    background-size: 12px 12px;
    cursor: default;
}

.nikaku-cell.is-outer {
    border-color: rgba(45, 125, 103, .16);
    background: rgba(255, 255, 255, .34);
    cursor: default;
}

.nikaku-cell.is-empty {
    visibility: hidden;
}

.nikaku-board.is-blind::after {
    content: "爆発!";
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(24, 28, 22, .9);
    color: #fff;
    font-size: 28px;
    font-weight: 950;
    letter-spacing: .08em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .42);
    pointer-events: none;
}

.nikaku-cell.is-blink-tile img {
    animation: nikaku-tile-flicker 4.2s ease-in-out infinite;
    animation-delay: var(--nikaku-blink-delay, 0s);
}

.nikaku-cell.is-blink-tile:nth-child(3n + 1) img {
    animation-delay: var(--nikaku-blink-delay, -1.1s);
}

.nikaku-cell.is-blink-tile:nth-child(3n + 2) img {
    animation-delay: var(--nikaku-blink-delay, -2.2s);
}

@keyframes nikaku-tile-flicker {
    0%, 100% {
        filter: brightness(.98) contrast(1);
        opacity: 1;
    }

    48% {
        filter: brightness(.08) contrast(.55);
        opacity: .08;
    }
}

.nikaku-message {
    min-height: 24px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
    text-align: center;
}

.nikaku-actions {
    margin-top: 0;
}

.nikaku-debug-reset {
    margin: 12px 0 0;
}

.nikaku-debug-reset .danger-button {
    width: 100%;
}

.nikaku-actions .is-active {
    border-color: rgba(174, 71, 71, .45);
    background: #fff2f2;
    color: #7b2727;
}

.slot-heading,
.slot-panel {
    max-width: 760px;
    margin-inline: auto;
}

.slot-panel {
    display: grid;
    gap: 14px;
}

.slot-topline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.slot-topline div {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
    text-align: center;
}

.slot-topline span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.slot-topline strong {
    display: block;
    margin-top: 3px;
    font-size: 22px;
    font-weight: 950;
}

.slot-setting-control {
    display: grid;
    grid-template-columns: auto minmax(150px, 220px);
    align-items: center;
    justify-content: end;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.slot-setting-control select {
    min-height: 40px;
    padding: 8px 28px 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
}

.slot-machine {
    position: relative;
    overflow: hidden;
    padding: 16px;
    border: 2px solid #252116;
    border-radius: 10px;
    background: linear-gradient(180deg, #3a2818, #14110d);
    box-shadow: inset 0 0 0 4px rgba(245, 196, 0, .35), 0 18px 34px rgba(0, 0, 0, .22);
}

.slot-machine.is-kakuhen {
    box-shadow: inset 0 0 0 4px rgba(245, 196, 0, .75), 0 0 28px rgba(245, 196, 0, .5);
}

.slot-machine.is-chance {
    box-shadow: inset 0 0 0 4px rgba(38, 190, 122, .62), 0 0 24px rgba(38, 190, 122, .42);
}

.slot-lamps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.slot-lamps span {
    height: 10px;
    border-radius: 999px;
    background: #806515;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, .45);
}

.slot-machine.effect-reach .slot-lamps span,
.slot-machine.effect-win .slot-lamps span,
.slot-machine.effect-kakuhen .slot-lamps span,
.slot-machine.effect-jackpot .slot-lamps span {
    animation: slot-lamp 620ms ease-in-out infinite alternate;
}

.slot-machine.effect-jackpot .slot-lamps span {
    animation-duration: 240ms;
}

.slot-effect {
    min-height: 34px;
    margin-bottom: 10px;
    color: #f5c400;
    font-size: 28px;
    font-weight: 950;
    line-height: 1;
    text-align: center;
    text-shadow: 0 0 12px rgba(245, 196, 0, .7);
}

.slot-reels {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.slot-reel {
    --slot-strip-offset: 574px;
    overflow: hidden;
    height: 242px;
    border: 2px solid #f5c400;
    border-radius: 8px;
    background: #fbf8ea;
    box-shadow: inset 0 0 16px rgba(0, 0, 0, .2);
}

.slot-reel.is-stop-ready {
    cursor: pointer;
    box-shadow: inset 0 0 16px rgba(0, 0, 0, .2), 0 0 0 3px rgba(245, 196, 0, .22);
}

.slot-reel.is-stop-ready:active {
    transform: translateY(1px);
}

.slot-reel:focus-visible {
    outline: 3px solid rgba(245, 196, 0, .55);
    outline-offset: 3px;
}

.slot-strip {
    display: grid;
    gap: 4px;
    transform: translateY(calc(-1 * var(--slot-strip-offset)));
}

.slot-reel.is-spinning .slot-strip {
    animation: slot-spin 360ms linear infinite;
}

.slot-reel.is-stopped {
    animation: slot-stop-pop 240ms ease-out;
}

.slot-tile {
    display: grid;
    place-items: center;
    height: 78px;
}

.slot-tile img {
    width: 54px;
    height: 74px;
    object-fit: contain;
}

.slot-message {
    min-height: 26px;
    margin-top: 12px;
    color: #fff4bf;
    font-weight: 900;
    text-align: center;
}

.slot-controls,
.slot-subcontrols {
    display: grid;
    gap: 8px;
}

.slot-controls {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.slot-subcontrols {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.slot-coin-notes {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
}

.slot-coin-notes h2 {
    margin: 0;
    font-size: 16px;
}

.slot-coin-notes ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 1.2em;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.slot-paytable {
    display: grid;
    gap: 8px;
}

.slot-paytable h2 {
    margin: 0;
    font-size: 16px;
}

.slot-paytable dl {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.slot-paytable div {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbf8;
    text-align: center;
}

.slot-paytable dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.slot-paytable dd {
    margin: 4px 0 0;
    font-size: 18px;
    font-weight: 950;
}

.slot-debug-panel {
    display: grid;
    gap: 10px;
}

.slot-debug-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.slot-debug-table {
    min-width: 920px;
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.slot-debug-table th,
.slot-debug-table td {
    padding: 8px;
    border-bottom: 1px solid var(--line);
    text-align: center;
    white-space: nowrap;
}

.slot-debug-table th {
    background: #f7f4e6;
    color: var(--muted);
    font-weight: 900;
}

.slot-debug-table td:first-child,
.slot-debug-table td:nth-child(2) {
    text-align: left;
}

.slot-machine.effect-freeze {
    animation: slot-freeze 900ms steps(2, end);
}

@keyframes slot-spin {
    from {
        transform: translateY(-660px);
    }

    to {
        transform: translateY(-80px);
    }
}

@keyframes slot-stop-pop {
    0% {
        transform: translateY(-5px);
    }

    70% {
        transform: translateY(4px);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes slot-lamp {
    from {
        background: #806515;
    }

    to {
        background: #f5c400;
        box-shadow: 0 0 18px rgba(245, 196, 0, .85);
    }
}

@keyframes slot-freeze {
    0%, 100% {
        filter: none;
    }

    50% {
        filter: invert(1) contrast(1.4);
    }
}

table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
}

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

th {
    color: var(--muted);
    font-size: 12px;
}

.site-footer {
    padding: 22px 16px 34px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 759px) {
    .site-header {
        gap: 10px;
        min-height: 60px;
        padding: 8px 12px;
    }

    .brand {
        gap: 8px;
    }

    .brand img {
        width: 36px;
        height: 36px;
    }

    .brand strong {
        font-size: 14px;
    }

    .brand small {
        font-size: 10px;
    }

    .header-actions {
        gap: 8px;
    }

    .header-action {
        display: none;
        padding: 8px 10px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: #fff;
        font-size: 12px;
    }

    .shell-nav {
        display: none;
    }

    .quiz-panel {
        padding: 12px;
    }

    body.quiz-playing .quiz-heading {
        display: none;
    }

    body.quiz-playing .page-shell {
        padding-top: 10px;
    }

    .quiz-board {
        gap: 6px;
        padding: 8px 8px;
    }

    .quiz-hand {
        gap: 2px;
    }

    .quiz-tile {
        width: 23px;
        height: auto;
        border-radius: 6px;
    }

    .quiz-hand[data-count="7"] .quiz-tile {
        width: 38px;
    }

    .quiz-hand[data-count="10"] .quiz-tile {
        width: 31px;
    }

    .quiz-hand[data-count="13"] .quiz-tile {
        width: 23px;
    }

    .quiz-rule-box {
        grid-template-columns: minmax(0, 1fr);
    }

    .quiz-play {
        gap: 8px;
    }

    .quiz-play .quiz-title {
        margin-bottom: 0;
    }

    .quiz-play .quiz-title h2 {
        font-size: 16px;
    }

    .quiz-hud {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
    }

    .quiz-hud div {
        padding: 7px 4px;
        border-radius: 7px;
    }

    .quiz-hud span {
        font-size: 9px;
    }

    .quiz-hud strong {
        margin-top: 2px;
        font-size: 20px;
    }

    .quiz-wait-buttons {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin-top: 8px;
        max-width: 248px;
    }

    .quiz-choice {
        min-height: 56px;
        padding: 2px;
    }

    .quiz-choice img {
        width: 36px;
        height: 50px;
    }

    .quiz-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin-top: 8px;
    }

    .quiz-actions .primary-button,
    .quiz-actions .secondary-button {
        min-height: 38px;
        padding: 7px 4px;
        font-size: 12px;
    }

    .quiz-answer-status {
        min-height: 18px;
        font-size: 12px;
    }

    .quiz-result {
        gap: 2px;
        margin-top: 8px;
        padding: 8px;
    }

    .quiz-result strong {
        font-size: 14px;
    }

    .quiz-result span {
        font-size: 11px;
    }

    .quiz-score dd {
        font-size: 19px;
    }

    .quiz-score {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin-top: 8px;
    }

    .quiz-score div {
        padding: 8px;
    }

    .quiz-ranking-table {
        min-width: 520px;
        font-size: 12px;
    }

    .nikaku-heading {
        margin-bottom: 10px;
    }

    .nikaku-heading p {
        display: none;
    }

    body.nikaku-playing .nikaku-heading {
        display: none;
    }

    body.nikaku-playing .page-shell {
        padding-top: 10px;
    }

    .nikaku-panel {
        gap: 8px;
        padding: 10px;
    }

    .nikaku-stage-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .nikaku-stage-card {
        min-height: 74px;
        padding: 9px;
    }

    .nikaku-stage-card strong {
        font-size: 14px;
    }

    .nikaku-stage-card span,
    .nikaku-stage-card small {
        font-size: 10px;
    }

    .nikaku-hud {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 5px;
    }

    .nikaku-hud div {
        padding: 7px 4px;
    }

    .nikaku-hud span {
        font-size: 9px;
    }

    .nikaku-hud strong {
        margin-top: 2px;
        font-size: 19px;
    }

    .nikaku-board-wrap {
        padding: 5px;
    }

    .nikaku-board {
        grid-template-columns: repeat(var(--nikaku-cols, 8), minmax(0, 1fr));
        justify-content: center;
        gap: 2px;
        width: 100%;
        min-width: 0;
    }

    .nikaku-cell {
        width: 100%;
        aspect-ratio: 44 / 60;
        height: auto;
        padding: 1px;
        border-radius: 5px;
    }

    .nikaku-cell img {
        width: 100%;
        height: 100%;
    }

    .nikaku-message {
        min-height: 18px;
        font-size: 12px;
    }

    .nikaku-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nikaku-actions .primary-button,
    .nikaku-actions .secondary-button {
        min-height: 38px;
        padding: 7px 4px;
        font-size: 12px;
    }

    .slot-heading p {
        display: none;
    }

    .slot-panel {
        gap: 10px;
        padding: 10px;
    }

    .slot-topline {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
    }

    .slot-topline div {
        padding: 7px 4px;
    }

    .slot-topline span {
        font-size: 9px;
    }

    .slot-topline strong {
        font-size: 17px;
    }

    .slot-setting-control {
        grid-template-columns: minmax(0, 1fr);
        justify-content: stretch;
        gap: 5px;
        font-size: 11px;
    }

    .slot-setting-control select {
        width: 100%;
        min-height: 38px;
        padding: 7px 10px;
        font-size: 13px;
    }

    .slot-machine {
        padding: 10px;
    }

    .slot-effect {
        min-height: 28px;
        font-size: 22px;
    }

    .slot-reels {
        gap: 6px;
    }

    .slot-reel {
        --slot-strip-offset: 476px;
        height: 200px;
    }

    .slot-tile {
        height: 64px;
    }

    .slot-tile img {
        width: 44px;
        height: 60px;
    }

    .slot-controls {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .slot-subcontrols {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .slot-paytable dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .slot-controls .primary-button,
    .slot-controls .secondary-button,
    .slot-subcontrols .secondary-button {
        min-height: 38px;
        padding: 7px 4px;
        font-size: 12px;
    }

    .mobile-menu {
        position: relative;
        display: block;
    }

    .mobile-menu summary {
        display: grid;
        place-items: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface);
        cursor: pointer;
        list-style: none;
    }

    .mobile-menu summary::-webkit-details-marker {
        display: none;
    }

    .mobile-menu summary span {
        display: block;
        width: 20px;
        height: 2px;
        margin: 2px 0;
        border-radius: 999px;
        background: var(--ink);
    }

    .mobile-menu[open] summary {
        border-color: var(--nuva);
        background: var(--nuva);
    }

    .mobile-menu-panel {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        z-index: 40;
        display: grid;
        width: min(78vw, 280px);
        padding: 8px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface);
        box-shadow: var(--shadow);
    }

    .mobile-menu-panel a {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 11px 12px;
        border-radius: 8px;
        color: var(--ink);
        font-size: 14px;
        font-weight: 800;
    }

    .mobile-menu-panel a.is-active {
        background: var(--nuva);
    }

    .mobile-menu-panel .logout-link {
        margin-top: 6px;
        border-top: 1px solid var(--line);
        border-radius: 0;
        color: var(--nuva-dark);
    }

    .page-shell {
        padding: 14px 12px 36px;
    }

    .participation-shell {
        padding: 16px 14px 38px;
    }

    .auth-hero,
    .welcome-card,
    .auth-panel,
    .stacked-form,
    .panel {
        padding: 16px;
    }

    .dashboard {
        gap: 12px;
    }

    .stat-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .stat-grid article {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 68px;
        padding: 14px;
    }

    .stat-grid strong {
        margin-top: 0;
        font-size: 28px;
        text-align: right;
    }

    .dashboard-title-card {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .dashboard-title-card .secondary-button {
        width: 100%;
    }

    .gacha-preset-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .gacha-preset-form .secondary-button {
        width: 100%;
    }

    .title-status-card summary {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .title-status-card summary em {
        grid-column: 1 / -1;
    }

    .notice-list {
        padding: 14px;
    }

    .notice-item {
        padding: 11px 12px;
        font-size: 13px;
    }

    .panel-title {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .panel-title span {
        flex: initial;
    }

    .metric-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .metric-grid div {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 12px;
        min-height: 56px;
        padding: 12px;
    }

    .metric-grid dd {
        margin: 0;
        font-size: 20px;
        text-align: right;
    }

    .rank-series-grid {
        gap: 10px;
    }

    .rank-series {
        padding: 12px;
    }

    .rank-chart {
        min-height: 128px;
    }

    .quick-grid {
        gap: 10px;
    }

    .quick-grid a {
        min-height: 78px;
        padding: 15px;
    }

    .filter-tabs,
    .year-tabs,
    .scope-tabs {
        margin-bottom: 12px;
    }

    .filter-tabs a,
    .year-tabs a,
    .scope-tabs a {
        min-height: 38px;
        padding: 9px 11px;
        font-size: 12px;
    }

    .record-card {
        border-radius: 8px;
    }

    .record-summary {
        padding: 14px;
    }

    .record-detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .record-expanded {
        padding: 0 14px 14px;
    }

    .record-player dl {
        grid-template-columns: minmax(0, 1fr);
    }

    .ranking-card {
        padding: 14px;
    }

    .ranking-metrics {
        grid-template-columns: minmax(0, 1fr);
    }

    .ranking-sort-form,
    .ranking-period-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .ranking-sort-form {
        display: grid;
    }

    .ranking-sort-form button,
    .ranking-period-form button {
        width: 100%;
    }

    .signup-layout {
        gap: 12px;
    }

    .signup-heading h1 {
        font-size: 28px;
    }

    .signup-form,
    .signup-confirm,
    .signup-complete {
        gap: 12px;
    }

    .signup-section {
        padding: 12px;
    }

    .signup-grid,
    .signup-confirm-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .confirm-list div {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .confirm-list dd {
        text-align: left;
    }

    .aggregate-panel,
    .aggregate-complete {
        gap: 12px;
    }

    .aggregate-form,
    .aggregate-confirm-form {
        gap: 12px;
    }

    .aggregate-player {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        padding: 10px;
    }

    .aggregate-player h3 {
        margin: 0;
    }

    .aggregate-summary,
    .aggregate-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .aggregate-total strong,
    .aggregate-summary strong {
        font-size: 18px;
    }

    .aggregate-result-table {
        width: 100%;
        min-width: 0;
        font-size: 11px;
    }

    .aggregate-result-table th,
    .aggregate-result-table td {
        padding: 8px 4px;
    }

    .aggregate-result-table th:nth-child(1),
    .aggregate-result-table td:nth-child(1) {
        width: 34px;
    }

    .aggregate-result-table th:nth-child(2),
    .aggregate-result-table td:nth-child(2) {
        width: 44px;
    }

    .tool-topbar {
        align-items: flex-start;
    }

    .tool-topbar h1 {
        font-size: 22px;
    }

    .tool-round {
        min-width: 118px;
        padding: 9px 10px;
    }

    .tool-score-board {
        gap: 8px;
    }

    .tool-player-card {
        padding: 10px;
    }

    .tool-player-card strong {
        font-size: 13px;
    }

    .tool-player-card b {
        font-size: 20px;
    }

    .tool-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tool-control-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .tool-check-grid {
        grid-template-columns: 94px 44px 94px;
        justify-content: center;
        gap: 6px;
    }

    .tool-check-grid::before {
        width: 42px;
        height: 42px;
    }

    .tool-check-grid label {
        width: 94px;
        min-height: 44px;
        padding: 7px 6px;
        font-size: 12px;
    }

    .tool-table {
        min-height: min(680px, calc(100dvh - 108px));
        border-width: 1px;
    }

    .tool-corner-button {
        width: 82px;
        height: 82px;
        font-size: 21px;
    }

    .tool-end-button,
    .tool-fix-button {
        top: 6px;
    }

    .tool-end-button,
    .tool-draw-button {
        left: 6px;
    }

    .tool-fix-button {
        right: 6px;
    }

    .tool-draw-button {
        bottom: 6px;
    }

    .tool-timer {
        grid-template-columns: minmax(128px, auto) auto auto auto;
        gap: 8px;
        width: min(100%, 100%);
        padding: 9px 10px;
    }

    .tool-timer strong {
        font-size: 38px;
    }

    .tool-timer button {
        min-width: 66px;
        min-height: 42px;
        padding: 6px 10px;
        font-size: 14px;
    }

    .tool-timer label {
        gap: 3px;
        font-size: 11px;
    }

    .tool-timer input {
        width: 50px;
        min-height: 40px;
        padding: 5px 6px;
        font-size: 15px;
    }

    @media (max-width: 390px) {
        .tool-timer {
            grid-template-columns: minmax(118px, 1fr) auto auto;
        }

        .tool-timer button[data-timer-toggle] {
            grid-column: 1 / -1;
            width: 100%;
        }
    }

    .tool-table .tool-player-card {
        width: 198px;
        min-height: 134px;
        gap: 3px;
        padding: 8px;
    }

    .tool-seat-1 {
        bottom: 16px;
    }

    .tool-seat-2 {
        right: -24px;
    }

    .tool-seat-3 {
        top: 16px;
    }

    .tool-seat-4 {
        left: -24px;
    }

    .tool-player-badges {
        min-height: 34px;
        gap: 5px;
    }

    .tool-player-badges span {
        max-width: 112px;
        padding: 0;
        font-size: 12px;
    }

    .tool-seat-main strong {
        font-size: 18px;
    }

    .tool-score-button {
        font-size: 30px;
    }

    .tool-player-card .tool-score-button.is-win-choice {
        min-height: 44px;
        font-size: 24px;
    }

    .tool-seat-markers {
        min-height: 12px;
    }

    .tool-seat-markers small {
        font-size: 12px;
    }

    .tool-seat-buttons {
        gap: 5px;
    }

    .tool-seat-buttons button {
        min-height: 40px;
        padding: 5px 2px;
        font-size: 13px;
    }

    .tool-seat-buttons button[data-clear-seat] {
        font-size: 11px;
    }

    .tool-table .tool-round {
        width: 132px;
        height: 132px;
    }

    .tool-table .tool-round.is-win-mode {
        width: 194px;
        height: 218px;
        min-width: 194px;
        padding: 10px;
    }

    .tool-table .tool-round strong {
        font-size: 30px;
    }

    .tool-table .tool-round span,
    .tool-table .tool-round em {
        font-size: 23px;
    }

    .tool-win-center {
        gap: 7px;
        padding: 3px;
    }

    .tool-win-center strong {
        font-size: 17px;
        line-height: 1.04;
    }

    .tool-win-center select {
        min-height: 34px;
        padding: 3px 4px;
        font-size: 12px;
    }

    .tool-win-center span {
        font-size: 12px;
    }

    .tool-win-center button {
        min-height: 28px;
        font-size: 11px;
    }

    .tool-panel-layer .tool-control-panel {
        width: min(408px, calc(100% - 12px));
        padding: 14px;
    }

    .tool-fix-round-grid {
        gap: 4px;
    }

    .tool-fix-round-grid input,
    .tool-fix-round-grid select {
        min-height: 38px;
        font-size: 12px;
    }

    .tool-fix-table {
        font-size: 12px;
    }

    .tool-fix-table th {
        width: 66px;
    }

    .tool-fix-table input {
        width: 68px;
    }

    .tool-fix-table button {
        min-height: 30px;
        padding: 4px 5px;
        font-size: 11px;
    }

    .grade-status-main {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .grade-status-main > strong {
        min-height: 64px;
        font-size: 24px;
    }

    .grade-system-table {
        min-width: 520px;
    }

    .grade-system-table th,
    .grade-system-table td {
        padding: 9px 8px;
        font-size: 12px;
    }

    .grade-system-table th:first-child,
    .grade-system-table td:first-child {
        min-width: 82px;
    }

    .debug-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .debug-summary article {
        padding: 9px 7px;
    }

    .debug-summary span {
        font-size: 10px;
    }

    .debug-summary strong {
        font-size: 20px;
    }

    .grade-recalc-table {
        min-width: 900px;
    }

    .grade-step-table {
        min-width: 760px;
    }

    .grade-recalc-table th,
    .grade-recalc-table td,
    .grade-step-table th,
    .grade-step-table td {
        padding: 9px 7px;
        font-size: 12px;
    }

    .grade-recalc-table td:first-child,
    .grade-recalc-table th:first-child {
        min-width: 110px;
        max-width: 150px;
    }

    .settings-list div {
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
        padding: 11px;
    }

    .settings-list dd {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .participation-heading {
        margin-bottom: 6px;
    }

    .participation-heading .eyebrow,
    .participation-heading p {
        display: none;
    }

    .participation-heading h1 {
        font-size: 22px;
    }

    .participation-week-tabs,
    .participation-view-tabs {
        display: grid;
        overflow: visible;
        padding: 0;
    }

    .participation-week-tabs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        margin-bottom: 6px;
    }

    .participation-view-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin-bottom: 8px;
    }

    .participation-week-tabs a,
    .participation-view-tabs a {
        min-height: 30px;
        padding: 5px 6px;
        font-size: 12px;
        justify-content: center;
    }

    .participation-panel {
        padding: 8px 10px;
        width: 100%;
        min-width: 0;
        overflow: visible;
    }

    .participation-panel .panel-title {
        display: none;
    }

    .participation-panel form {
        gap: 5px;
    }

    .participation-help {
        margin: 0 2px 2px;
        font-size: 11px;
        line-height: 1.35;
    }

    .participation-table-wrap {
        overflow: visible;
        border-radius: 5px;
        width: 100%;
        max-width: 100%;
        padding: 0;
    }

    .participation-table {
        width: auto;
        min-width: 0;
        table-layout: auto;
        margin: 0 auto;
    }

    .participation-table th,
    .participation-table td {
        padding: 2px 3px;
    }

    .participation-table thead th:first-child,
    .participation-table tbody th {
        width: 42px;
    }

    .participation-table thead th:not(:first-child),
    .participation-table td {
        width: 34px;
    }

    .participation-table thead th {
        font-size: 10px;
    }

    .participation-table tbody th {
        font-size: 10px;
    }

    .time-full {
        display: inline;
    }

    .time-short {
        display: none;
    }

    .slot-cell span,
    .status-cell summary,
    .status-cell-empty {
        width: 32px;
        height: 32px;
        min-height: 0;
        border-radius: 5px;
        font-size: 11px;
        margin: 0;
    }

    .slot-cell,
    .status-cell,
    .status-cell-empty {
        width: 32px;
        height: 32px;
        margin: 0 auto;
    }

    .participation-panel .primary-button {
        min-height: 32px;
        padding: 6px 12px;
        font-size: 13px;
    }

    .status-names {
        min-width: 86px;
        max-width: 128px;
        padding: 5px;
    }

    .status-names span {
        font-size: 10px;
    }
}

@media (min-width: 760px) {
    .page-shell {
        padding-top: 34px;
    }

    .auth-layout {
        grid-template-columns: 1.1fr .9fr;
        align-items: center;
    }

    .quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tool-seat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tool-option-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .metric-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .rank-series-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .record-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ranking-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grant-form-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1040px) {
    .record-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ranking-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
