/* Randori - mobile-first. Kleuren van de kaarttypen komen uit cards.json
 * (typen.kleur) en staan altijd naast een icoon en een tekstlabel. */

:root {
    --rd-ink: #1d2b3a;
    --rd-mat: #f4f1ea;
    --rd-tatami: #e7dfc9;
    --rd-accent: #b71c1c;
    --rd-ok: #1b5e20;
    --rd-focus: #ffbf47;
}

.rd-body {
    background: var(--rd-mat);
    color: var(--rd-ink);
    min-height: 100vh;
    font-size: 1.05rem;
}

.rd-nav {
    background: var(--rd-ink);
}

.rd-nav .nav-link,
.rd-nav .navbar-brand {
    min-height: 44px;
    display: flex;
    align-items: center;
}

.rd-who {
    color: #fff;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.rd-main {
    padding-bottom: 6rem;
    max-width: 960px;
}

.rd-main:focus {
    outline: none;
}

.rd-skip:focus {
    position: absolute;
    z-index: 1000;
    background: #fff;
    padding: .5rem 1rem;
}

/* Zichtbare focus, ook op donker. */
.rd-body a:focus,
.rd-body button:focus,
.rd-body input:focus,
.rd-body select:focus,
.rd-body summary:focus,
.rd-prompt:focus {
    outline: 3px solid var(--rd-focus);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px var(--rd-ink);
}

.rd-body .btn {
    min-height: 48px;
}

.rd-check {
    width: 1.4rem;
    height: 1.4rem;
    margin-top: .1rem;
}

.form-check-label {
    padding-left: .5rem;
}

/* ------------------------------------------------------------------ gordels */

.rd-belt {
    display: inline-block;
    width: 2.2rem;
    height: .8rem;
    border-radius: 3px;
    border: 2px solid var(--rd-ink);
    vertical-align: middle;
    flex: 0 0 auto;
}

.rd-belt-lg {
    width: 3.5rem;
    height: 1.2rem;
}

