:root {
    /* OffKai Expo Gen 5 palette (OKE Color Palette 2026) */
    --oke-purple: #660b84;
    --oke-purple-light: #9e63c1;
    --oke-red: #cc001e;
    --oke-red-light: #ff576b;
    --oke-black: #171717;
    --oke-white: #ffffff;
    --supa-blue: #51ddf4;
    --supa-teal: #14b289;
    --supa-orange: #e57b2c;
    --supa-magenta: #af087c;
    --supa-yellow: #ffd04e;
}

html,
body {
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    font-family: Poppins, sans-serif;
}

#grid {
    width: 100dvw;
    height: 100dvh;
    display: grid;
    grid-template-rows: 40px 1fr 40px 40px;
    grid-template-columns: 40px 1fr 300px 40px;
    grid-template-areas:
        "corner toolbar toolbar toolbar"
        "sidebar window window window"
        "sidebar window window window"
        "sidebar window window window";
}

#corner-piece {
    grid-area: corner;
    background: var(--oke-black);
    border-bottom: 2px solid var(--oke-purple);
    z-index: 5;
}

#toolbar {
    grid-area: toolbar;
    display: grid;
    grid-template-rows: 1fr;
    grid-template-columns: 1fr 1fr 1fr;
    place-items: center;

    line-height: 40px;
    background: var(--oke-black);
    border-bottom: 2px solid var(--oke-purple);
    z-index: 4;
}

#toolbar-section-1 {
    grid-column: 1 / 2;
    justify-self: start;
    display: flex;
    flex-direction: row;
}

#toolbar-section-2 {
    grid-column: 2 / 3;
    justify-self: center;
    display: flex;
    flex-direction: row;
}

#toolbar-section-3 {
    grid-column: 3 / 4;
    justify-self: end;
    display: flex;
    flex-direction: row;
}

#sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    justify-content: top;
    align-items: center;

    line-height: 40px;
    background: var(--oke-black);
    border-right: 2px solid var(--oke-purple);
    z-index: 4;
}

/* Toolbar and sidebar buttons: quiet on dark chrome, purple on hover */
#toolbar .button,
#sidebar .button {
    height: 40px;
    border: none;
    border-radius: 0;
    color: var(--oke-white);
    background: transparent;
    font-family: Poppins, sans-serif;
    font-weight: 600;
    transition: background-color 150ms ease, color 150ms ease;
}

#toolbar .button:is(:hover, :focus-visible),
#sidebar .button:is(:hover, :focus-visible) {
    color: var(--oke-white);
    background: var(--oke-purple-light);
    box-shadow: none;
}

#toolbar .button:active,
#sidebar .button:active {
    background: var(--oke-purple);
}

#clear:is(:hover, :focus-visible) {
    background: var(--oke-red);
}

/* Selected pen indicator */
#sidebar .button.is-selected {
    background: var(--oke-purple);
    box-shadow: inset 3px 0 0 var(--supa-yellow);
}

/* Pen color swatches need a light chip to stay visible on dark chrome */
#sidebar .button .icon .fa-circle {
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--oke-white);
    background: var(--oke-white);
}

#background {
    grid-area: window;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--oke-black);
    background-image: url("/static/images/oke_gen5_carnival_background.png");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

#watermark {
    grid-row: 3 / 4;
    grid-column: 3 / 4;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

#watermark img {
    max-height: 40px;
    width: auto;
}

#window {
    grid-area: window;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

#canvas {
    cursor: crosshair;
    background: #ffffff;
    z-index: 3;
    box-shadow: 0 8px 32px rgb(0 0 0 / 45%);
}

/* Branded modals */
/* daisyUI (bundled in app.css via the root layout) also defines .modal with
   visibility: hidden; restore Bulma's active-modal behavior */
.modal.is-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    font-family: Poppins, sans-serif;
}

.modal-card-head {
    background: var(--oke-purple);
    border-bottom: none;
}

.modal-card-title {
    color: var(--oke-white);
    font-family: Sancreek, Poppins, serif;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.modal-card-foot {
    background: #f5f0f7;
    border-top: 1px solid var(--oke-purple-light);
}

.modal-card-foot .button {
    font-family: Poppins, sans-serif;
    font-weight: 600;
}

.modal-card-foot .button.is-success {
    border-color: var(--supa-teal);
    background: var(--supa-teal);
    color: var(--oke-white);
}

.modal-card-foot .button.is-success:is(:hover, :focus-visible) {
    background: #0f9573;
}

.modal-card-foot .button.is-info {
    border-color: var(--supa-blue);
    background: var(--supa-blue);
    color: var(--oke-black);
}

.modal-card-foot .button.is-info:is(:hover, :focus-visible) {
    background: #35c8e2;
}

#background-remove {
    border-color: var(--oke-red);
    background: var(--oke-red);
    color: var(--oke-white);
}

#background-remove:is(:hover, :focus-visible) {
    background: #a80019;
    color: var(--oke-white);
}

#background-file-drop {
    border: 2px dashed var(--oke-purple-light);
    border-radius: 8px;
    color: var(--oke-black);
    width: auto;
    height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: background-color 150ms ease;
}

#background-file-drop:hover {
    background: #f5f0f7;
}

#background-file-drop .icon {
    color: var(--oke-purple);
}

#background-upload {
    display: none;
}

/* Landing page: pink chonky-star key visual */
#landing-grid {
    width: 100dvw;
    height: 100dvh;
    display: grid;
    grid-template-rows: 2fr 1fr 20px 1fr 2fr;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas:
        ". . ."
        ". logo ."
        ". . ."
        "info info info"
        ". . .";
    background-color: var(--oke-purple);
    background-image: url("/static/images/oke_gen5_star_background.png");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

#landing-logo {
    grid-area: logo;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

#landing-logo img {
    max-width: min(80vw, 400px);
    height: auto;
    filter: drop-shadow(0 4px 16px rgb(23 23 23 / 35%));
}

#landing-info .landing-title {
    font-family: Sancreek, Poppins, serif;
    font-weight: 400;
    font-size: 1.35em;
    letter-spacing: 0.02em;
}

#landing-info {
    grid-area: info;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    font-family: Poppins, sans-serif;
    color: var(--oke-black);
    /* White glow keeps text readable if the viewport crops the star center */
    text-shadow:
        0 0 12px rgb(255 255 255 / 90%),
        0 0 28px rgb(255 255 255 / 70%);
}
