/* NTMGL Virtual Rules Official — shared by the scorecard panel and /RulesOfficial */
.ro-root {
    --ro-navy: #1e3a5f;
    --ro-navy-2: #2d4a6f;
    --ro-red: #c8102e;
    --ro-ink: #1f2933;
    --ro-muted: #5f6b7a;
    --ro-line: #e3e8ef;
    --ro-bg: #f5f7fa;
    color: var(--ro-ink);
    font-size: 15px;
    line-height: 1.45;
}

.ro-loading, .ro-error { padding: 32px 8px; text-align: center; color: var(--ro-muted); }

.ro-h {
    font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--ro-muted); margin: 18px 2px 10px;
}

/* Search */
.ro-search { position: relative; }
.ro-search > .bi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ro-muted); }
.ro-search-input {
    width: 100%; height: 48px; border: 2px solid var(--ro-line); border-radius: 12px;
    padding: 0 14px 0 40px; font-size: 16px; /* 16px stops iOS zoom */ background: #fff;
}
.ro-search-input:focus { outline: none; border-color: var(--ro-navy); }

.ro-results { margin-top: 10px; display: grid; gap: 8px; }
.ro-result {
    display: grid; gap: 4px; text-align: left; width: 100%; background: #fff;
    border: 1px solid var(--ro-line); border-radius: 12px; padding: 12px 14px;
}
.ro-result:active { background: var(--ro-bg); }
.ro-result-title { font-weight: 700; }
.ro-result-sum { font-size: 13px; color: var(--ro-muted); }
.ro-empty { padding: 16px 4px; color: var(--ro-muted); }

