/* MatchResultOneMatch – sett-kort og resultatkalkulator */

.match-result-one-match {
    --mrom-primary: #2563eb;
    --mrom-panel-bg: #e8ecf1;
    --mrom-panel-border: #c8d0dc;
    --mrom-border: #b8c2d0;
    --mrom-text: #0f172a;
    --mrom-text-secondary: #1e293b;
    --mrom-text-muted: #64748b;
    --mrom-card-bg: #ffffff;
    --mrom-card-hover: #eef2ff;
    --mrom-set-column-width: 22rem;
    padding: clamp(0.75rem, 3vw, 1.25rem);
}

/* Oppstart – matchnr-inntasting */
.mrom-search {
    display: flex;
    justify-content: center;
    padding: clamp(0.5rem, 2vw, 1.5rem) 0;
}

.mrom-search__panel {
    width: 100%;
    max-width: 26rem;
    padding: clamp(1.25rem, 4vw, 1.75rem);
    border-radius: 0.85rem;
    border: 1px solid var(--mrom-panel-border);
    background: var(--mrom-panel-bg);
    color: var(--mrom-text);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}

.mrom-search__panel--loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 10rem;
    text-align: center;
}

.mrom-search__header {
    text-align: center;
    margin-bottom: 1.35rem;
}

.mrom-search__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 0.65rem;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--mrom-primary);
    color: var(--mrom-primary);
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.18);
}

.match-result-one-match .mrom-search__title {
    margin: 0 0 0.45rem;
    font-size: clamp(1.35rem, 4.5vw, 1.65rem);
    font-weight: 800;
    line-height: 1.25;
    color: #0f172a;
}

.mrom-search__intro {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--mrom-text-muted);
}

.mrom-search__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mrom-search__field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.mrom-search__label {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--mrom-text-secondary);
}

.mrom-search__input-wrap {
    width: 100%;
}

.mrom-search__input-wrap .e-input-group,
.mrom-search__input-wrap .e-control-wrapper {
    width: 100% !important;
}

