/*Reset sizing */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
/* DEFAULT VALUES & VARIABLES */
:root{
    --primary: #63f1ea;
    
    --primary-hover: color-mix(in srgb, var(--primary) 85%, black);
    --primary-alpha: color-mix(in srgb, var(--primary) 15%, transparent);
    
    /* Light theme */
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-subtle: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}
/* Dark Theme, default want hij override */
[data-theme="dark"] {
    --bg-body: #373737;
    --bg-card: #505051;
    --bg-subtle: #535455;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

body{
    background-color: var(--bg-body);
    color: var(--text-main);
}

/*NAV & COLOR SELECTION */
.top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2rem;
    padding: 0.75rem 2rem;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    height: 60px;
}
.control-group{
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    input{
        border-radius: 100%;
        width: 2.5rem;
        height: 2.5rem;
        background-color: var(--primary);
    }
    .switch {
        position: relative;
        display: inline-block;
        width: 44px;
        height: 24px;
    }

    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

    .slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--border-color);
        transition: background-color .3s ease;
    }

    .slider:before {
        position: absolute;
        content: "";
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: transform .3s ease;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }

    input:checked+.slider {
        background-color: var(--primary);
    }

    input:checked+.slider:before {
        transform: translateX(20px);
    }

    .slider.round {
        border-radius: 24px;
    }

    .slider.round:before {
        border-radius: 50%;
    }
#color-picker{
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;   
    background-color: transparent;
    border: none;
    cursor: pointer;
}
#color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}
#color-picker::-webkit-color-swatch {
    border: 2px solid var(--border-color);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, border-color 0.2s ease;
}
#color-picker::-moz-color-swatch {
    border: 2px solid var(--border-color);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, border-color 0.2s ease;
}
#color-picker:hover::-webkit-color-swatch,
#color-picker:hover::-moz-color-swatch {
    transform: scale(1.1);
    border-color: var(--primary);
}
}
/* MAIN DESIGN */
#app-container{
    display: flex;
    flex-direction: row;
    padding: 2rem;
    height: 100%;
}
.game{
    flex: 0 0 55%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    height: 560px;
    button{
        width: 100px;
        height: 100px;
        border-radius: 1.5rem;
        border-color: darkgray;
        border-width: 0.2rem;
        background-color: grey;
    }
}
.game h1 {
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

#gamestatus {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    background-color: var(--primary-alpha);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    margin-bottom: 1.5rem;
}
#grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1 / 1;
}

.row {
    display: flex;
    gap: 12px;
    flex: 1;
}

.row button,
.vakje,
[calss*="vakje"] {
    flex: 1;
    height: 100%;
    background-color: var(--bg-subtle);
    border: 2px solid var(--primary);
    border-radius: 12px;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    outline: none;
}

.row button:hover,
.vakje:hover,
[calss*="vakje"]:hover {
    border-color: var(--primary);
    background-color: var(--primary-alpha);
    transform: scale(1.02);
}
.chat{
    flex: 0 1 45%;
    margin-left: 25px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    height: 560px;
}

.chat h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    color: var(--primary);
    border-bottom: 1px solid var(--primary);
}

#messages {
    flex: 1;
    list-style: none;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding-right: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

#messages::-webkit-scrollbar {
    width: 6px;
}

#messages::-webkit-scrollbar-track {
    background: transparent;
}

#messages::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
    transition: background-color 0.2s ease;
}

#messages::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary);
}

#messages li {
    padding: 0.6rem 0.8rem;
    background-color: var(--bg-subtle);
    border-radius: 8px;
    font-size: 0.875rem;
    word-break: break-word;
    border-left: 3px solid var(--primary);
}

#form {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    flex-shrink: 0;
}

.form-row {
    display: flex;
    gap: 0.5rem;
}

#name {
    width: 28%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-subtle);
    color: var(--text-main);
    outline: none;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

#input {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-subtle);
    color: var(--text-main);
    outline: none;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

#name:focus,
#input:focus {
    border-color: var(--primary);
}

#form button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

#form button:hover {
    background-color: var(--primary-hover);
}