/* =========================================================
   CS17 RANDOM WORKSHOP
   COMPLETE STYLESHEET
   Canvas Animation Layout
   Version 7.1
   ========================================================= */


/* =========================================================
   ROOT / VARIABLES
   ========================================================= */

#cs17-random-workshop {
    --cs17-blue: #2563eb;
    --cs17-blue-dark: #1d4ed8;
    --cs17-blue-light: #eff6ff;

    --cs17-text: #172033;
    --cs17-muted: #64748b;

    --cs17-border: #dbe3ee;
    --cs17-border-dark: #cbd5e1;

    --cs17-bg: #f8fafc;
    --cs17-card: #ffffff;

    --cs17-success: #16a34a;
    --cs17-danger: #dc2626;

    width: 100%;
    max-width: 1400px;

    margin: 0 auto;
    padding: 0;

    box-sizing: border-box;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    color: var(--cs17-text);

    overflow: visible;
}

#cs17-random-workshop *,
#cs17-random-workshop *::before,
#cs17-random-workshop *::after {
    box-sizing: border-box;
}


/* =========================================================
   HEADER
   ========================================================= */

.cs17-random-header {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 20px 22px;

    margin: 0 0 12px;

    background: #ffffff;

    border: 1px solid var(--cs17-border);
    border-radius: 16px;
}

.cs17-random-title {
    min-width: 0;
}

.cs17-random-title h1 {
    margin: 0 0 5px;

    padding: 0;

    font-size: 28px;
    line-height: 1.15;

    font-weight: 800;

    color: var(--cs17-text);
}

.cs17-random-title p {
    margin: 0;
    padding: 0;

    font-size: 13px;
    line-height: 1.45;

    color: var(--cs17-muted);
}

.cs17-random-badge {
    flex: 0 0 auto;

    padding: 9px 14px;

    border-radius: 999px;

    background: var(--cs17-blue-light);

    color: var(--cs17-blue);

    font-size: 12px;
    line-height: 1;

    font-weight: 800;

    white-space: nowrap;
}


/* =========================================================
   CATEGORY NAVIGATION
   ========================================================= */

.cs17-category-bar {
    width: 100%;

    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 7px;

    padding: 7px;

    margin: 0 0 12px;

    background: #ffffff;

    border: 1px solid var(--cs17-border);
    border-radius: 14px;
}