/* Category tiles */
.ro-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 768px) { .ro-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .ro-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ro-tile {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
    min-height: 112px; padding: 14px; background: #fff; border: 1px solid var(--ro-line);
    border-radius: 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); transition: transform .1s, border-color .15s;
}
.ro-tile:hover { border-color: var(--ro-navy); }
.ro-tile:active { transform: scale(.98); background: var(--ro-bg); }
.ro-tile > .bi {
    font-size: 20px; color: var(--ro-navy); background: #e8edf5; width: 36px; height: 36px;
    border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 4px;
}
.ro-tile-title { font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.ro-tile-blurb { font-size: 12px; color: var(--ro-muted); line-height: 1.3; }

/* Back / home */
.ro-nav { display: flex; justify-content: space-between; margin-bottom: 12px; }
.ro-nav-btn {
    background: none; border: none; color: var(--ro-navy); font-weight: 600; padding: 6px 2px; font-size: 14px;
}

/* Question */
.ro-q-text { font-size: 20px; font-weight: 700; margin: 4px 2px 8px; line-height: 1.3; }
.ro-q-help {
    font-size: 13.5px; color: #4a5562; background: #eef3fa; border-radius: 10px; padding: 10px 12px; margin: 0 0 12px;
}
.ro-options { display: grid; gap: 10px; }
.ro-option {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; width: 100%;
    min-height: 56px; padding: 14px 16px; background: #fff; border: 2px solid var(--ro-line); border-radius: 12px;
    font-weight: 600; font-size: 15px; color: var(--ro-ink);
}
.ro-option:hover { border-color: var(--ro-navy); }
.ro-option:active { background: #e8edf5; border-color: var(--ro-navy); }
.ro-option .bi { color: var(--ro-muted); flex-shrink: 0; }

/* Ruling card */
.ro-card { background: #fff; border: 1px solid var(--ro-line); border-radius: 16px; overflow: hidden; }
.ro-card-head {
    background: linear-gradient(135deg, var(--ro-navy) 0%, var(--ro-navy-2) 100%); color: #fff; padding: 16px 16px 14px;
}
.ro-card-kicker { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.ro-card-title { font-size: 20px; font-weight: 700; margin: 4px 0 10px; line-height: 1.25; }
.ro-summary { font-size: 16px; font-weight: 600; padding: 14px 16px 2px; margin: 0; }
.ro-sub {
    font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ro-muted);
    padding: 14px 16px 6px;
}
.ro-steps { margin: 0; padding: 0 16px 0 38px; }
.ro-steps li { margin-bottom: 8px; padding-left: 2px; }
.ro-notes ul { margin: 0; padding: 0 16px 0 34px; color: #3c4652; font-size: 14px; }
.ro-notes li { margin-bottom: 6px; }
.ro-related-list { padding: 0 12px; display: grid; gap: 6px; }
.ro-related {
    text-align: left; background: var(--ro-bg); border: none; border-radius: 10px; padding: 10px 12px;
    font-weight: 600; color: var(--ro-navy);
}
.ro-refs { padding: 0 16px; display: grid; gap: 6px; }
.ro-ref {
    display: block; text-decoration: none; color: var(--ro-ink); font-size: 14px; padding: 8px 10px;
    border: 1px solid var(--ro-line); border-radius: 10px;
}
.ro-ref:hover { border-color: var(--ro-navy); color: var(--ro-navy); }
.ro-ref-num { font-weight: 700; color: var(--ro-navy); margin-right: 4px; }
.ro-ref .bi { font-size: 11px; color: var(--ro-muted); }
.ro-dispute {
    margin: 16px 16px 0; padding: 12px; border-radius: 10px; background: #fff4e5; color: #6b4a00; font-size: 13.5px;
}
.ro-dispute .bi { color: #c77700; }
.ro-card .ro-disclaimer { padding: 0 16px 16px; }

/* Penalty badges */
.ro-badge {
    display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
    justify-self: start; letter-spacing: .02em;
}
.ro-badge-lg { font-size: 13px; padding: 6px 12px; }
.ro-pen-none   { background: #dcf3e4; color: #135c2f; }
.ro-pen-info   { background: #e7ebf0; color: #3c4652; }
.ro-pen-stroke { background: #fff0c2; color: #6b4e00; }
.ro-pen-cancel { background: #dde9fb; color: #1b4a8a; }
.ro-pen-loss   { background: #fbdde1; color: #8c0a1f; }
.ro-card-head .ro-pen-info { background: rgba(255,255,255,.18); color: #fff; }

/* Local rules */
.ro-local { margin-top: 4px; }
.ro-local-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ro-local-item {
    background: #fff; border: 1px solid var(--ro-line); border-left: 4px solid var(--ro-red);
    border-radius: 10px; padding: 10px 12px;
}
.ro-local-title { font-weight: 700; }
.ro-local-scope {
    font-size: 11px; font-weight: 600; color: var(--ro-muted); background: var(--ro-bg);
    border-radius: 6px; padding: 1px 6px; margin-left: 6px; white-space: nowrap;
}
.ro-local-body { font-size: 14px; color: #3c4652; margin-top: 2px; }
.ro-local-pen { font-size: 12.5px; color: var(--ro-red); font-weight: 600; margin-top: 4px; }
.ro-local-collapsed { margin: 14px 16px 0; }
.ro-local-collapsed summary {
    cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--ro-red); padding: 8px 0; list-style-position: inside;
}

.ro-disclaimer { font-size: 12px; color: var(--ro-muted); margin: 18px 2px 4px; }

/* ── Scorecard panel (Bootstrap offcanvas, bottom sheet) ───────────────── */
.ro-panel.offcanvas-bottom {
    height: 92vh; height: 92dvh; border-radius: 18px 18px 0 0; background: var(--ro-bg, #f5f7fa);
}
.ro-panel .offcanvas-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%); color: #fff; border-radius: 18px 18px 0 0;
    padding: 14px 16px;
}
.ro-panel .offcanvas-title { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ro-panel .offcanvas-title small { font-weight: 500; opacity: .75; font-size: 12px; }
.ro-panel .offcanvas-body { padding: 14px 14px calc(24px + env(safe-area-inset-bottom, 0px)); background: #f5f7fa; }
.ro-panel-grip { width: 40px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.45); margin: 0 auto 10px; }

/* Header trigger button on the mobile layout */
.mobile-header .rules-btn {
    background: rgba(255,255,255,0.2); border: none; color: #fff; height: 36px; border-radius: 18px;
    display: flex; align-items: center; gap: 5px; padding: 0 11px; font-size: 13px; font-weight: 600;
    flex-shrink: 0; margin-right: 8px;
}
.mobile-header .rules-btn:active { background: rgba(255,255,255,0.3); }
@media (max-width: 360px) { .mobile-header .rules-btn span { display: none; } }

/* ── Phase 2: log a ruling on the match ───────────────────────────────── */
.ro-log { margin: 16px 16px 0; }
.ro-log .ro-sub { padding: 0 0 8px; }
.ro-log-actions { display: grid; gap: 8px; }
.ro-log-btn {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
    padding: 12px 14px; border-radius: 12px; border: 2px solid var(--ro-line); background: #fff;
}
.ro-log-btn > .bi { font-size: 22px; flex-shrink: 0; }
.ro-log-btn span { display: flex; flex-direction: column; line-height: 1.25; }
.ro-log-btn small { color: var(--ro-muted); font-size: 12.5px; }
.ro-log-accept > .bi { color: #198754; }
.ro-log-accept:active { background: #ecf8f0; border-color: #198754; }
.ro-log-dispute > .bi { color: #c77700; }
.ro-log-dispute:active { background: #fff4e5; border-color: #c77700; }

.ro-log-form { border: 2px solid #198754; border-radius: 12px; padding: 12px; background: #fbfefc; }
.ro-log-form.is-dispute { border-color: #c77700; background: #fffaf2; }
.ro-log-mode { font-size: 13.5px; color: #3c4652; margin-bottom: 10px; }
.ro-log-form.is-dispute .ro-log-mode .bi { color: #c77700; }
.ro-log-form:not(.is-dispute) .ro-log-mode .bi { color: #198754; }
.ro-field { margin-bottom: 10px; }
.ro-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ro-muted); margin-bottom: 4px; }
.ro-opt { font-weight: 400; }
.ro-input {
    width: 100%; border: 2px solid var(--ro-line); border-radius: 10px; padding: 10px 12px;
    font-size: 16px; /* no iOS zoom */ background: #fff; color: var(--ro-ink);
}
.ro-input:focus { outline: none; border-color: var(--ro-navy); }
.ro-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.ro-seg-opt { flex: 1 1 30%; margin: 0; }
.ro-seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ro-seg-opt span {
    display: block; text-align: center; padding: 9px 6px; border-radius: 10px; border: 2px solid var(--ro-line);
    background: #fff; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ro-seg-opt input:checked + span { border-color: var(--ro-navy); background: #e8edf5; color: var(--ro-navy); }
.ro-log-err { color: #8c0a1f; background: #fbdde1; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; margin-bottom: 10px; }
.ro-log-submit-row { display: flex; justify-content: space-between; align-items: center; }
.ro-log-submit {
    border: none; border-radius: 10px; padding: 11px 18px; font-weight: 700; color: #fff; background: #198754;
}
.ro-log-form.is-dispute .ro-log-submit { background: #c77700; }
.ro-log-submit:disabled { opacity: .65; }
.ro-log-done { border-radius: 12px; padding: 12px; background: #ecf8f0; color: #135c2f; font-size: 14px; }
.ro-log-done.is-dispute { background: #fff4e5; color: #6b4a00; }

/* Logged-this-match list (panel home) */
.ro-logged-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--ro-line); border-radius: 12px; }
.ro-logged-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--ro-line); }
.ro-logged-item:first-child { border-top: none; }
.ro-logged-hole { font-size: 12px; font-weight: 700; color: var(--ro-navy); background: #e8edf5; border-radius: 6px; padding: 2px 6px; flex-shrink: 0; }
.ro-logged-title { flex: 1; font-size: 14px; font-weight: 600; min-width: 0; }
.ro-logged-title small { font-weight: 400; color: var(--ro-muted); }
.ro-logged-status { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 8px; flex-shrink: 0; }
.ro-st-accepted { background: #dcf3e4; color: #135c2f; }
.ro-st-disputed { background: #fbdde1; color: #8c0a1f; }
.ro-st-resolved { background: #e7ebf0; color: #3c4652; }
.ro-st-queued { background: #fff0c2; color: #6b4e00; }
.ro-seg-opt { position: relative; }
.ro-root [hidden] { display: none !important; }
.ro-input { font-family: inherit; }

/* ── Penalty on the scorecard (log form) ─────────────────────────────── */
.ro-pen-row { display: flex; align-items: center; gap: 10px; }
.ro-stepper { display: inline-flex; align-items: center; border: 2px solid var(--ro-line); border-radius: 10px; background: #fff; overflow: hidden; }
.ro-step { width: 40px; height: 40px; border: none; background: #fff; font-size: 20px; font-weight: 700; color: var(--ro-navy); }
.ro-step:active { background: #e8edf5; }
.ro-step-val { min-width: 32px; text-align: center; font-size: 18px; font-weight: 700; }
.ro-pen-unit { font-size: 14px; color: var(--ro-muted); }
.ro-check { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; font-weight: 600; }
.ro-check input { width: 18px; height: 18px; }
.ro-pen-hint { font-size: 12px; color: var(--ro-muted); margin-top: 6px; }

/* ── Scorecard markers (Scorecard/Index, VerifyScorecard) ────────────── */
.ro-hole-flag { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
    border-radius: 50%; font-size: 11px; margin-left: 4px; vertical-align: middle; }
.ro-hole-flag-logged { background: #dde9fb; color: #1b4a8a; }
.ro-hole-flag-disputed { background: #fbdde1; color: #8c0a1f; }
.ro-hole-flag-resolved { background: #e7ebf0; color: #3c4652; }

/* ── EnterScore banner: rulings on this hole ─────────────────────────── */
.ro-hole-banner { margin: 0 15px 16px; border-radius: 12px; background: #eef3fa; border-left: 4px solid #1e3a5f; padding: 10px 12px; font-size: 14px; }
.ro-hole-banner.is-disputed { background: #fff4e5; border-left-color: #c77700; }
.ro-hole-banner-head { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #5f6b7a; margin-bottom: 4px; }
.ro-hole-banner-item { padding: 4px 0; }
.ro-hole-banner-item + .ro-hole-banner-item { border-top: 1px solid rgba(0,0,0,.06); }
.ro-hole-banner-status { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.ro-hole-banner-meta { font-size: 13px; color: #3c4652; }
.ro-hole-banner-tip { font-size: 12.5px; color: #1b4a8a; margin-top: 6px; font-weight: 600; }
