.round-container {
    --round-highlight-color: #0f7c80;
    --round-highlight-rgb: 15, 124, 128;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    min-height: 100vh;
    padding: 20px;
    margin: 0 auto;
    transition: margin-left 0.22s ease, padding-left 0.24s ease;
}

.round-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.round-header,
.round-editor {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.round-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
}

.round-header .control-panel__header {
    margin: 0;
}

.round-header p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    line-height: 1.45;
}

.round-run-bar {
    display: flex;
}

.round-run-button {
    background: var(--round-highlight-color);
    background-image: none;
    box-shadow: none;
    white-space: nowrap;
}

.round-workspace {
    display: block;
    min-height: 0;
}

.round-board {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.round-board__section {
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 18px 22px 20px;
    background: var(--card-background);
    box-shadow: var(--box-shadow);
}

.round-dashboard {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    background: #fff;
    box-shadow: var(--box-shadow);
}

.round-dashboard__empty {
    color: var(--text-secondary);
    font-size: 13px;
}

.round-dashboard__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.round-dashboard__header h2 {
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
}

.round-dashboard__header span {
    color: var(--text-secondary);
    font-size: 12px;
}

.round-dashboard__section {
    display: grid;
    gap: 8px;
}

.round-dashboard__section h3 {
    margin: 0;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
}

.round-metric-grid {
    display: grid;
    gap: 8px;
}

.round-metric-card {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.025);
}

.round-metric-card > strong {
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.round-metric-card dl {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 0;
}

.round-metric-card dl > div {
    display: grid;
    gap: 2px;
    padding: 7px 8px;
    border-radius: 8px;
    background: #fff;
}

.round-metric-card dt {
    color: var(--text-secondary);
    font-size: 10px;
    line-height: 1.1;
}

.round-metric-card dd {
    margin: 2px 0 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.1;
}

.round-defender-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.round-kill-matrix {
    display: grid;
    gap: 8px;
    overflow-x: visible;
}

.round-kill-matrix__row {
    display: grid;
    grid-template-columns: minmax(90px, 0.8fr) minmax(0, 2.4fr);
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.025);
}

.round-kill-matrix__row > strong {
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.round-kill-matrix__row > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
    gap: 8px;
}

.round-kill-matrix__row span,
.round-defender-step {
    display: grid;
    gap: 2px;
    padding: 7px 8px;
    border-radius: 8px;
    background: #fff;
}

.round-kill-matrix__row small {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.round-kill-matrix__empty {
    color: var(--text-secondary);
    font-size: 11px;
}

.round-kill-matrix__row b {
    color: var(--round-highlight-color);
    font-size: 13px;
}

.round-defender-step {
    background: rgba(15, 23, 42, 0.025);
}

.round-defender-step strong {
    color: var(--text-secondary);
    font-size: 11px;
}

.round-defender-step em {
    color: var(--round-highlight-color);
    font-size: 13px;
    font-weight: 700;
    font-style: normal;
}

.round-board__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.round-board__heading h2 {
    margin: 0;
}

.round-board__heading h2 {
    font-size: 17px;
    color: var(--text-primary);
}

.round-table-meta {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.35;
}

.round-table-shell {
    overflow: visible;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: transparent;
}

.round-table-wrap {
    overflow-x: auto;
}

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

.round-table th,
.round-table td {
    padding: 16px 8px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.round-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    background: var(--card-background);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
}

.round-data-row {
    position: relative;
    cursor: pointer;
    transition: background 0.16s ease;
}

.round-data-row td {
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    background: transparent;
}

.round-data-row:hover td,
.round-effects-row:hover td {
    background: rgba(var(--round-highlight-rgb), 0.025);
}

.round-data-row.is-selected td,
.round-effects-row.is-selected td {
    background: rgba(var(--round-highlight-rgb), 0.04);
}

.round-data-row.is-selected td:first-child,
.round-effects-row.is-selected td:first-child {
    box-shadow: inset 2px 0 0 var(--round-highlight-color);
}

.round-data-row[draggable="true"] {
    cursor: grab;
}

.round-table tr.is-dragging td {
    opacity: 0.48;
}

.round-table tr.is-drop-target td {
    box-shadow: inset 0 2px 0 var(--round-highlight-color);
}

.round-table .round-row-actions {
    min-width: 46px;
    text-align: right;
}

.round-table .round-row-actions .round-action-link {
    vertical-align: middle;
}

.round-ghost-button {
    height: 34px;
    padding: 6px 12px;
    background: rgba(var(--round-highlight-rgb), 0.08);
    color: var(--round-highlight-color);
    border: 1px solid rgba(var(--round-highlight-rgb), 0.16);
    border-radius: 7px;
    box-shadow: none;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.round-ghost-button:hover,
.round-ghost-button:active {
    color: #fff;
}

.round-action-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.05);
    box-shadow: none;
    color: var(--round-highlight-color);
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.round-action-link:hover {
    background: rgba(var(--round-highlight-rgb), 0.12);
    color: #fff;
    text-decoration: none;
    transform: none;
}

.round-action-link .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
}

