* {
    box-sizing: border-box;
}

:root {
    font-family: Tahoma, Verdana, sans-serif;
    color: #202020;
    font-size: 12px;
}

body {
    margin: 0;
    min-height: 100svh;
    background: #008080;
    display: grid;
    place-items: center;
    padding: 24px;
}

.window {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #404040 #404040 #fff;
    padding: 3px;
    box-shadow: 1px 1px 0 #000;
    width: min(980px, 100%);
}

.titlebar {
    height: 30px;
    background: linear-gradient(90deg, #000080, #1084d0);
    color: white;
    font-weight: bold;
    padding: 5px 7px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}

.window-buttons {
    display: flex;
    gap: 3px;
}

.window-buttons i {
    width: 20px;
    height: 19px;
    background: #c0c0c0;
    color: black;
    font: bold 15px Arial;
    text-align: center;
    border: 2px solid;
    border-color: #fff #404040 #404040 #fff;
}

.toolbar,
.scorebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    gap: 12px;
}

.toolbar {
    padding-top: 7px;
    padding-bottom: 7px;
}

button {
    font: inherit;
    background: #c0c0c0;
    color: #111;
    border: 2px solid;
    border-color: #fff #404040 #404040 #fff;
    padding: 6px 15px;
    cursor: pointer;
    min-height: 30px;
}

button:active {
    border-color: #404040 #fff #fff #404040;
}

button:focus-visible {
    outline: 1px dotted #000;
    outline-offset: -5px;
}

.scorebar {
    margin: 0 7px 10px;
    border: 2px solid;
    border-color: #808080 #fff #fff #808080;
    background: #d4d4d4;
}

.scorebar strong {
    display: inline-block;
    margin-left: 10px;
    color: #000080;
    font: bold 25px 'Courier New', monospace;
    vertical-align: middle;
}

.canvas-frame {
    margin: 0 7px;
    border: 2px solid;
    border-color: #808080 #fff #fff #808080;
}

canvas {
    display: block;
    width: 100%;
    background: #a7a7a7;
    touch-action: none;
}

footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 7px;
    padding: 6px 8px;
    border: 1px solid;
    border-color: #808080 #fff #fff #808080;
    min-height: 30px;
}

.grip {
    color: #777;
}

dialog.popup {
    width: min(420px, calc(100% - 32px));
    padding: 3px;
    color: #111;
}

dialog::backdrop {
    background: #0003;
}

.popup-body {
    display: flex;
    gap: 20px;
    padding: 15px 20px;
}

.popup-body p {
    line-height: 1.6;
}

.question {
    margin-top: 15px;
    border-radius: 50%;
    background: #000080;
    color: white;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    text-align: center;
    font: bold 28px Georgia;
}

.small {
    color: #444;
}

.popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 0 16px 18px;
}

@media (max-width: 600px) {
    body {
        padding: 8px;
    }

    .scorebar {
        padding: 8px;
    }

    #stock {
        font-size: 10px;
    }

    footer {
        font-size: 10px;
    }
}