body {
    background-color: #121212;
    color: #ffffff;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.grid-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    padding: 0;
    display: block;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    grid-auto-rows: 100px;
    gap: 5px;
}

.grid-cell {
    background-color: #1e1e1e;
    border: 1px solid #333333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    position: absolute;
    width: 50px;   /* was 100px; match Grid.cellSize */
    height: 50px;  /* was 100px; match Grid.cellSize */
    box-sizing: border-box;
}

.grid-cell:hover {
    background-color: #2a2a2a;
}

.grid-cell.active {
    background-color: #3a3a3a;
    border-color: #ffffff;
}

.toolbar {
    position: fixed;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    padding: 6px;
    background: rgba(30, 30, 30, 0.85);
    border: 1px solid #333333;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.tool-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #333333;
    border-radius: 6px;
    background-color: #1e1e1e;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, transform 0.05s ease-in-out;
}

.tool-btn:hover {
    background-color: #2a2a2a;
    border-color: #555555;
}

.tool-btn:active {
    transform: scale(0.96);
}

.tool-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.paint-panel {
    position: fixed;
    top: 56px; /* will be overridden by JS for exact placement */
    right: 10px;
    min-width: 200px;
    padding: 10px;
    background: rgba(30,30,30,0.95);
    border: 1px solid #333333;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    z-index: 1000;
}

.paint-panel .panel-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.paint-panel .panel-row.subtools {
    justify-content: space-between;
    margin-bottom: 0;
}

.paint-panel .color-label {
    font-size: 12px;
    color: #ccc;
}

.paint-panel .color-input {
    appearance: none;
    width: 36px;
    height: 24px;
    padding: 0;
    border: 1px solid #333;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
}

.subtool-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #333333;
    border-radius: 6px;
    background-color: #1e1e1e;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, transform 0.05s ease-in-out;
}

.subtool-btn:hover {
    background-color: #2a2a2a;
    border-color: #555555;
}

.subtool-btn:active {
    transform: scale(0.96);
}

.subtool-btn.active {
    outline: 2px solid #555;
}

.subtool-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.shortcuts-box {
    position: fixed;
    left: 10px;
    bottom: 10px;
    max-width: 280px;
    padding: 8px 10px;
    background: rgba(30, 30, 30, 0.85);
    border: 1px solid #333333;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    z-index: 1000;
    font-size: 12px;
    color: #ddd;
    backdrop-filter: blur(4px);
}

.shortcuts-box strong {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: #ccc;
}

.shortcuts-box ul {
    margin: 0;
    padding-left: 16px;
}

.shortcuts-box li {
    margin: 2px 0;
    line-height: 1.3;
}