/* Kontor: Ring als 8x8-Raster, Mitte mit Würfeln und Steuerung, Felddetails, Handel. Farben aus app.css. */

.ko-game { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ko-main { flex: 0 0 auto; padding: .6rem; display: flex; flex-direction: column; gap: .6rem; }
.ko-side { flex: 0 0 auto; padding: 0 .6rem .6rem; display: flex; flex-direction: column; gap: .6rem; }
@media (min-width: 960px) {
    .ko-game { flex-direction: row; overflow: hidden; }
    .ko-main { flex: 1 1 auto; min-width: 0; overflow-y: auto; max-width: 720px; margin: 0 auto; }
    .ko-side { flex: 0 0 340px; overflow-y: auto; padding: .8rem .8rem .8rem 0; }
}

.ko-head { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: baseline; }

/* 11 x 11: vier Ecken plus je neun Felder an den Seiten, macht die 40 des Vorbilds. */
.ko-board {
    display: grid; grid-template-columns: repeat(11, 1fr); grid-template-rows: repeat(11, 1fr);
    gap: 2px; width: 100%; max-width: 720px; aspect-ratio: 1; margin: 0 auto;
    padding: 4px; border-radius: 12px; background: var(--board-bg); border: 1px solid var(--line);
}
.ko-cell {
    position: relative; margin: 0; padding: 0; min-height: 0; border-radius: 6px; overflow: hidden;
    background: var(--surface-2); border: 2px solid transparent; color: var(--ink);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    font-size: clamp(.4rem, 1.35vw, .68rem); line-height: 1.05; cursor: pointer;
}
.ko-cell.owned { border-color: var(--owner); }
.ko-cell.is-mortgaged { opacity: .7; }
.ko-cell.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.ko-cell.here { box-shadow: inset 0 0 0 2px var(--accent-2); }
.ko-cell.kind-start { background: color-mix(in srgb, var(--accent) 30%, var(--surface-2)); }
.ko-cell.kind-tax { background: color-mix(in srgb, var(--error) 22%, var(--surface-2)); }
.ko-cell.kind-chance { background: color-mix(in srgb, var(--accent-2) 25%, var(--surface-2)); }
.ko-cell.kind-chest { background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); }
.ko-cell.kind-jail { background: color-mix(in srgb, var(--muted) 30%, var(--surface-2)); }
.ko-cell.kind-gotojail { background: color-mix(in srgb, var(--error) 34%, var(--surface-2)); }
.ko-cell.kind-freeparking { background: color-mix(in srgb, var(--accent-2) 14%, var(--surface-2)); }
.ko-cell.kind-station, .ko-cell.kind-works { background: var(--surface-3); }
.ko-stripe { position: absolute; top: 0; left: 0; right: 0; height: 22%; }
.ko-cell .ko-short { margin-top: 18%; font-weight: 700; white-space: nowrap; }
/* Nur Straßen tragen oben den Stadtstreifen, alles andere nutzt die volle Höhe. */
.ko-cell:not(.kind-property) .ko-short { margin-top: 0; }
.ko-level { font-size: .75em; color: var(--accent); letter-spacing: 1px; }
.ko-mortgaged { position: absolute; top: 24%; right: 3px; font-size: .8em; color: var(--error); }
.ko-tokens { position: absolute; bottom: 2px; left: 2px; right: 2px; display: flex; flex-wrap: wrap; gap: 1px; justify-content: center; }
.ko-token {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.5em; height: 1.5em; border-radius: 50%; font-size: .7em; font-weight: 800; color: #111;
    border: 1px solid rgba(0,0,0,.4); box-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.ko-token.current { outline: 2px solid #fff; }

.ko-center {
    grid-row: 2 / 11; grid-column: 2 / 11;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
    padding: .5rem; text-align: center; border-radius: 10px;
    background: radial-gradient(ellipse at center, color-mix(in srgb, var(--accent-2) 18%, var(--surface)) 0%, var(--surface) 100%);
}
.ko-dice { display: flex; gap: .6rem; }
.ko-center button { margin: 0; }
.ko-buy, .ko-debt { display: flex; flex-direction: column; gap: .35rem; align-items: center; }
.ko-event { font-size: .8rem; color: var(--accent); max-width: 90%; }
@media (max-width: 599.98px) {
    .ko-center { gap: .3rem; padding: .3rem; font-size: .85rem; }
    .ko-center .die-face { --die-size: 40px; }
    .ko-event { font-size: .7rem; }
}

.ko-field-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ko-field-head h3 { margin: 0; }
.ko-field-head .link { margin-left: auto; }
.ko-swatch { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }

.ko-trade-sides { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.ko-trade-sides h4 { margin: .2rem 0; }
.ko-trade-sides label { display: block; }
.ko-trade-sides input[type=number] { width: 6rem; }

.ko-player { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; padding: .35rem 0; border-top: 1px solid var(--line); }
.ko-player:first-of-type { border-top: 0; }
.ko-player.active .pname { color: var(--accent); }
.ko-player.out { opacity: .55; }
.ko-player .ko-token { font-size: .8rem; }
.ko-cash { font-weight: 700; font-variant-numeric: tabular-nums; }
.ko-chips { display: flex; flex-wrap: wrap; gap: 3px; width: 100%; }
.ko-chip { margin: 0; min-height: 0; padding: 1px 5px; font-size: .68rem; border-radius: 4px; border: 0; color: #111; font-weight: 700; }
.ko-chip.mortgaged { text-decoration: line-through; opacity: .6; }

.ko-log ul { list-style: none; padding: 0; margin: 0; font-size: .85rem; max-height: 50vh; overflow-y: auto; }
.ko-log li { padding: .2rem 0; border-top: 1px solid var(--line); }
.ko-log li:first-child { border-top: 0; }
.ko-log li .muted { display: inline-block; min-width: 1.6em; }

/* Im Gefängnis: der Stein bekommt Gitter, die Zeile einen roten Hinweis. */
.ko-token.jailed { outline: 2px dashed var(--error); outline-offset: 1px; }
.badge.ko-jailed { background: color-mix(in srgb, var(--error) 22%, transparent); color: var(--error); }