.rd-belt-wit { background: #fff; }
.rd-belt-geel { background: #f9d71c; }
.rd-belt-oranje { background: #f57c00; }
.rd-belt-groen { background: #2e7d32; }
.rd-belt-blauw { background: #1565c0; }
.rd-belt-bruin { background: #6d4c41; }
.rd-belt-zwart { background: #111; border-color: #888; }

.rd-belt-choice {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
    gap: .5rem;
}

.rd-belt-option {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 48px;
    padding: .4rem .6rem;
    border: 2px solid #c9c2b0;
    border-radius: .5rem;
    background: #fff;
    cursor: pointer;
    margin: 0;
}

.rd-belt-option input {
    width: 1.2rem;
    height: 1.2rem;
}

/* ----------------------------------------------------------- start, spelers */

.rd-steps li {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    margin-bottom: .6rem;
}

.rd-steps .bi {
    font-size: 1.4rem;
    color: var(--rd-accent);
}

.rd-cta .btn + .btn {
    margin-top: .75rem;
}

.rd-player-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    background: #fff;
    border: 2px solid #ddd5c1;
    border-radius: .75rem;
    padding: .75rem 1rem;
    margin-bottom: .75rem;
}

.rd-player-row.is-active {
    border-color: var(--rd-ink);
    box-shadow: 0 0 0 2px var(--rd-ink) inset;
}

.rd-player-info {
    display: flex;
    gap: .75rem;
    align-items: center;
}

.rd-player-name {
    font-size: 1.2rem;
}

.rd-player-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.rd-form-card,
.rd-home .card {
    border-radius: .75rem;
    border: 2px solid #ddd5c1;
}

.rd-choice,
.rd-level {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    background: #fff;
    border: 2px solid #ddd5c1;
    border-radius: .6rem;
    padding: .6rem .8rem;
    margin-bottom: .5rem;
    min-height: 48px;
    cursor: pointer;
}

.rd-choice input,
.rd-level input {
    width: 1.3rem;
    height: 1.3rem;
    margin-top: .2rem;
    flex: 0 0 auto;
}

.rd-levels {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
    gap: .5rem;
}

.rd-hajime {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: .05em;
}

.rd-result {
    padding: .35rem 0;
    border-bottom: 1px solid #eee;
}

.rd-result-win .bi { color: #8a6d00; }
.rd-result-loss .bi { color: #8b1a1a; }

/* -------------------------------------------------------------- speelbord */

.rd-loading {
    padding: 2rem 0;
    text-align: center;
}

.rd-board {
    display: grid;
    grid-template-columns: 1fr;
    gap: .5rem;
    margin-top: .75rem;
}

@media (min-width: 768px) {
    .rd-board {
        grid-template-columns: 1fr 1.6fr 1fr;
        align-items: start;
    }
}

.rd-side {
    background: #fff;
    border-radius: .75rem;
    padding: .6rem .8rem;
    border: 2px solid #ddd5c1;
}

.rd-me {
    border-color: var(--rd-ink);
}

.rd-side-name {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
    font-size: 1.1rem;
}

.rd-score,
.rd-shido,
.rd-stamina,
.rd-grip,
.rd-small {
    font-size: .95rem;
    margin-top: .25rem;
}

.rd-small {
    color: #4a4a4a;
}

.rd-dots {
    display: inline-flex;
    gap: .25rem;
    margin-left: .4rem;
    vertical-align: middle;
}

.rd-dot {
    width: .9rem;
    height: .9rem;
    border-radius: 50%;
    border: 2px solid var(--rd-ink);
    background: #fff;
}

.rd-dot.is-on {
    background: var(--rd-ink);
}

.rd-ippon {
    color: var(--rd-accent);
}

.rd-shido-card {
    display: inline-block;
    width: .7rem;
    height: 1rem;
    background: #f9d71c;
    border: 1px solid #8a6d00;
    border-radius: 2px;
    margin-left: .15rem;
    vertical-align: middle;
}

.rd-meter {
    height: .8rem;
    background: #e3ddd0;
    border-radius: .4rem;
    overflow: hidden;
    border: 1px solid #b9b19c;
}

.rd-meter-fill {
    display: block;
    height: 100%;
    background: var(--rd-ok);
    transition: width .4s ease;
}

.rd-meter.is-low .rd-meter-fill {
    background: #c62828;
    background-image: repeating-linear-gradient(45deg, transparent 0 4px, rgba(255, 255, 255, .35) 4px 8px);
}

.rd-center {
    background: var(--rd-tatami);
    border-radius: .75rem;
    padding: .6rem;
    position: relative;
    min-height: 7rem;
}

.rd-status {
    font-weight: 700;
    text-align: center;
}

.rd-mat-empty {
    text-align: center;
    margin: 1.2rem 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.rd-played-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
    margin-top: .4rem;
}

.rd-played {
    margin: 0;
    max-width: 12rem;
}

.rd-played figcaption {
    font-size: .85rem;
    font-weight: 600;
    text-align: center;
}

.rd-banner {
    display: none;
}

.rd-banner.is-shown {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(29, 43, 58, .94);
    color: #fff;
    border-radius: .75rem;
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: rd-pop .25s ease-out;
}

.rd-banner.is-ippon { background: rgba(183, 28, 28, .96); font-size: 2rem; }
.rd-banner.is-score { background: rgba(13, 71, 161, .96); }
.rd-banner.is-stop { background: rgba(27, 94, 32, .96); }
.rd-banner.is-shido { background: #f9d71c; color: #1d2b3a; }

.rd-clock-title {
    font-size: 1.1rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.rd-clock-num {
    font-size: 3rem;
    font-variant-numeric: tabular-nums;
}

.rd-clock-unit {
    font-size: 1rem;
    margin-left: .3rem;
}

.rd-clock-bar {
    width: 80%;
    height: .7rem;
    background: rgba(255, 255, 255, .3);
    border-radius: .35rem;
    overflow: hidden;
}

.rd-clock-fill {
    display: block;
    height: 100%;
    width: 0;
    background: #fff;
}

@keyframes rd-pop {
    from { transform: scale(.9); opacity: .4; }
    to { transform: scale(1); opacity: 1; }
}

/* ------------------------------------------------------------------- beurt */

.rd-turn {
    margin-top: 1rem;
}

.rd-prompt {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: .25rem;
}

.rd-hint {
    color: #3d3d3d;
}

.rd-error:empty {
    display: none;
}

.rd-hand {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
}

@media (min-width: 576px) {
    .rd-hand { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 992px) {
    .rd-hand { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------------- kaart */

.rd-card {
    display: flex;
    flex-direction: column;
    text-align: left;
    background: #fffdf8;
    color: var(--rd-ink);
    border: 3px solid #b9b19c;
    border-radius: .75rem;
    padding: 0 0 .5rem;
    overflow: hidden;
    min-height: 48px;
    width: 100%;
    font-size: .9rem;
    line-height: 1.25;
    box-shadow: 0 2px 0 rgba(0, 0, 0, .12);
}

button.rd-card {
    cursor: pointer;
    transition: transform .12s ease, border-color .12s ease;
}

button.rd-card:hover:not([disabled]) {
    transform: translateY(-2px);
}

.rd-card > span {
    padding: 0 .55rem;
}

.rd-card-head {
    display: block;
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .3rem .55rem !important;
    margin-bottom: .3rem;
}

.rd-card-name {
    font-size: 1.05rem;
    font-weight: 800;
}

.rd-card-jp {
    font-style: italic;
    color: #555;
}

.rd-card-stats {
    display: flex;
    gap: .5rem;
    margin: .3rem 0;
    font-weight: 800;
    font-size: 1rem;
}

.rd-cost,
.rd-power {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    border: 2px solid currentColor;
    border-radius: 1rem;
    padding: 0 .4rem;
}

.rd-power {
    border-radius: .3rem .3rem .8rem .8rem;
}

.rd-ippon-tag {
    background: var(--rd-accent);
    color: #fff;
    border-radius: .3rem;
    padding: 0 .3rem;
    font-size: .8rem;
}

.rd-card-line {
    display: block;
    font-size: .85rem;
}

.rd-weak {
    margin-top: .2rem;
    border-top: 1px dashed #b9b19c;
    padding-top: .2rem !important;
}

.rd-card-effect {
    display: block;
    font-size: .8rem;
    color: #444;
    margin-top: .2rem;
}

.rd-card-state,
.rd-card-check {
    display: block;
    font-weight: 700;
    font-size: .8rem;
    margin-top: .3rem;
}

.rd-card.is-selected {
    border-color: var(--rd-ink);
    box-shadow: 0 0 0 3px var(--rd-focus), 0 4px 0 rgba(0, 0, 0, .2);
    transform: translateY(-3px);
}

.rd-card.is-disabled {
    opacity: .55;
    filter: grayscale(.6);
    cursor: not-allowed;
}

.rd-card-small {
    font-size: .8rem;
}

.rd-card-small .rd-card-name {
    font-size: .95rem;
}

.rd-detail {
    margin-top: .75rem;
    background: #fff;
    border-left: 4px solid var(--rd-ink);
    padding: .5rem .75rem;
    border-radius: .3rem;
}

.rd-detail:empty,
.rd-options:empty {
    display: none;
}

.rd-options {
    margin-top: .75rem;
    background: #fff;
    border-radius: .5rem;
    padding: .5rem .75rem;
}

.rd-grip-choice legend {
    font-size: 1rem;
    font-weight: 700;
}

.rd-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .75rem 0;
    background: linear-gradient(to top, var(--rd-mat) 80%, rgba(244, 241, 234, 0));
    z-index: 5;
}

/* Geen knoppen: geen (plakkende) balk over de kaarten. */
.rd-actions:empty {
    display: none;
}

.rd-actions .btn {
    flex: 1 1 auto;
}

.rd-go {
    font-weight: 800;
}

.rd-preview {
    margin-top: 1rem;
}

.rd-preview-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
    gap: .4rem;
}

/* ------------------------------------------------------------------- einde */

.rd-end {
    margin-top: 1rem;
    background: #fff;
    border: 3px solid var(--rd-ink);
    border-radius: .75rem;
    padding: 1rem;
    text-align: center;
}

.rd-end.is-win { border-color: #8a6d00; }
.rd-end.is-loss { border-color: #8b1a1a; }

.rd-end-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
}

.rd-log,
.rd-help {
    margin-top: 1rem;
    background: #fff;
    border-radius: .5rem;
    padding: .5rem .75rem;
}

.rd-log summary,
.rd-help summary {
    font-weight: 700;
    min-height: 44px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.rd-log-list {
    max-height: 16rem;
    overflow-y: auto;
    padding-left: 1.4rem;
    margin: 0;
}

.rd-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ------------------------------------------------------ spelen zonder account */

.rd-code-input {
    font-family: monospace;
    letter-spacing: .15em;
    text-transform: uppercase;
    max-width: 12rem;
}

.rd-link-code {
    font-family: monospace;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: .2em;
    background: #fff;
    border: 3px dashed var(--rd-ink);
    border-radius: .6rem;
    padding: .5rem 1rem;
    display: inline-block;
}

.rd-switch .btn {
    min-height: 40px;
}
