@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@700;900&display=swap');

:root {
    --border-dark: #222;
    --border-width: 3px;
    --bg-color: #f8f9fa;
    --ui-bg: #ffffff;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #e9e9e9;
    font-family: 'Nunito', sans-serif;
}

#screen {
    width: 1000px;
    height: 1000px;
    position: relative;
    background-color: #ffffff;
}

canvas {
    position: absolute;
    image-rendering: pixelated;
    width: 1000px;
    height: 1000px;
}

#hud {
    position: absolute;
    z-index: 10;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
}

#mouse-preview, #id {
    pointer-events: none;
}

.top-bar, .left-toolbar, .right-toolbar {
    pointer-events: none;
    position: absolute;
}

::-webkit-color-swatch,
::-moz-color-swatch {
  border-color: transparent;
}

.top-bar {
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    box-sizing: border-box;
}

.top-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-text {
    margin: 0;
    font-size: 2rem;
    font-weight: 900;
    color: var(--border-dark);
    letter-spacing: -1px;
}

.community-box {
    display: none;
    width: 35px;
    height: 35px;
    border: var(--border-width) solid var(--border-dark);
    border-radius: var(--border-radius-sm);
    background: var(--ui-bg);
}

.community-text {
    display: none;
    color: #000000;
    font-size: 1.1rem;
    font-weight: 700;
}

.top-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-pill {
    padding: 0.3rem 0.8rem;
    border: var(--border-width) solid var(--border-dark);
    border-radius: 20px;
    background: var(--ui-bg);
}

.user-icon {
    font-size: 2.5rem;
    color: var(--border-dark);
}

/* =========================================
   MENU LATERAL ESQUERDO (FERRAMENTAS)
========================================= */
.left-toolbar {
    top: 90px;
    left: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.circle-btn {
    width: 35px;
    height: 35px;
    border: var(--border-width) solid var(--border-dark);
    border-radius: 50%;
    background: var(--ui-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: auto;
}

.tools-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: var(--border-width) solid var(--border-dark);
    border-radius: 16px;
    background: var(--ui-bg);
    padding: 8px;
}

.tools-container button {
    width: 45px;
    height: 45px;
    border: var(--border-width) solid var(--border-dark);
    border-radius: 8px;
    background: var(--ui-bg);
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--border-dark);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tools-container button:hover {
    background: #e9ecef;
    transform: scale(1.05);
    border-radius: 12px;
    color: rgb(255, 255, 255);
}

.tools-container button.pencil:hover {
    background: #3772FF;
    border: var(--border-width) solid #3772FF;
}

.tools-container button.eraser:hover {
    background: #f0803c;
    border: var(--border-width) solid #f0803c;
}

.tools-container button.bucket:hover {
    background: #ef2d56;
    border: var(--border-width) solid #ef2d56;
}

.tools-container button.dropper:hover {
    background: #2fbf71;
    border: var(--border-width) solid #2fbf71;
}

.tools-container button.pan:hover {
    background: #8228ac;
    border: var(--border-width) solid #8228ac;
}

.tools-container button.pencil[on] {
    background: #3772FF;
    border: var(--border-width) solid #3772FF;
    color: rgb(255, 255, 255);
}

.tools-container button.eraser[on] {
    background: #f0803c;
    border: var(--border-width) solid #f0803c;
    color: rgb(255, 255, 255);
}

.tools-container button.bucket[on] {
    background: #ef2d56;
    border: var(--border-width) solid #ef2d56;
    color: rgb(255, 255, 255);
}

.tools-container button.dropper[on] {
    background: #2fbf71;
    border: var(--border-width) solid #2fbf71;
    color: rgb(255, 255, 255);
}

.tools-container button.pan[on] {
    background: #8228ac;
    border: var(--border-width) solid #8228ac;
    color: rgb(255, 255, 255);
}

.right-toolbar {
    top: 90px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: var(--border-width) solid var(--border-dark);
    border-radius: 16px;
    background: var(--ui-bg);
    padding: 8px;
}

.mini-palette {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.mini-color {
    width: 32px;
    height: 32px;
    border: var(--border-width) solid var(--border-dark);
    border-radius: 8px;
    pointer-events: all;
    cursor: pointer;
}

.mini-color.blue {
    background-color: #3772FF;
}

.mini-color.orange {
    background-color: #f0803c;
}

.mini-color.red {
    background-color: #ef2d56;
}

.mini-color.yellow {
    background-color: rgb(236, 216, 29);
}

.mini-color.black {
    background-color: #000;
}

.mini-color.white {
    background-color: #FFF;
}

.mini-color.gray {
    background-color: #8228ac
}

.mini-color.green {
    background-color: #2fbf71;
}

.mini-color.brown {
    background-color: #b6531a;
}

.mini-color.magenta {
    background-color: #bf2fa7;
}

.color-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

input[type="color"] {
    border: none;
    width: 72px;
    height: 72px;
    border: var(--border-width) solid var(--border-dark);
    border-radius: var(--border-radius-sm);
    padding: 0;
    cursor: pointer;
    background: none;
}
input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}
input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

#cursor {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-dark);
    background-color: transparent;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    pointer-events: none;
}
