* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea, #764ba2);
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}
#home {
    position: fixed;
    top: 25px;
    left: 25px;
    height: 75px;
    width: 75px;
    border-radius: 100%;
    border: 3px solid #3A3A3A;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    opacity: 0.5;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
#home:hover {
    transition: 0.3s ease;
    transform: scale(1.05);
    opacity: 1;
}
#home svg {
    width: 28px;
    height: 28px;
}
.joc_container {
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
}
.capcelera {
    height: 12vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

h1 {
    font-size: 5vh;
    color: white;
    text-shadow: 4px 4px 0 #333;
    background: #ff6b6b;
    padding: 8px 40px;
    border-radius: 50px;
    border: 4px solid #333;
    display: inline-block;
    margin-bottom: 8px;
    box-shadow: 0 8px 0 #333;
}
.missatge {
    font-size: 3.5vh;
    padding: 10px 40px;
    border-radius: 50px;
    background: white;
    border: 5px solid #4ecdc4;
    font-weight: bold;
    box-shadow: 0 8px 0 #333;
    transition: all 0.3s;
}
.missatge.encert {
    background: #6bff6b;
    border-color: #ffd93d;
    transform: scale(1.05);
}
.missatge.info {
    background: #4ecdc4;
    border-color: #ffd93d;
    color: white;
}
.joc_principal {
    height: 76vh;
    width: 100%;
    display: flex;
    gap: 20px;
    margin: 5px 0;
}
.canvas_container {
    width: 50%;
    background: #ffeaa7;
    border-radius: 50px;
    border: 8px solid #333;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 15px 0 #333;
}
.canvas_container h2 {
    width: 100%;
    font-size: 4vh;
    text-align: center;
    color: #333;
    background: #ffd93d;
    padding: 10px;
    border-radius: 40px;
    margin-bottom: 15px;
    border: 4px solid #333;
}
canvas {
    width: 90%;
    height: 100%;
    background: white;
    border-radius: 40px;
    border: 6px solid #333;
    cursor: crosshair;
    touch-action: none; /* Per mòbils */
}
.eines_container {
    flex: 1;
    background: #a8e6cf;
    border-radius: 50px;
    border: 8px solid #333;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 15px 0 #333;
    overflow-y: auto;
}
.eines_container h2 {
    font-size: 4vh;
    text-align: center;
    color: #333;
    background: #ff8b94;
    padding: 10px;
    border-radius: 40px;
    margin-bottom: 5px;
    border: 4px solid #333;
}
.eines_container h3 {
    font-size: 3vh;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
    background: white;
    padding: 5px;
    border-radius: 30px;
    border: 3px solid #333;
}
.colors_container {
    background: #fdcb6e;
    padding: 15px;
    border-radius: 40px;
    border: 4px solid #333;
}
.colors_graella {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 10px;
}
.color_boto {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 30px;
    border: 5px solid #333;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 5px 0 #333;
}
.color_boto:hover {
    transform: scale(1.1);
}
.color_boto:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #333;
}
.color_boto.seleccionat {
    border: 8px solid white;
    box-shadow: 0 0 0 4px #333, 0 8px 0 #333;
    transform: scale(1.05);
}
.color_vermell { background: #FF4444; }
.color_blau { background: #4444FF; }
.color_groc { background: #FFFF44; }
.color_verd { background: #44FF44; }
.color_taronja { background: #FF8844; }
.color_lila { background: #AA44FF; }
.color_blanc { background: #ffffff; }
.color_negre { background: #333333; }

.grandaria_container {
    background: #ffb347;
    padding: 15px;
    border-radius: 40px;
    border: 4px solid #333;
}
.grandaria_controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}
.boto_grandaria {
    font-size: 2.5vh;
    padding: 15px 20px;
    border-radius: 40px;
    border: 4px solid #333;
    background: white;
    cursor: pointer;
    font-weight: bold;
    flex: 1;
    box-shadow: 0 5px 0 #333;
    transition: all 0.2s;
}
.boto_grandaria:hover {
    transform: scale(1.05);
    background: #f0f0f0;
}
.boto_grandaria:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #333;
}
.boto_grandaria.seleccionat {
    background: #4ecdc4;
    color: white;
    border-color: white;
}
.pinzell_exemple {
    width: 100px;
    height: 100px;
    border-radius: 50px;
    background: #333;
    margin: 10px auto;
    border: 4px solid white;
    box-shadow: 0 5px 0 #333;
    transition: all 0.2s;
}
.accions_container {
    background: #ff9ff3;
    padding: 15px;
    border-radius: 40px;
    border: 4px solid #333;
}
.accions_controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.boto_accio {
    font-size: 3vh;
    padding: 20px;
    border-radius: 40px;
    border: 5px solid #333;
    background: white;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 8px 0 #333;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 15px;
}
.boto_accio:hover {
    transform: scale(1.02);
    background: #f0f0f0;
}
.boto_accio:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 #333;
}
.polsacio {
    animation: polsacio 0.3s ease;
}
.tornar{
    text-decoration: none;
    color: black;
    font-weight: bold;
    padding-left: 40px;
}