.round-action-link span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.round-action-link.danger {
    color: #b42318;
}

.round-inline-edit {
    display: none;
}

.round-primary-cell {
    min-width: 150px;
}

.round-primary-cell strong {
    display: block;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.2;
}

.round-primary-cell > span {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.25;
}

.round-value-cell {
    color: var(--text-primary);
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

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

.round-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    color: var(--text-secondary);
}

.round-field-wide {
    grid-column: 1 / -1;
}

.round-effects-entry {
    display: block;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    padding: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(var(--round-highlight-rgb), 0.04);
    border-radius: 8px;
}

.round-effects-entry > div > span {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.round-effects-entry__tags {
    min-width: 0;
}

.round-effects-button {
    border: 0;
    white-space: nowrap;
}

.round-effects-row td {
    padding: 0 8px 16px;
    white-space: normal;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.45;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    background: transparent;
}

.round-effects-row td > span {
    display: inline-block;
    margin-right: 8px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
}

.round-effects-summary {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    vertical-align: middle;
}

.round-effects-summary span,
.round-effects-muted {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #9fa3b1;
    font-size: 11px;
    font-weight: 600;
}

.round-effects-muted {
    background: transparent;
    padding-left: 0;
    font-style: italic;
}

.round-modal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.round-modal-action {
    min-width: 0;
    height: 34px;
    padding: 6px 12px;
    border: 1px solid rgba(var(--round-highlight-rgb), 0.14);
    border-radius: 7px;
    background: rgba(var(--round-highlight-rgb), 0.08);
    box-shadow: none;
    color: var(--round-highlight-color);
    font-size: 12px;
    font-weight: 700;
}

.round-modal-action:hover {
    background: rgba(var(--round-highlight-rgb), 0.13);
    color: #fff;
    transform: none;
}

.round-modal-action.danger {
    border-color: rgba(180, 35, 24, 0.16);
    background: rgba(180, 35, 24, 0.07);
    color: #b42318;
}

.round-modal-action.danger:hover,
.round-modal-action.danger:active {
    border-color: #b42318;
    background: rgba(180, 35, 24, 0.07);
    color: #fff;
}

.round-modal-action.danger:hover::before,
.round-modal-action.danger:hover::after {
    background-color: #b42318;
}

.round-modal-action:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.round-modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.52);
}

.round-modal.active {
    display: flex;
}

