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

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;

}

.controls {

    display: flex;
    gap: 12px;
    padding: 12px;

    border-radius: 8px;
    box-shadow: 0px 4px 4px 1px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    align-items: center;
}

.color-picker {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: white;
    border-radius: 8px;
}

.shadowed {
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid white;
}

.color-option.selected {
    border-color: #333;
}

.board-container {
    position: relative;
    flex-grow: 1;
}

#gameBoard {
    position: absolute;
    top: 0;
    left: 0;
}

#markersLayer {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.marker {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    pointer-events: auto;
    cursor: move;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    box-shadow: 0px 3px 0px 0px rgb(0 0 0);
}

.marker-inner {
}

.dice-roller {
    display: flex;
    gap: 8px;
    align-items: center;
    background: white;
    padding: 4px 12px;
    border-radius: 8px;
    position: relative;
}

.dice-input-group {
    display: flex;
    gap: 4px;
    align-items: center;
    position: relative;
}

#diceInput {
    flex: 1;
    min-width: 100px;
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    height: 40px;
    box-sizing: border-box;
}

#rollButton, #customDiceBtn {
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

#rollButton:hover, #customDiceBtn:hover {
    background: #f5f5f5;
}

#rollResult {
    min-width: 40px;
    text-align: center;
    font-weight: bold;
    color: #2196F3;
}

button, .tool-option, .file-upload-label {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

button:hover, .tool-option:hover, .file-upload-label:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.tool-option.selected, .color-option.selected {
    background: #e3f2fd;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    border: 2px solid #2196F3;
}

.tools {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: white;
    border-radius: 8px;

}

i {
    font-size: 18px;
    color: #555;
}

.selected i {
    color: #2196F3;
}

#previewLayer {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    background-color: #333;
    color: white;
    border-radius: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease-in-out;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification.success {
    background-color: #4CAF50;
}

.notification.error {
    background-color: #f44336;
}

#diceContainer {
    display: flex;
    gap: 10px;

}

.die {
    width: 40px;
    height: 40px;
    background: #f1f1f1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-family: "Noto Color Emoji", sans-serif;
    color: rgba(34, 34, 34, 0.9);
    box-shadow: 0px 3px 0px -1px rgb(0 0 0 / 60%);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

.die:hover {
    background: #f7f7f7;
    animation: rollDiceLeft 0.2s ease-in-out infinite;
}

.roll-left {
    animation: rollDiceLeft 0.2s ease-in-out infinite;
}

.roll-right {
    animation: rollDiceRight 0.2s ease-in-out infinite;
}

@keyframes rollDiceLeft {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-45deg) scale(1.0); }
    75% { transform: rotate(45deg) scale(0.9); }
    100% { transform: rotate(0deg) scale(1); }
}

@keyframes rollDiceRight {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(45deg) scale(0.9); }
    75% { transform: rotate(-45deg) scale(1.0); }
    100% { transform: rotate(0deg) scale(1); }
}

.die.rolled {
    animation: none;
    transform: scale(1.0);
    transition: transform 0.2s ease-out;
}

.hidden-input {
    display: none;
}

.file-upload-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

.file-upload-label:hover {
    background-color: #e0e0e0;
}

.custom-face-input {
    width: 40px;
    height: 40px;
    padding: 8px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 20px;
    background: white;
}

.custom-face-input:focus {
    outline: 2px solid #2196F3;
    border-color: transparent;
}

.dice-faces-container {
    display: flex;
    gap: 8px;
    align-items: center;
    background: white;
    padding: 4px 12px;
    border-radius: 8px;
}

.custom-dice-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    margin-top: 8px;
}

.custom-dice-dropdown.show {
    display: block;
}

.dice-preview-item {
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.dice-preview-item:hover {
    background-color: #f5f5f5;
}

.dice-preview-item.empty {
    color: #666;
    cursor: default;
}

.dice-preview-item .dice-name {
    font-weight: bold;
    color: #333;
}

.dice-preview-item .dice-faces {
    color: #666;
    flex-grow: 1;
}

/* Add placeholder text style */
#diceInput::placeholder {
    color: #999;
    font-style: italic;
}

.counter-container {
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1000;
    pointer-events: auto;
    cursor: move;
    user-select: none;
}
.counter-name {
    font-weight: bold;
    margin-bottom: 5px;
    min-width: 50px;
    padding: 2px;
    cursor: text;
}
.counter-name:focus {
    outline: 1px solid #007bff;
    border-radius: 2px;
}
.counter-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}
.counter-btn {

    height: 20px;
}
.counter-btn:hover {
    background: #0056b3;
}
.counter-value {
    min-width: 20px;
    text-align: center;
    cursor: text;
}
.roll-history-dropdown {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    right: 0;
    top: 100%;
    min-width: 200px;
}

.roll-history-dropdown.show {
    display: block;
}

.history-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
}

.history-item:hover {
    background: #f5f5f5;
}

.history-item.empty {
    color: #999;
    cursor: default;
}

.roll-input {
    font-weight: bold;
    margin-right: 12px;
}

.roll-result {
    color: #666;
}