:root {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

body {
    margin: 0;
    padding: 20px;
    background: #f6f7fb;
}

.page {
    max-width: 980px;
    margin: 0 auto;
}

.card {
    background: white;
    border: 1px solid #e5e7ef;
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
}

.row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 8px 0;
}

.row.spread {
    justify-content: space-between;
}

label {
    width: 120px;
    color: #333;
}

input,
select {
    padding: 8px;
    border: 1px solid #cfd3e1;
    border-radius: 8px;
    min-width: 260px;
}

button {
    padding: 8px 12px;
    border: 1px solid #cfd3e1;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

button:hover {
    background: #f2f4ff;
}

.hidden {
    display: none;
}

.mono {
    background: #0b1020;
    color: #d7e0ff;
    padding: 10px;
    border-radius: 10px;
    overflow: auto;
}

.small {
    font-size: 12px;
}

.configForm {
    margin-left: 130px;
    display: grid;
    gap: 8px;
}

.configRow {
    display: flex;
    gap: 10px;
    align-items: center;
}

.configRow input {
    min-width: 160px;
    width: 160px;
}

.gameRoot {
    margin-top: 12px;
}

.tttGrid {
    display: grid;
    gap: 8px;
    width: max-content;
}

.tttCell {
    width: 64px;
    height: 64px;
    font-size: 22px;
}

.kickPanel {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.canvasWrap {
    position: relative;
    display: inline-block;
}

.wbCanvas {
    border: 1px solid #cfd3e1;
    border-radius: 10px;
    background: #ffffff;
    touch-action: none;
    /* important for pointer drawing on touch */
}

.wbTextInput {
    position: absolute;
    padding: 4px 6px;
    border: 1px solid #cfd3e1;
    border-radius: 8px;
    outline: none;
    min-width: 120px;
}

.rbWrap {
    position: relative;
    display: inline-block;
}

.rbCanvas {
    border: 1px solid #cfd3e1;
    border-radius: 10px;
    display: block;
    background: #fff;
}

.rbHud {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #e5e7ef;
    background: rgba(255, 255, 255, 0.92);
    white-space: pre;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

.fpsWrap {
    position: relative;
    display: inline-block;
}

.fpsCanvas {
    border: 1px solid #cfd3e1;
    border-radius: 10px;
    display: block;
    background: #fff;
}

.fpsHud {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #e5e7ef;
    background: rgba(255, 255, 255, 0.92);
    white-space: pre;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    max-width: 520px;
    z-index: 20;
}

.fpsCounter {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px solid #e5e7ef;
    background: rgba(255, 255, 255, 0.92);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    z-index: 30;
    pointer-events: none;
}

.fpsCrosshair {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 20px;
    color: rgba(0, 0, 0, 0.65);
    user-select: none;
    pointer-events: none;
    z-index: 25;
}

.hpBar {
    position: absolute;
    left: 10px;
    bottom: 10px;
    width: 220px;
    height: 18px;
    border-radius: 10px;
    border: 1px solid #e5e7ef;
    background: rgba(255, 255, 255, 0.92);
    overflow: hidden;
    z-index: 35;
}

.hpFill {
    height: 100%;
    width: 100%;
    background: rgba(209, 36, 47, 0.85);
    transition: width 80ms linear;
}

.hpText {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.85);
    pointer-events: none;
}

.damageOverlay {
    position: absolute;
    inset: 0;
    background: rgba(209, 36, 47, 0.32);
    opacity: 0;
    transition: opacity 30ms linear;
    z-index: 34;
    pointer-events: none;
}