.mrom-search__input-wrap .e-input-group {
    border: 2px solid var(--mrom-border) !important;
    border-radius: 0.75rem !important;
    background: #fff !important;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.mrom-search__input-wrap .e-input-group:focus-within {
    border-color: var(--mrom-primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.mrom-search__input-wrap .e-input-group .e-input,
.mrom-search__input-wrap .e-input-group input.e-input {
    min-height: 3.25rem;
    padding: 0.65rem 1rem !important;
    border: none !important;
    background: transparent !important;
    font-size: clamp(1.5rem, 5vw, 2rem) !important;
    font-weight: 800 !important;
    text-align: center;
    color: var(--mrom-text) !important;
}

.mrom-search__input-wrap .e-input-group .e-input::placeholder,
.mrom-search__input-wrap .e-input-group input.e-input::placeholder {
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #94a3b8 !important;
}

.mrom-search__submit {
    width: 100%;
    min-height: 3rem;
    font-size: 1.05rem;
    border-radius: 0.65rem;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.mrom-search__submit:disabled {
    opacity: 0.65;
    cursor: wait;
}

.mrom-search__spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid #cbd5e1;
    border-top-color: var(--mrom-primary);
    border-radius: 50%;
    animation: mrom-spin 0.75s linear infinite;
}

.mrom-search__loading-text {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--mrom-text-muted);
}

@keyframes mrom-spin {
    to {
        transform: rotate(360deg);
    }
}

.mrom-msg--error {
    margin: 1rem 0 0;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.match-result-one-match .mrom-match-result,
.match-result-one-match .mrom-result-calc {
    color: #0f172a;
}

.mrom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--mrom-border);
    background: #fff;
    color: var(--mrom-text);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.mrom-btn:hover:not(:disabled) {
    background: var(--mrom-card-hover);
    border-color: var(--mrom-primary);
}

.mrom-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.mrom-btn--primary {
    background: var(--mrom-primary);
    border-color: var(--mrom-primary);
    color: #fff;
}

.mrom-btn--primary:hover:not(:disabled) {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

.mrom-btn--secondary {
    background: #fff;
    color: var(--mrom-text);
}

.match-result-one-match .mrom-btn--new-match {
    min-height: 2.75rem;
    padding: 0.55rem 1.15rem;
    background: #ffffff;
    border: 2px solid #334155;
    color: #0f172a !important;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
}

.match-result-one-match .mrom-btn--new-match:hover:not(:disabled) {
    background: #f8fafc;
    border-color: var(--mrom-primary);
    color: #0f172a !important;
}

.match-result-one-match__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.match-result-one-match__loaded {
    color: #475569;
    font-size: 0.95rem;
}

.mrom-msg {
    margin: 0.75rem 0;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
}

.mrom-msg--warning {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}

/* Sett-oversikt (match result panel) */
.mrom-match-result {
    max-width: 42rem;
    padding: 1.25rem 1.15rem 1.35rem;
    border-radius: 0.75rem;
    border: 1px solid var(--mrom-panel-border);
    background: var(--mrom-panel-bg);
    color: var(--mrom-text);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.match-result-one-match .mrom-match-result__title {
    margin: 0 0 0.35rem;
    color: #0f172a;
    font-weight: 700;
}

.match-result-one-match .mrom-match-result__tournament {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e293b;
}

.match-result-one-match .mrom-match-result__class {
    margin: 0 0 0.65rem;
    color: #475569;
    font-size: 1.05rem;
    font-weight: 500;
}

.mrom-match-result__rules {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.25rem;
    margin: 0 auto 1rem;
    padding: 0.65rem 0.85rem;
    max-width: var(--mrom-set-column-width);
    border: 1px solid var(--mrom-border);
    border-radius: 0.65rem;
    background: #fff;
}

.mrom-match-result__rule {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    min-width: 4rem;
}

.match-result-one-match .mrom-match-result__rule dt {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--mrom-text-muted);
}

.match-result-one-match .mrom-match-result__rule dd {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--mrom-text);
}

.mrom-match-result__players {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    max-width: var(--mrom-set-column-width);
    margin: 0 auto 1rem;
}

.mrom-match-result__status {
    margin: 0 auto 1rem;
    padding: 0.5rem 1rem;
    max-width: var(--mrom-set-column-width);
    width: 100%;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: #166534;
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 0.5rem;
}

.match-result-one-match .mrom-match-result__team {
    margin: 0;
    width: 100%;
    text-align: center;
    font-size: clamp(1.25rem, 4vw, 1.6rem);
    font-weight: 700;
    line-height: 1.35;
    color: #0f172a !important;
}

.match-result-one-match .mrom-match-result__vs {
    margin: 0.15rem 0;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
    letter-spacing: 0.04em;
    text-transform: lowercase;
}

.mrom-winner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.mrom-set-overview {
    padding-top: 0.15rem;
    width: 100%;
    max-width: var(--mrom-set-column-width);
    margin: 0 auto;
}

.mrom-set-overview__cards {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
}

.mrom-set-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.55rem 0.75rem 0.55rem 1rem;
    border: 1px solid var(--mrom-border);
    border-radius: 0.65rem;
    background: var(--mrom-card-bg);
    color: var(--mrom-text);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.mrom-set-card:hover {
    background: var(--mrom-card-hover);
    border-color: var(--mrom-primary);
}

.mrom-set-card:active:not(:disabled) {
    transform: scale(0.98);
}

.mrom-set-card--disabled,
.mrom-set-card:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.mrom-set-card--disabled:hover,
.mrom-set-card:disabled:hover {
    background: var(--mrom-card-bg);
    border-color: var(--mrom-border);
}

.mrom-match-finish {
    width: 100%;
    margin-top: 2rem;
    min-height: 3rem;
    font-size: 1rem;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
}

.mrom-match-finish:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.match-result-one-match .mrom-match-result__team .mrom-match-result__sets-won {
    font-weight: 700;
    color: var(--mrom-primary);
}

.mrom-set-card__label {
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
    color: var(--mrom-text-secondary);
}

.mrom-set-card__scores {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-size: 1.15rem;
    font-weight: 700;
    min-width: 4.5rem;
    color: var(--mrom-text);
}

.mrom-set-card__check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(22, 163, 74, 0.35);
}

.mrom-set-card__check--empty {
    visibility: hidden;
    background: transparent;
    box-shadow: none;
}

