* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #272822;
    color: #f8f8f2;
    font-family: system-ui, sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#board-ui {
    width: 100%;
    height: 100%;
    position: relative;
}

#canvas-container {
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, #3e3b40 1.5px, transparent 1.5px);
    background-size: 20px 20px;
}

#toolbar {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
}

#save-area {
    display: flex;
    flex-direction: column;
}

#save-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
    transition: background 0.3s;
    flex-shrink: 0;
}

#save-indicator.unsaved { background: #fd971f; }
#save-indicator.saving  { background: #75715e; }

#board-size {
    width: 100%;
    height: 3px;
    background: #3e3b40;
    cursor: default;
}

#board-size-fill {
    height: 100%;
    width: 0%;
    background: #75715e;
    transition: width 0.4s, background 0.4s;
}

button {
    background: #ae81ff;
    color: #272822;
    border: none;
    border-radius: 0;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

button:hover {
    background: #c4a7ff;
}

button:active {
    background: #9b6fe6;
}

#create-form {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-box {
    background: #2d2a2e;
    padding: 32px;
    width: 320px;
}

.form-box h1 {
    font-size: 18px;
    margin-bottom: 8px;
}

.form-box p {
    font-size: 14px;
    margin-bottom: 16px;
    color: #75715e;
}

.form-box strong {
    color: #f8f8f2;
}

input {
    width: 100%;
    padding: 8px 12px;
    background: #272822;
    border: 1px solid #75715e;
    border-radius: 0;
    color: #f8f8f2;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 12px;
    outline: none;
}

input:focus {
    border-color: #ae81ff;
}

.form-box button {
    width: 100%;
}

#form-error {
    color: #f92672;
    font-size: 13px;
    margin-top: 12px;
    margin-bottom: 0;
}

#toast-container {
    position: fixed;
    bottom: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    z-index: 1000;
    pointer-events: none;
}

.toast {
    padding: 8px 16px;
    font-size: 13px;
    background: #2d2a2e;
    border-left: 3px solid #75715e;
    color: #f8f8f2;
    max-width: 320px;
    white-space: pre-wrap;
    word-break: break-word;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.toast.toast-show {
    opacity: 1;
    transform: translateY(0);
}

.toast.toast-info  { border-color: #66d9ef; }
.toast.toast-success { border-color: #a6e22e; }
.toast.toast-warning { border-color: #fd971f; }
.toast.toast-error { border-color: #f92672; }

#shortcuts-hint {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #75715e;
    z-index: 10;
    pointer-events: none;
}

#version-indicator {
    position: fixed;
    bottom: 16px;
    right: 16px;
    font-size: 12px;
    color: #3e3b40;
    z-index: 10;
    pointer-events: none;
}

#shortcuts-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(39, 40, 34, 0.88);
    z-index: 50;
    align-items: center;
    justify-content: center;
}

#shortcuts-overlay.visible {
    display: flex;
}

#shortcuts-panel {
    background: #2d2a2e;
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#shortcuts-panel h2 {
    font-size: 10px;
    font-weight: 400;
    color: #75715e;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.shortcuts-groups {
    display: flex;
    gap: 40px;
}

.shortcuts-group {
    display: grid;
    grid-template-columns: auto auto;
    gap: 6px 20px;
    align-content: start;
}

.shortcut-row {
    display: contents;
}

.shortcut-row kbd {
    font-family: inherit;
    font-size: 13px;
    color: #66d9ef;
    text-align: right;
    white-space: nowrap;
}

.shortcut-row span {
    color: #75715e;
    font-size: 13px;
}