.cs17-category-button {
    appearance: none;

    border: 0;
    outline: 0;

    background: transparent;

    color: #334155;

    padding: 10px 13px;

    border-radius: 9px;

    font-family: inherit;

    font-size: 12px;
    line-height: 1;

    font-weight: 700;

    cursor: pointer;

    white-space: nowrap;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

.cs17-category-button:hover {
    background: #f1f5f9;
}

.cs17-category-button.active {
    background: var(--cs17-blue);
    color: #ffffff;
}

.cs17-category-button:active {
    transform: translateY(1px);
}


/* =========================================================
   MAIN BODY
   ========================================================= */

.cs17-random-body {
    width: 100%;

    display: grid;

    grid-template-columns:
        230px
        minmax(0, 1fr);

    gap: 14px;

    align-items: start;
}


/* =========================================================
   LEFT TOOL MENU
   ========================================================= */

.cs17-tool-menu {
    width: 100%;

    min-width: 0;

    padding: 11px;

    background: #ffffff;

    border: 1px solid var(--cs17-border);
    border-radius: 14px;
}

.cs17-tool-menu-title {
    padding: 3px 7px 10px;

    color: #475569;

    font-size: 12px;
    line-height: 1;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.04em;
}

.cs17-tool-list {
    display: flex;
    flex-direction: column;

    gap: 7px;

    width: 100%;
}

.cs17-tool-button {
    appearance: none;

    display: flex;
    align-items: center;

    width: 100%;

    min-height: 42px;

    padding: 9px 11px;

    border: 1px solid var(--cs17-border);

    border-radius: 10px;

    background: #ffffff;

    color: var(--cs17-text);

    font-family: inherit;

    font-size: 12px;
    line-height: 1.25;

    font-weight: 700;

    text-align: left;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.cs17-tool-button:hover {
    background: #f8fafc;

    border-color: #b9c7da;
}

.cs17-tool-button.active {
    background: var(--cs17-blue-light);

    border-color: #8eb6ff;

    color: var(--cs17-blue-dark);
}

.cs17-tool-empty {
    padding: 13px;

    border: 1px solid var(--cs17-border);

    border-radius: 10px;

    background: #f8fafc;

    color: var(--cs17-muted);

    font-size: 12px;
    line-height: 1.45;
}


/* =========================================================
   WORKSPACE
   ========================================================= */

.cs17-workspace {
    width: 100%;

    min-width: 0;

    min-height: 450px;

    padding: 20px;

    background: #ffffff;

    border: 1px solid var(--cs17-border);
    border-radius: 14px;

    overflow: hidden;
}

.cs17-workspace-head {
    width: 100%;

    margin: 0 0 18px;
}

.cs17-workspace-head h2 {
    margin: 0 0 6px;

    padding: 0;

    color: var(--cs17-text);

    font-size: 23px;
    line-height: 1.2;

    font-weight: 800;
}

.cs17-workspace-head p {
    margin: 0;

    padding: 0;

    color: var(--cs17-muted);

    font-size: 12px;
    line-height: 1.5;
}


/* =========================================================
   WELCOME SCREEN
   ========================================================= */

.cs17-welcome {
    width: 100%;
}

.cs17-welcome h2 {
    margin: 0 0 5px;

    font-size: 24px;

    color: var(--cs17-text);
}

.cs17-welcome > p {
    margin: 0 0 18px;

    color: var(--cs17-muted);

    font-size: 13px;
}

.cs17-welcome-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;
}

.cs17-welcome-card {
    min-width: 0;

    padding: 16px;

    background: #ffffff;

    border: 1px solid var(--cs17-border);

    border-radius: 12px;
}

.cs17-welcome-card h3 {
    margin: 0 0 6px;

    font-size: 15px;

    color: var(--cs17-text);
}

.cs17-welcome-card p {
    margin: 0;

    color: var(--cs17-muted);

    font-size: 12px;
    line-height: 1.45;
}


/* =========================================================
   FORM CONTROLS
   ========================================================= */

.cs17-control-grid {
    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;

    margin: 0 0 14px;
}

.cs17-small-controls {
    grid-template-columns:
        minmax(220px, 420px);
}

.cs17-field {
    min-width: 0;
}

.cs17-field label {
    display: block;

    margin: 0 0 6px;

    color: #334155;

    font-size: 11px;
    line-height: 1.2;

    font-weight: 800;
}

.cs17-input,
.cs17-select,
.cs17-textarea {
    display: block;

    width: 100%;

    min-width: 0;

    border: 1px solid #cbd5e1;

    border-radius: 10px;

    background: #ffffff;

    color: var(--cs17-text);

    font-family: inherit;

    font-size: 14px;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.cs17-input,
.cs17-select {
    height: 44px;

    padding: 0 13px;
}

.cs17-textarea {
    min-height: 120px;

    padding: 12px;

    resize: vertical;
}

.cs17-input:focus,
.cs17-select:focus,
.cs17-textarea:focus {
    border-color: #7aa7ff;

    box-shadow:
        0 0 0 3px
        rgba(37, 99, 235, 0.10);
}


/* =========================================================
   CHECKBOX ROW
   ========================================================= */

.cs17-check-row {
    display: flex;
    align-items: center;

    gap: 8px;

    width: fit-content;

    margin: 5px 0 16px;

    color: #475569;

    font-size: 12px;

    cursor: pointer;
}

.cs17-check-row input {
    width: 16px;
    height: 16px;

    margin: 0;

    accent-color: var(--cs17-blue);
}


/* =========================================================
   BUTTONS
   ========================================================= */

.cs17-button {
    appearance: none;

    border: 0;

    border-radius: 10px;

    background: var(--cs17-blue);

    color: #ffffff;

    min-height: 42px;

    padding: 10px 18px;

    font-family: inherit;

    font-size: 13px;

    font-weight: 800;

    cursor: pointer;

    box-shadow:
        0 2px 4px
        rgba(15, 23, 42, 0.08);

    transition:
        background 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.cs17-button:hover {
    background: var(--cs17-blue-dark);

    box-shadow:
        0 4px 9px
        rgba(15, 23, 42, 0.12);
}

.cs17-button:active {
    transform: translateY(1px);
}

.cs17-button:disabled {
    cursor: not-allowed;

    opacity: 0.62;

    transform: none;

    box-shadow: none;
}

.cs17-button-secondary {
    background: #e2e8f0;

    color: var(--cs17-text);
}

.cs17-button-secondary:hover {
    background: #cbd5e1;
}

.cs17-button-danger {
    background: var(--cs17-danger);
}

.cs17-big-action {
    min-width: 190px;

    min-height: 48px;

    padding: 11px 24px;

    border-radius: 11px;

    font-size: 15px;
}


/* =========================================================
   TOOL ACTION AREA
   ========================================================= */

.cs17-tool-actions {
    width: 100%;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 10px;

    margin: 16px 0 0;

    clear: both;
}


/* =========================================================
   NEW CANVAS ANIMATION STAGE

   IMPORTANT:
   The DIV controls the size.
   The canvas MUST NOT control page layout.
   ========================================================= */

.cs17-canvas-stage {
    position: relative;

    display: block;

    width: 100%;

    height: 430px;

    min-height: 430px;
    max-height: 430px;

    margin: 10px 0 0;

    padding: 0;

    overflow: hidden;

    background: #bdeafa;

    border: 1px solid #cbd5e1;

    border-radius: 18px;

    box-shadow:
        0 4px 12px
        rgba(15, 23, 42, 0.09);

    contain: layout paint;
}

.cs17-game-canvas {
    position: absolute;

    display: block;

    top: 0;
    left: 0;

    width: 100% !important;
    height: 100% !important;

    max-width: none !important;
    max-height: none !important;

    min-width: 0 !important;
    min-height: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;

    vertical-align: top;

    touch-action: none;
}


/* =========================================================
   RESULT SUMMARY
   ========================================================= */

.cs17-roll-summary {
    width: 100%;

    min-height: 74px;

    margin: 13px 0 0;

    padding: 0 10px;

    text-align: center;
}

.cs17-summary-label {
    margin: 0 0 6px;

    color: var(--cs17-muted);

    font-size: 11px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.06em;
}

.cs17-summary-values {
    margin: 0 0 4px;

    color: #334155;

    font-size: 15px;

    font-weight: 700;
}

.cs17-summary-total {
    color: var(--cs17-text);

    font-size: 28px;

    line-height: 1.15;

    font-weight: 900;
}


/* =========================================================
   COIN RESULTS
   ========================================================= */

.cs17-coin-result-word {
    color: var(--cs17-text);

    font-size: 31px;

    line-height: 1.1;

    font-weight: 900;
}

.cs17-coin-counts {
    display: flex;

    justify-content: center;
    align-items: center;

    flex-wrap: wrap;

    gap: 12px;
}

.cs17-coin-counts span {
    display: flex;

    align-items: center;

    gap: 10px;

    min-width: 115px;

    padding: 10px 14px;

    border: 1px solid var(--cs17-border);

    border-radius: 10px;

    background: #f8fafc;

    color: #475569;

    font-size: 12px;

    font-weight: 700;
}

.cs17-coin-counts strong {
    margin-left: auto;

    color: var(--cs17-text);

    font-size: 18px;
}


/* =========================================================
   RANDOM NUMBER RESULT
   ========================================================= */

.cs17-number-result-panel {
    width: 100%;

    margin: 14px 0 0;

    padding: 17px;

    border: 1px solid var(--cs17-border);

    border-radius: 12px;

    background: #f8fafc;

    text-align: center;
}

.cs17-number-bubbles {
    display: flex;

    align-items: center;
    justify-content: center;

    flex-wrap: wrap;

    gap: 8px;
}

.cs17-number-bubble {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 48px;
    min-height: 48px;

    padding: 7px 11px;

    border-radius: 12px;

    background: #ffffff;

    border: 1px solid #bfdbfe;

    color: var(--cs17-blue-dark);

    font-size: 18px;

    font-weight: 900;

    box-shadow:
        0 2px 4px
        rgba(15, 23, 42, 0.05);
}


/* =========================================================
   ERRORS / MESSAGES
   ========================================================= */

.cs17-inline-error {
    width: 100%;

    margin: 10px 0 0;

    color: var(--cs17-danger);

    font-size: 12px;

    font-weight: 700;

    text-align: center;
}

.cs17-message {
    width: 100%;

    padding: 14px;

    border: 1px solid var(--cs17-border);

    border-radius: 10px;

    background: #f8fafc;

    color: var(--cs17-muted);

    font-size: 12px;
}

.cs17-message.error {
    border-color: #fecaca;

    background: #fef2f2;

    color: #b91c1c;
}


/* =========================================================
   REMOVE / NEUTRALISE OLD GRAPHIC RULES

   These selectors prevent any old dice/coin animation
   CSS from influencing the new Canvas engine.
   ========================================================= */

#cs17-random-workshop .cs17-dice-scene,
#cs17-random-workshop .cs17-coin-scene,
#cs17-random-workshop .cs17-dice-stage,
#cs17-random-workshop .cs17-coin-stage,
#cs17-random-workshop .dice-stage,
#cs17-random-workshop .coin-stage,
#cs17-random-workshop .dice-scene,
#cs17-random-workshop .coin-scene {
    display: none !important;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1000px) {

    .cs17-random-body {
        grid-template-columns:
            190px
            minmax(0, 1fr);
    }

    .cs17-workspace {
        padding: 16px;
    }

    .cs17-canvas-stage {
        height: 390px;

        min-height: 390px;
        max-height: 390px;
    }

}


/* =========================================================
   MOBILE / SMALL TABLET
   ========================================================= */

@media (max-width: 760px) {

    #cs17-random-workshop {
        width: 100%;
    }

    .cs17-random-header {
        padding: 15px;

        border-radius: 12px;
    }

    .cs17-random-title h1 {
        font-size: 22px;
    }

    .cs17-random-badge {
        display: none;
    }


    /* CATEGORY BAR */

    .cs17-category-bar {
        flex-wrap: nowrap;

        overflow-x: auto;

        overflow-y: hidden;

        padding: 6px;

        scrollbar-width: thin;
    }

    .cs17-category-button {
        flex: 0 0 auto;
    }


    /* MAIN LAYOUT */

    .cs17-random-body {
        display: block;
    }


    /* TOOL MENU */

    .cs17-tool-menu {
        margin: 0 0 12px;

        padding: 8px;
    }

    .cs17-tool-menu-title {
        padding-bottom: 7px;
    }

    .cs17-tool-list {
        flex-direction: row;

        overflow-x: auto;

        overflow-y: hidden;

        padding-bottom: 2px;

        scrollbar-width: thin;
    }

    .cs17-tool-button {
        flex: 0 0 auto;

        width: auto;

        min-width: 135px;
    }


    /* WORKSPACE */

    .cs17-workspace {
        min-height: 0;

        padding: 14px;

        border-radius: 12px;
    }

    .cs17-workspace-head h2 {
        font-size: 20px;
    }


    /* FORMS */

    .cs17-control-grid,
    .cs17-small-controls {
        grid-template-columns: 1fr;
    }


    /* WELCOME */

    .cs17-welcome-grid {
        grid-template-columns: 1fr;
    }


    /* CANVAS */

    .cs17-canvas-stage {
        height: 350px;

        min-height: 350px;
        max-height: 350px;

        border-radius: 14px;
    }


    /* BUTTON */

    .cs17-big-action {
        width: 100%;

        max-width: 300px;
    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .cs17-random-header {
        margin-bottom: 8px;
    }

    .cs17-random-title h1 {
        font-size: 20px;
    }

    .cs17-random-title p {
        font-size: 11px;
    }

    .cs17-category-bar {
        margin-bottom: 8px;
    }

    .cs17-workspace {
        padding: 10px;
    }

    .cs17-workspace-head {
        margin-bottom: 13px;
    }

    .cs17-canvas-stage {
        height: 300px;

        min-height: 300px;
        max-height: 300px;

        margin-top: 7px;

        border-radius: 12px;
    }

    .cs17-tool-actions {
        margin-top: 12px;
    }

    .cs17-summary-total {
        font-size: 24px;
    }

}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 360px) {

    .cs17-canvas-stage {
        height: 270px;

        min-height: 270px;
        max-height: 270px;
    }

}