.round-modal__dialog {
    width: min(620px, 100%);
    max-height: min(760px, 86vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
    background: var(--card-background);
    box-shadow: var(--box-shadow-elevated);
}

.round-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.round-modal__header h3 {
    margin: 0;
    color: var(--round-highlight-color);
    font-size: 18px;
}

.round-modal .close-button {
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    box-shadow: none;
    font-size: 24px;
}

.round-modal__body {
    overflow-y: auto;
    padding: 18px 20px 20px;
}

.round-tag {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    margin: 0 4px 4px 0;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(var(--round-highlight-rgb), 0.1);
    color: var(--round-highlight-color);
    font-size: 12px;
    font-weight: 600;
}

.round-muted {
    color: var(--text-secondary);
}

.round-container .chart-column {
    height: var(--round-chart-column-height, calc(100vh - 40px));
    min-width: 0;
    overflow-x: hidden;
}

.round-container .active-effects-container {
    display: none;
}

@media (prefers-color-scheme: dark) {
    .round-container {
        --round-highlight-color: #27d2cf;
        --round-highlight-rgb: 35, 211, 206;
    }

    .round-ghost-button {
        background: rgba(35, 211, 206, 0.13);
        color: #27d2cf;
        border-color: rgba(35, 211, 206, 0.11);
    }

    .round-action-link {
        background: rgba(255, 255, 255, 0.07);
        color: #27d2cf;
    }

    .round-action-link:hover {
        background: rgba(35, 211, 206, 0.14);
    }

    .round-table th,
    .round-table td,
    .round-effects-entry,
    .round-defender-step,
    .round-modal__header {
        border-color: rgba(255, 255, 255, 0.1);
    }

    .round-board__section,
    .round-dashboard,
    .round-table-shell {
        border-color: rgba(255, 255, 255, 0.12);
        background: #252630;
    }

    .round-board__heading h2,
    .round-primary-cell strong,
    .round-value-cell {
        color: #f5f6fb;
    }

    .round-table-meta,
    .round-primary-cell > span,
    .round-effects-row td,
    .round-effects-row td > span {
        color: #a7aab7;
    }

    .round-table th {
        border-color: rgba(255, 255, 255, 0.1);
        background: #252630;
        color: #b9bcc9;
    }

    .round-data-row td,
    .round-effects-row td {
        background: transparent;
        border-color: rgba(255, 255, 255, 0.08);
    }

    .round-data-row:hover td,
    .round-effects-row:hover td,
    .round-data-row.is-selected td,
    .round-effects-row.is-selected td {
        background: rgba(35, 211, 206, 0.055);
    }

    .round-dashboard__section,
    .round-metric-card {
        border-color: rgba(255, 255, 255, 0.08);
    }

    .round-metric-card,
    .round-kill-matrix__row,
    .round-defender-step {
        background: rgba(44, 44, 44, 0.72);
    }

    .round-metric-card dl > div,
    .round-kill-matrix__row span {
        background: rgba(255, 255, 255, 0.06);
    }

    .round-modal-actions {
        border-color: rgba(255, 255, 255, 0.1);
    }
}

@media (max-width: 1100px) {
    .round-container {
        grid-template-columns: 1fr;
    }

    .round-container .chart-column {
        position: static;
        height: auto;
        max-height: none;
    }

    body.site-switcher-open .round-container {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .round-container {
        padding: 12px 12px calc(104px + env(safe-area-inset-bottom, 0px));
        gap: 16px;
    }

    .round-container .chart {
        margin-bottom: 0;
    }

    .round-container .chart-navigation {
        display: none;
    }

    .round-header {
        align-items: stretch;
        flex-direction: column;
        padding: 16px;
    }

    .round-run-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 80;
        padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
        border-radius: 18px 18px 0 0;
        background: #fff;
        box-shadow: var(--box-shadow-sticky);
    }

    .round-run-button {
        width: 100%;
        min-height: 48px;
        border-radius: 10px;
        box-shadow: none;
    }

    .round-board__section {
        padding: 16px;
    }

    .round-dashboard {
        gap: 8px;
        padding: 12px 14px;
    }

    .round-dashboard__header h2 {
        font-size: 15px;
    }

    .round-dashboard__header span {
        font-size: 11px;
    }

    .round-dashboard__section {
        padding-top: 8px;
    }

    .round-metric-card {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 8px 0;
    }

    .round-metric-card dl {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

    .round-effects-entry {
        grid-column: 1 / -1;
        margin-top: 12px;
        padding: 10px 12px;
    }

    .round-effects-entry > div > span {
        margin-bottom: 4px;
        font-size: 11px;
    }

    .round-modal {
        align-items: flex-start;
        padding: 8px;
    }

    .round-modal__dialog {
        max-height: calc(100vh - 16px);
        border-radius: 10px;
    }

    .round-modal__header {
        padding: 12px 16px;
    }

    .round-modal__header h3 {
        font-size: 16px;
    }

    .round-modal .close-button {
        width: 30px;
        height: 30px;
        font-size: 22px;
    }

    .round-modal__body {
        padding: 12px 16px 14px;
    }

    .round-field {
        gap: 3px;
        font-size: 11px;
    }

    .round-editor-grid input,
    .round-editor-grid select {
        min-height: 38px;
        height: 38px;
        padding: 6px 10px;
        font-size: 14px;
    }

    .round-modal-actions {
        grid-column: 1 / -1;
        margin-top: 12px;
        padding-top: 12px;
        gap: 8px;
    }

    .round-modal-action {
        height: 36px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .round-table th,
    .round-table td {
        padding: 8px 6px;
    }
}

@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .round-run-bar {
        background: #1f2028;
        box-shadow: 0 -7px 22px rgba(0, 0, 0, 0.36), 0 -1px 5px rgba(0, 0, 0, 0.24);
    }
}

@media (max-width: 680px) {
    .round-table-shell {
        border: 0;
        background: transparent;
    }

    .round-table-wrap {
        overflow: visible;
    }

    .round-table,
    .round-table tbody,
    .round-table tr,
    .round-table td {
        display: block;
        width: 100%;
    }

    .round-table thead {
        display: none;
    }

    .round-data-row {
        position: relative;
        display: grid !important;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .round-data-row.is-selected {
        box-shadow: inset 2px 0 0 var(--round-highlight-color);
    }

    .round-data-row.is-selected td:first-child {
        box-shadow: none;
    }

    .round-defender-table .round-data-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .round-data-row .round-row-actions {
        display: none !important;
    }

    .round-data-row td {
        min-height: 52px;
        padding: 9px 8px;
        border-top: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        white-space: nowrap;
    }

    .round-data-row td::before {
        display: none;
    }

    .round-data-row .round-primary-cell {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        min-height: 48px;
        min-width: 0;
        padding: 12px 8px !important;
    }

    .round-data-row .round-value-cell {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-width: 0;
        overflow: hidden;
        text-align: center;
        text-overflow: ellipsis;
    }

    .round-data-row .round-value-cell::before {
        content: attr(data-label);
        display: block !important;
        color: #a7aab7;
        font-size: 10px;
        font-weight: 700;
        line-height: 1;
        text-align: center;
    }

    .round-inline-edit {
        display: inline-flex;
        flex: 0 0 auto;
    }

    .round-primary-cell strong {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 15px;
    }

    .round-effects-row {
        display: block;
        width: 100%;
    }

    .round-effects-row td {
        display: block;
        width: 100%;
        padding: 10px 8px 12px;
    }

    .round-modal-actions {
        justify-content: stretch;
    }

    .round-modal-action {
        flex: 1 1 0;
        min-width: 0;
    }
}