.mrom-set-card__score {
    min-width: 1.5rem;
    text-align: center;
}

.mrom-set-card__sep {
    color: var(--mrom-text-muted);
    font-weight: 500;
}

/* Resultatkalkulator (sett-inntasting) */
.match-result-one-match .mrom-result-calc {
    display: flex;
    flex-direction: column;
    min-height: min(100dvh, 40rem);
    max-width: 42rem;
    margin: 0;
    padding: 1.15rem 1rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid var(--mrom-panel-border);
    background: var(--mrom-panel-bg);
    color: var(--mrom-text);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.mrom-result-calc__header {
    flex-shrink: 0;
    padding-bottom: 0.75rem;
}

.mrom-result-calc__toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mrom-result-calc__back {
    min-width: 7rem;
    min-height: 2.75rem;
}

.mrom-result-calc__set-label {
    margin: 0.5rem 0 0;
    text-align: left;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--mrom-text-secondary);
}

.mrom-hand-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.mrom-hand-switch__text {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--mrom-text-muted);
}

.mrom-hand-switch__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.mrom-hand-switch__track {
    position: relative;
    width: 2.75rem;
    height: 1.5rem;
    border-radius: 999px;
    background: #b8c2d0;
    transition: background 0.15s;
}

.mrom-hand-switch__track::after {
    content: "";
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
    transition: transform 0.15s;
}

.mrom-hand-switch__input:checked + .mrom-hand-switch__track {
    background: var(--mrom-primary);
}

.mrom-hand-switch__input:checked + .mrom-hand-switch__track::after {
    transform: translateX(1.25rem);
}

.mrom-hand-switch__input:focus-visible + .mrom-hand-switch__track {
    outline: 2px solid var(--mrom-primary);
    outline-offset: 2px;
}

.mrom-hand-switch__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mrom-result-calc__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(0.75rem, 2.5vh, 1.25rem);
    padding: 0.5rem 0 1rem;
}

.match-result-one-match .mrom-result-calc__team {
    margin: 0;
    text-align: center;
    font-weight: 700;
    font-size: clamp(0.95rem, 3.5vw, 1.1rem);
    line-height: 1.3;
    color: #0f172a;
}

.mrom-result-calc__steppers {
    display: flex;
    gap: 1rem;
}

.mrom-result-calc__steppers--swapped {
    flex-direction: row-reverse;
}

.mrom-result-calc__step-btn {
    flex: 1 1 0;
    min-height: clamp(4.5rem, 14vh, 6.5rem);
    border: 2px solid var(--mrom-border);
    border-radius: 0.75rem;
    background: #fff;
    color: var(--mrom-text);
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.mrom-result-calc__step-btn:hover:not(:disabled) {
    background: var(--mrom-card-hover);
    border-color: var(--mrom-primary);
}

.mrom-result-calc__step-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.mrom-result-calc__scores {
    display: flex;
    flex-direction: column;
    gap: clamp(0.75rem, 2.5vh, 1.25rem);
}

.mrom-result-calc__score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.85rem 1rem;
    border: 2px solid var(--mrom-border);
    border-radius: 0.75rem;
    background: #fff;
}

.mrom-result-calc__score-box-label {
    font-size: clamp(0.75rem, 3vw, 0.9rem);
    font-weight: 600;
    color: var(--mrom-text-muted);
    text-align: center;
}

.mrom-result-calc__score-digit,
.mrom-result-calc__score-input {
    display: block;
    width: 100%;
    min-height: clamp(3rem, 12vh, 4.5rem);
    padding: 0;
    border: none;
    border-radius: 0.35rem;
    background: transparent;
    font-size: clamp(2.5rem, 12vw, 4rem);
    font-weight: 800;
    line-height: 1;
    text-align: center;
    color: var(--mrom-text);
}

.mrom-result-calc__score-input:focus {
    outline: 2px solid var(--mrom-primary);
    outline-offset: 2px;
    background: #fff;
}

.mrom-result-calc__score-input:disabled {
    opacity: 0.65;
    cursor: wait;
}

.mrom-result-calc__score-digit {
    display: flex;
    align-items: center;
    justify-content: center;
}
