/* =========================
   Base layout
   ========================= */
html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    font-family: "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
    background: #f2dede;
}

body {
    display: flex;
    flex-direction: column;
}

body.game-not-started .top-control-bar,
body.game-not-started .main-layout {
    filter: blur(7px);
}

/* =========================
   Start screen
   ========================= */
#startScreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    background:
        radial-gradient(circle at top, rgba(255,255,255,0.45), transparent 35%),
        linear-gradient(135deg, rgba(90, 120, 150, 0.88), rgba(240, 210, 225, 0.92));
    backdrop-filter: blur(26px) saturate(160%);
    -webkit-backdrop-filter: blur(26px) saturate(160%);
}

#startScreen.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
}

.start-card {
    width: 520px;
    max-width: 90vw;
    padding: 42px 48px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    text-align: center;
    color: #1f1f1f;
}

.start-logo {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 22px;
    margin-bottom: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.22);
}

.start-card h1 {
    margin: 0 0 14px 0;
    font-size: 42px;
    letter-spacing: -0.7px;
}

.start-card p {
    margin: 0 0 28px 0;
    font-size: 20px;
    line-height: 1.55;
    font-weight: 500;
    color: rgba(30, 30, 30, 0.82);
}

#ButtonStartGame {
    min-width: 190px;
    height: 56px;
    background: rgba(255, 34, 126, 0.68);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 18px;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    box-shadow: 0 12px 30px rgba(255, 34, 126, 0.25);
}

#ButtonStartGame:hover {
    transform: translateY(-1px);
    background: rgba(255, 34, 126, 0.82);
}

/* =========================
   Top bar
   ========================= */
.top-control-bar {
    flex: 0 0 92px;
    height: 92px;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    background: #ffffff;
    border-bottom: 1px solid #ddd;
    overflow-x: auto;
    overflow-y: hidden;
}

.top-buttons {
    height: 90px;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 8px 12px;
    box-sizing: border-box;

    background: #ffffff;
    border-bottom: 1px solid #ddd;

    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
}

.top-buttons .control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    white-space: nowrap;
    color: #333;
}

.top-buttons .control-row label,
.top-buttons .control-row span {
    font-size: 13px;
}

.top-buttons .control-row input[type="range"] {
    width: 120px;
}

/* =========================
   Main area
   ========================= */
.main-layout {
    display: flex;
    gap: 12px;

    width: 100vw;
    height: calc(100vh - 90px);

    padding: 12px;
    box-sizing: border-box;

    overflow: hidden;
}

.controls-panel {
    width: 300px;
    min-width: 300px;
    max-width: 300px;

    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;

    background: white;
    border-radius: 12px;
    padding: 16px;
    box-sizing: border-box;

    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.canvas-container {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 100%;

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

    overflow: hidden;
    background: #eaeaea;
}

#gl-canvas {
    width: 100%;
    max-width: 100%;

    aspect-ratio: 16 / 9;
    height: auto;

    max-height: 100%;

    display: block;
    border: 1px solid #ccc;
    background: #eaeaea;

    cursor: grab;
    user-select: none;
}

.fps-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.45);
    color: white;
    font-size: 20px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: none;
}

/* =========================
   Panel controls
   ========================= */
.control-group {
    margin-bottom: 22px;
}

.control-group h3 {
    margin: 0 0 12px 0;
    font-size: 17px;
    font-weight: 700;
    color: #222;
    border-bottom: 1px solid #ddd;
    padding-bottom: 6px;
    letter-spacing: 0.2px;
}

/* .control-row {
    display: grid;
    grid-template-columns: 115px 120px 45px;
    align-items: center;
    column-gap: 10px;
    margin-bottom: 12px;
    color: #555;
}

.control-row label {
    font-size: 13px;
    line-height: 1.1;
    white-space: nowrap;
}

.control-row input[type="range"] {
    width: 120px;
}

.control-row span {
    font-size: 13px;
    text-align: right;
} */
.control-row {
    display: grid;
    grid-template-columns: 118px minmax(60px, 1fr) 48px;
    align-items: center;
    column-gap: 6px;
    margin-bottom: 15px;
    color: #555;
}

.control-row input[type="range"] {
    width: 100%;
    min-width: 0;
}

.control-row label {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    color: #111;
}

.control-row span {
    font-size: 16px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
    min-width: 46px;
    color: #111;
}


.collapsible-panel {
    margin-bottom: 18px;
}

.collapsible-panel summary,
.debug-panel summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    color: rgba(30, 30, 30, 0.88);
    margin-bottom: 12px;
}

/* =========================
   Generic buttons
   ========================= */
button {
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease;
}

button:hover {
    filter: brightness(1.12);
}

button:active {
    transform: scale(0.96);
}

/* Button colors */
#ButtonTex { background-color: #4CAF50; }
#ButtonX, #ButtonY, #ButtonZ { background-color: #4FC3F7; }
#ButtonT, #ButtonFocusCurtain, #ButtonMiniGame, #ButtonFocusDog { background-color: #E91E63; }
#ButtonTableRotation { background-color: #ff8c00; }
#ButtonCatMove { background-color: #8E44AD; }
#ButtonDogMove, #ButtonPetDogMode { background-color: #6D4C41; }
#ButtonTeapotFocus { background-color: #3F51B5; }
#ButtonLightDir, #ButtonResetCamera { background-color: #0097A7; }
#ButtonBounceBall { background-color: #9C27B0; }
#ButtonGoOut { background-color: #FF5722; }
#ButtonGoHome { background-color: #607D8B; }
#ButtonCollision { background-color: #795548; }
#ButtonCallDogMode { background-color: #fe4305; }

/* =========================
   Icon buttons
   ========================= */
#ButtonMusic,
#ButtonGlobalAudio,
#ButtonNightDay {
    width: 70px;
    height: 70px;
    min-width: 70px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

#ButtonMusic:hover,
#ButtonGlobalAudio:hover,
#ButtonNightDay:hover {
    background: #ffffff;
    transform: scale(1.06);
    filter: none;
}

#ButtonMusic img,
#ButtonGlobalAudio img,
#ButtonNightDay img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    pointer-events: none;
}

#ButtonMusic.music-on {
    background: rgba(255, 255, 255, 0.35);
}

/* =========================
   Smaller screens
   ========================= */
/* @media (max-width: 900px) {
    .controls-panel {
        flex-basis: 280px;
        width: 280px;
    }

    .control-row {
        grid-template-columns: 95px 100px 40px;
    }

    .control-row input[type="range"] {
        width: 100px;
    }
} */

@media (max-width: 900px) {
    .controls-panel {
        width: 280px;
        min-width: 280px;
        max-width: 280px;
    }

    .control-row {
        grid-template-columns: 110px minmax(58px, 1fr) 48px;
        column-gap: 6px;
    }

    .control-row input[type="range"] {
        width: 100%;
    }

    .control-row label {
        font-size: 15px;
    }

    .control-row span {
        font-size: 15px;
    }
}

#ButtonAutoSun {
    width: 70px;
    height: 70px;

    background-color: #ffffff;
    padding: 0;

    border: none;
    border-radius: 10px;

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

    cursor: pointer;

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

#ButtonAutoSun:hover {
    background-color: #fff3c4;
    transform: scale(1.06);
}

#ButtonAutoSun:active {
    transform: scale(0.95);
}

#ButtonAutoSun img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    pointer-events: none;
}

#ButtonAutoSun.auto-sun-on {
    background-color: #ffe08a;
    box-shadow:
        0 0 12px rgba(255, 200, 60, 0.75),
        0 2px 5px rgba(0, 0, 0, 0.25);
}

#loadingScreen {
    position: fixed;
    inset: 0;
    z-index: 10000;

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

    background:
        radial-gradient(circle at top, rgba(255,255,255,0.55), transparent 35%),
        linear-gradient(135deg, rgba(90, 120, 150, 0.92), rgba(240, 210, 225, 0.95));

    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
}

#loadingScreen.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
}

.loading-card {
    width: 520px;
    max-width: 90vw;

    padding: 42px 48px;
    border-radius: 26px;

    background: rgba(255, 255, 255, 0.30);
    border: 1px solid rgba(255, 255, 255, 0.45);

    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);

    text-align: center;
    color: #1f1f1f;
}

.loading-logo {
    width: 82px;
    height: 82px;
    object-fit: cover;
    border-radius: 22px;
    margin-bottom: 18px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.22);
}

.loading-card h1 {
    margin: 0 0 22px 0;
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.loading-card p {
    margin: 22px 0 0 0;
    font-size: 19px;
    line-height: 1.45;
    font-weight: 500;
    color: rgba(30, 30, 30, 0.82);
}

.loading-bar {
    width: 100%;
    height: 18px;

    border-radius: 999px;
    overflow: hidden;

    background: rgba(255, 255, 255, 0.45);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.18);
}



.start-card h1,
.loading-card h1 {
    margin: 0 0 18px 0 !important;
    font-family: "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif !important;
    font-size: 38px !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    letter-spacing: -0.6px !important;
    color: #90027d !important;
}
.start-card p,
.loading-card p {
    font-family: "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif !important;
    font-size: 23px !important;
    line-height: 1.55 !important;
    font-weight: 600 !important;
    max-width: 560px;
    margin: 18px auto 32px auto !important;
    color: rgba(30, 30, 30, 0.82) !important;
}

@keyframes loadingFill {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}


.water-button {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(248, 243, 243, 0.45);
    cursor: pointer;

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

    padding: 6px;
    backdrop-filter: blur(4px);
}

.water-button img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.water-button:hover {
    background: rgba(179, 209, 238, 0.65);
    transform: scale(1.05);
}

.water-button.active {
    background: rgba(208, 241, 241, 0.75);
}

/* =========================
   Music volume slider
   ========================= */

.music-volume-control {
    height: 54px;
    min-width: 250px;

    padding: 0 14px;
    border-radius: 18px;

    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(180, 180, 220, 0.35);

    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.music-volume-control label {
    font-size: 17px !important;
    font-weight: 800 !important;
    color: #0f0fea !important;
}

.music-volume-control span {
    font-size: 16px !important;
    font-weight: 800 !important;
    color: #0f0fea !important;
    min-width: 42px;
}

/* slider base */
#MusicVolume {
    --music-progress: 10%;

    -webkit-appearance: none;
    appearance: none;

    width: 140px;
    height: 10px;

    border-radius: 999px;
    outline: none;
    cursor: pointer;

    background:
        linear-gradient(
            90deg,
            #8d8cff 0%,
            #ff5fa2 var(--music-progress),
            rgba(205, 208, 225, 0.75) var(--music-progress),
            rgba(205, 208, 225, 0.75) 100%
        );

    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.18),
        0 1px 0 rgba(255, 255, 255, 0.75);
}

/* thumb Chrome / Edge / Safari */
#MusicVolume::-webkit-slider-thumb {
    -webkit-appearance: none;

    width: 13px !important;
    height: 13px !important;

    border-radius: 50%;

    background: #ffffff;
    border: 3px solid #ff5fa2;

    box-shadow:
        0 3px 8px rgba(255, 95, 162, 0.38),
        0 1px 2px rgba(0, 0, 0, 0.22);

    cursor: pointer;
}

#MusicVolume::-webkit-slider-thumb:hover {
    transform: scale(1.12);
    box-shadow:
        0 6px 16px rgba(255, 95, 162, 0.55),
        0 1px 4px rgba(0, 0, 0, 0.28);
}

/* thumb Firefox */
#MusicVolume::-moz-range-thumb {
    width: 13px !important;
    height: 13px !important;

    border-radius: 50%;

    background: #ffffff;
    border: 3px solid #ff5fa2;

    box-shadow:
        0 3px 8px rgba(255, 95, 162, 0.38),
        0 1px 2px rgba(0, 0, 0, 0.22);

    cursor: pointer;
}

#MusicVolume::-moz-range-track {
    height: 10px;
    border-radius: 999px;
    background: transparent;
}


.disabled-button {
    opacity: 0.45;
    cursor: not-allowed !important;
    filter: grayscale(0.6);
}

.disabled-button:hover {
    transform: none !important;
    filter: grayscale(0.6);
}



/* =========================
   Ball icon button
   ========================= */

#ButtonMiniGame.minigame-icon-button {
    width: 70px;
    height: 70px;
    min-width: 70px;

    padding: 6px;
    box-sizing: border-box;

    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.45);

    background: rgba(248, 243, 243, 0.45);

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

    overflow: hidden;
}

#ButtonMiniGame.minigame-icon-button img {
    width: 100%;
    height: 100%;

    max-width: 56px;
    max-height: 56px;

    object-fit: contain;
    pointer-events: none;
}

#ButtonMiniGame.minigame-icon-button:hover {
    background: rgba(255, 150, 209, 0.75);
    transform: scale(1.05);
}

#ButtonMiniGame.minigame-icon-button.active {
    background: rgba(224, 74, 177, 0.75);

    box-shadow:
        0 0 12px rgba(160, 230, 230, 0.70),
        0 2px 5px rgba(0, 0, 0, 0.25);
}


/**********************************************************/
/*      TRANSITION SCREEN STYLES                            */
/*************************************************************/
/* =========================
   Scene transition screen
   ========================= */

.scene-transition-screen {
    position: fixed;
    inset: 0;
    z-index: 9998;

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

    opacity: 0;
    pointer-events: none;

    background:
        radial-gradient(circle at top, rgba(255,255,255,0.45), transparent 36%),
        linear-gradient(135deg, rgba(90, 120, 150, 0.86), rgba(240, 210, 225, 0.92));

    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);

    transition: opacity 0.35s ease;
}

.scene-transition-screen.active {
    opacity: 1;
    pointer-events: auto;
}

.scene-transition-card {
    min-width: 300px;
    padding: 30px 38px;

    border-radius: 26px;

    background: rgba(255, 255, 255, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.48);

    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);

    text-align: center;
    color: #1f1f1f;
}

.scene-transition-icon {
    font-size: 44px;
    margin-bottom: 12px;

    animation: pawBounce 0.75s ease-in-out infinite;
}

.scene-transition-card h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
}

.scene-transition-card p {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: rgba(30, 30, 30, 0.72);
}

@keyframes pawBounce {
    0% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-8px) scale(1.08);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

.frisbee-icon-button {
    width: 70px;
    height: 70px;
    background: rgba(248, 243, 243, 0.45);
}

.frisbee-icon-button:hover {
    background: rgba(255, 220, 150, 0.75);
    transform: scale(1.05);
}

.frisbee-icon-button.active {
    background: rgba(208, 241, 241, 0.75);

    box-shadow:
        0 0 12px rgba(160, 230, 230, 0.70),
        0 2px 5px rgba(0, 0, 0, 0.25);
}

.frisbee-icon-button img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    pointer-events: none;
}

/* =========================================================
    Side panel toggle button
   ========================================================= */

:root {
    --top-bar-height: 90px;
    --main-layout-padding: 0px;
    --side-panel-width: 320px;
    --side-toggle-width: 34px;
}

/* Freccia attaccata al bordo destro del pannello */
.toggle-side-panel-button {
    position: fixed;

    top: calc(var(--top-bar-height) + (100vh - var(--top-bar-height)) / 2);
    left: calc(var(--main-layout-padding) + var(--side-panel-width));

    transform: translateY(-50%);

    z-index: 20000;

    width: var(--side-toggle-width);
    height: 74px;

    padding: 0;
    border: none;
    border-radius: 0 14px 14px 0;

    background: rgba(240, 219, 219, 0.82);
    color: rgb(200, 50, 50);

    font-size: 40px;
    font-weight: 800;
    line-height: 1;

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

    cursor: pointer;
    pointer-events: auto;
    user-select: none;
    touch-action: manipulation;

    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.22);

    transition:
        left 0.25s ease,
        background 0.15s ease,
        transform 0.12s ease;
}

.toggle-side-panel-button:hover {
    background: rgba(246, 246, 246, 0.92);
}

.toggle-side-panel-button:active {
    transform: translateY(-50%) scale(0.96);
}

/* Nella schermata iniziale non si vede */
body.game-not-started .toggle-side-panel-button {
    display: none;
}

/* Quando il pannello è nascosto, la linguetta resta sul bordo sinistro */
body.ui-panel-hidden .toggle-side-panel-button {
    left: 0;
    border-radius: 0 14px 14px 0;
}

/* Nasconde il pannello laterale */
body.ui-panel-hidden .controls-panel {
    display: none !important;
}

/* Il canvas si prende tutto lo spazio */
body.ui-panel-hidden .canvas-container {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
}



/************************/

.camera-focus-active {
    background: rgba(255, 210, 80, 0.95) !important;
    color: #2b1b00 !important;
    font-weight: 700;
    box-shadow: 0 0 12px rgba(255, 210, 80, 0.65);
    transform: translateY(-1px);
}

/****************************/

#ButtonDogCameraMode {
    display: none;

    margin-top: 8px;
    width: 100%;

    padding: 11px 14px;
    border: none;
    border-radius: 14px;

    background: linear-gradient(
        135deg,
        rgba(255, 95, 162, 0.92),
        rgba(255, 200, 87, 0.88)
    );

    color: white;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.2px;

    cursor: pointer;

    box-shadow:
        0 6px 16px rgba(255, 95, 162, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);

    transition:
        transform 0.12s ease,
        filter 0.12s ease,
        box-shadow 0.12s ease;
}

#ButtonDogCameraMode:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow:
        0 8px 20px rgba(255, 95, 162, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

#ButtonDogCameraMode:active {
    transform: scale(0.97);
}

.teapot-icon-button img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.teapot-icon-button.active {
    background: rgba(255, 210, 80, 0.95) !important;
    box-shadow: 0 0 14px rgba(255, 210, 80, 0.75);
    transform: translateY(-1px);
}


/* MESSAGE FOR MOBILE USERS */
.device-warning {
    margin: 18px auto 0 auto;
    padding-top: 14px;
    max-width: 420px;

    border-top: 1px solid rgba(255, 255, 255, 0.45);

    font-size: 13px;
    line-height: 1.35;
    font-weight: 500;
    text-align: center;

    color: rgba(55, 55, 65, 0.72);

    background: transparent;
    box-shadow: none;
}

/* Hidden some buttons while developing */
#ButtonCatMove,
#ButtonBounceBall {
    display: none !important;
}


/******** TEAPOT LEGEND **************/
.teapot-controls-legend {
    position: absolute;
    top: 56px;
    left: 12px;
    z-index: 6;

    min-width: 280px;

    padding: 12px 14px;
    border-radius: 12px;

    background: rgba(0, 0, 0, 0.52);
    color: white;

    font-size: 20px;
    line-height: 1.55;
    font-weight: 500;

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    pointer-events: none;

    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
}

.teapot-controls-legend.hidden {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}

.teapot-controls-legend .legend-title {
    font-size: 25px;
    font-weight: 800;
    margin-bottom: 6px;
}

.teapot-controls-legend.attention {
    animation: teapotLegendAttention 1.8s ease-out;
}

@keyframes teapotLegendAttention {
    0% {
        transform: translateY(-8px) scale(0.92);
        box-shadow: 0 0 0 rgba(255, 180, 80, 0.0);
        background: rgba(40, 20, 5, 0.78);
    }

    25% {
        transform: translateY(0) scale(1.06);
        box-shadow: 0 0 22px rgba(255, 190, 80, 0.85);
        background: rgba(70, 38, 8, 0.82);
    }

    55% {
        transform: translateY(0) scale(1.0);
        box-shadow: 0 0 14px rgba(255, 190, 80, 0.55);
    }

    100% {
        transform: translateY(0) scale(1.0);
        box-shadow: none;
        background: rgba(0, 0, 0, 0.52);
    }
}
/*****************************************/
/** BALL SETTINGS PANEL **/
/***********************************/
.canvas-container {
    position: relative;
}

.ball-settings-hud {
    display: none;

    position: absolute;
    top: 56px;
    left: 12px;
    z-index: 20;

    width: 265px;

    padding: 12px 13px;
    border-radius: 14px;

    background: rgba(0, 0, 0, 0.58);
    color: white;

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);

    pointer-events: auto;
}

.ball-settings-hud.attention {
    animation: ballSettingsAttention 1.4s ease-out;
}


.ball-settings-title {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 8px;
}

.ball-setting-row {
    display: grid;
    grid-template-columns: 62px 1fr 42px;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}

.ball-setting-row span {
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.ball-setting-row b {
    font-size: 12px;
    text-align: right;
    color: white;
}

.ball-setting-row input[type="range"] {
    width: 100%;
}

@keyframes ballSettingsAttention {
    0% {
        transform: translateY(-8px) scale(0.92);
        box-shadow: 0 0 0 rgba(80, 190, 255, 0.0);
        background: rgba(5, 25, 45, 0.78);
    }

    30% {
        transform: translateY(0) scale(1.04);
        box-shadow: 0 0 22px rgba(80, 190, 255, 0.85);
        background: rgba(8, 45, 75, 0.82);
    }

    100% {
        transform: translateY(0) scale(1.0);
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
        background: rgba(0, 0, 0, 0.58);
    }
}

/**************** X to close Balll settings panel ******************/
.ball-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 8px;
}

.ball-settings-title {
    font-size: 15px;
    font-weight: 800;
}

.ball-settings-close-button {
    width: 24px;
    height: 24px;

    border: none;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.18);
    color: white;

    font-size: 18px;
    font-weight: 800;
    line-height: 1;

    cursor: pointer;
    pointer-events: auto;

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

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

.ball-settings-close-button:hover {
    background: rgba(255, 80, 80, 0.85);
}

.ball-settings-close-button:active {
    transform: scale(0.92);
}



/* =========================
   Compact desktop layout fix
   ========================= */

.top-control-bar {
    flex: 0 0 76px;
    height: 76px;
    padding: 6px 10px;
}

.top-buttons {
    height: 64px;
    padding: 4px 8px;
    gap: 8px;
    border-bottom: none;
}

.main-layout {
    height: calc(100vh - 76px);
    padding: 8px;
    gap: 8px;
}

.controls-panel {
    width: 270px;
    min-width: 270px;
    max-width: 270px;

    padding: 14px;
}

.control-group {
    margin-bottom: 16px;
}

.control-group h3 {
    font-size: 15px;
    margin-bottom: 9px;
}

.control-row {
    grid-template-columns: 104px minmax(55px, 1fr) 42px;
    column-gap: 6px;
    margin-bottom: 11px;
}

.control-row label {
    font-size: 14px;
}

.control-row span {
    font-size: 14px;
    min-width: 38px;
}

button {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 9px;
}

/* Icon buttons compatti */
#ButtonMusic,
#ButtonGlobalAudio,
#ButtonNightDay,
#ButtonAutoSun,
.water-button {
    width: 58px;
    height: 58px;
    min-width: 58px;
    padding: 4px;
}

#ButtonMusic img,
#ButtonGlobalAudio img,
#ButtonNightDay img,
#ButtonAutoSun img,
.water-button img {
    width: 48px;
    height: 48px;
}

/* Volume più compatto */
.music-volume-control {
    height: 46px;
    min-width: 220px;
    padding: 0 12px;
}

.music-volume-control label {
    font-size: 15px !important;
}

.music-volume-control span {
    font-size: 14px !important;
}

#MusicVolume {
    width: 120px;
}

/* Canvas più stabile dentro lo spazio disponibile */
.canvas-container {
    min-height: 0;
}




/* =========================
   Extra compact layout
   ========================= */

.top-control-bar {
    flex: 0 0 66px;
    height: 66px;
    padding: 5px 8px;
}

.top-buttons {
    height: 56px;
    padding: 3px 6px;
    gap: 7px;
}

.main-layout {
    height: calc(100vh - 66px);
    padding: 6px;
    gap: 7px;
}

.controls-panel {
    width: 250px;
    min-width: 250px;
    max-width: 250px;

    padding: 12px;
    border-radius: 10px;
}

.control-group {
    margin-bottom: 13px;
}

.control-group h3 {
    font-size: 14px;
    margin-bottom: 7px;
    padding-bottom: 5px;
}

.control-row {
    grid-template-columns: 94px minmax(48px, 1fr) 38px;
    column-gap: 5px;
    margin-bottom: 9px;
}

.control-row label {
    font-size: 13px;
}

.control-row span {
    font-size: 13px;
    min-width: 34px;
}

button {
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 8px;
}

/* Icone top bar e minigame più piccole */
#ButtonMusic,
#ButtonGlobalAudio,
#ButtonNightDay,
#ButtonAutoSun,
.water-button {
    width: 50px;
    height: 50px;
    min-width: 50px;
    padding: 3px;
}

#ButtonMusic img,
#ButtonGlobalAudio img,
#ButtonNightDay img,
#ButtonAutoSun img,
.water-button img {
    width: 42px;
    height: 42px;
}

/* Volume ancora più compatto */
.music-volume-control {
    height: 40px;
    min-width: 200px;
    padding: 0 10px;
}

.music-volume-control label {
    font-size: 14px !important;
}

.music-volume-control span {
    font-size: 13px !important;
}

#MusicVolume {
    width: 105px;
}

/* FPS meno gigante */
.fps-overlay {
    font-size: 16px;
    padding: 5px 8px;
    border-radius: 8px;
}

/* Pannelli HUD leggermente più piccoli */
.teapot-controls-legend {
    top: 46px;
    left: 10px;
    min-width: 200px;
    font-size: 12px;
    padding: 10px 12px;
}

.teapot-controls-legend .legend-title {
    font-size: 13px;
}

.ball-settings-hud {
    top: 46px;
    left: 10px;
    width: 245px;
    padding: 10px 11px;
}

.ball-settings-title {
    font-size: 13px;
}

.ball-setting-row {
    grid-template-columns: 56px 1fr 38px;
    gap: 6px;
    margin: 5px 0;
}

.ball-setting-row span,
.ball-setting-row b {
    font-size: 11px;
}

.ball-settings-close-button {
    width: 21px;
    height: 21px;
    font-size: 16px;
}


/* =========================
   Compact UI only - keep canvas 16:9
   ========================= */

:root {
    --topbar-height: 62px;
    --side-panel-width: 250px;
}

.top-control-bar {
    flex: 0 0 var(--topbar-height) !important;
    height: var(--topbar-height) !important;
    min-height: var(--topbar-height) !important;
    padding: 5px 8px !important;
}

.top-buttons {
    height: 52px !important;
    padding: 3px 6px !important;
    gap: 7px !important;
    border-bottom: none !important;
}

.main-layout {
    height: calc(100vh - var(--topbar-height)) !important;
    padding: 6px !important;
    gap: 6px !important;
}

.controls-panel {
    width: var(--side-panel-width) !important;
    min-width: var(--side-panel-width) !important;
    max-width: var(--side-panel-width) !important;

    padding: 12px !important;
    border-radius: 10px !important;
}

.control-group {
    margin-bottom: 12px !important;
}

.control-group h3 {
    font-size: 14px !important;
    margin-bottom: 7px !important;
    padding-bottom: 5px !important;
}

.control-row {
    grid-template-columns: 90px minmax(48px, 1fr) 36px !important;
    column-gap: 5px !important;
    margin-bottom: 8px !important;
}

.control-row label {
    font-size: 12px !important;
}

.control-row span {
    font-size: 12px !important;
    min-width: 32px !important;
}

button {
    padding: 7px 10px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
}

#ButtonMusic,
#ButtonGlobalAudio,
#ButtonNightDay,
#ButtonAutoSun,
.water-button {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    padding: 3px !important;
}

#ButtonMusic img,
#ButtonGlobalAudio img,
#ButtonNightDay img,
#ButtonAutoSun img,
.water-button img,
.teapot-icon-button img {
    width: 40px !important;
    height: 40px !important;
}

.music-volume-control {
    height: 38px !important;
    min-width: 190px !important;
    padding: 0 10px !important;
}

.music-volume-control label {
    font-size: 13px !important;
}

.music-volume-control span {
    font-size: 12px !important;
}

#MusicVolume {
    width: 100px !important;
}

.fps-overlay {
    font-size: 15px !important;
    padding: 5px 8px !important;
    border-radius: 8px !important;
}


/* =========================
   Side panel compact fix
   Keep canvas 16:9
   ========================= */

:root {
    --side-panel-width: 230px;
}

/* Pannello sinistro un po' più piccolo */
.controls-panel {
    width: var(--side-panel-width) !important;
    min-width: var(--side-panel-width) !important;
    max-width: var(--side-panel-width) !important;

    padding: 10px !important;
}

/* Testi del pannello leggermente più compatti */
.control-group {
    margin-bottom: 11px !important;
}

.control-group h3 {
    font-size: 13px !important;
    margin-bottom: 6px !important;
    padding-bottom: 4px !important;
}

.control-row {
    grid-template-columns: 78px minmax(44px, 1fr) 34px !important;
    column-gap: 5px !important;
    margin-bottom: 7px !important;
}

.control-row label {
    font-size: 12px !important;
}

.control-row span {
    font-size: 12px !important;
    min-width: 30px !important;
}

/* Bottoni nel pannello un po' più piccoli */
.controls-panel button {
    padding: 6px 9px !important;
    font-size: 12px !important;
}

/* Icone minigame/notte nel pannello sinistro più piccole */
.controls-panel .water-button,
.controls-panel .night-day-icon-button,
.controls-panel .auto-sun-button {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    padding: 3px !important;
}

.controls-panel .water-button img,
.controls-panel .night-day-icon-button img,
.controls-panel .auto-sun-button img {
    width: 36px !important;
    height: 36px !important;
}

/* Freccia: NON farla diventare minuscola */
.toggle-side-panel-button {
    width: 36px !important;
    height: 76px !important;

    left: var(--side-panel-width) !important;

    font-size: 38px !important;
    line-height: 1 !important;

    padding: 0 !important;
    border-radius: 0 14px 14px 0 !important;
}

/* Quando il menu è chiuso, resta sul bordo sinistro */
body.ui-panel-hidden .toggle-side-panel-button {
    left: 0 !important;
}


/* =========================
   Smaller side panel final tuning
   ========================= */

:root {
    --side-panel-width: 215px;
}

/* Barra laterale ancora più stretta */
.controls-panel {
    width: var(--side-panel-width) !important;
    min-width: var(--side-panel-width) !important;
    max-width: var(--side-panel-width) !important;

    padding: 9px !important;
}

/* Titoli più piccoli */
.control-group h3 {
    font-size: 12px !important;
    margin-bottom: 5px !important;
    padding-bottom: 4px !important;
}

/* Righe normali degli slider */
.control-row {
    grid-template-columns: 72px minmax(42px, 1fr) 30px !important;
    column-gap: 4px !important;
    margin-bottom: 6px !important;
}

.control-row label {
    font-size: 11px !important;
    font-weight: 600 !important;
}

.control-row span {
    font-size: 11px !important;
    font-weight: 700 !important;
    min-width: 28px !important;
}

/* Bottoni nel menu più piccoli */
.controls-panel button {
    padding: 6px 8px !important;
    font-size: 11px !important;
    border-radius: 8px !important;
}

/* Fix specifico per Wind, perché non è dentro .control-row */
#CurtainSettingsPanel label {
    font-size: 11px !important;
    font-weight: 600 !important;
}

#CurtainSettingsPanel input[type="range"] {
    width: 110px !important;
}

#CurtainSettingsPanel span {
    font-size: 11px !important;
    font-weight: 700 !important;
}

/* Freccia laterale: resta grande e allineata al nuovo pannello */
.toggle-side-panel-button {
    left: var(--side-panel-width) !important;

    width: 36px !important;
    height: 76px !important;

    font-size: 38px !important;
    line-height: 1 !important;
    padding: 0 !important;
}

body.ui-panel-hidden .toggle-side-panel-button {
    left: 0 !important;
}


/* =========================
   Slimmer sliders
   ========================= */

.controls-panel input[type="range"] {
    -webkit-appearance: none;
    appearance: none;

    height: 16px;
    background: transparent;
    cursor: pointer;
}

/* Track */
.controls-panel input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    background: #d8d8d8;
    border: 1px solid #b9b9b9;
    border-radius: 999px;
}

.controls-panel input[type="range"]::-moz-range-track {
    height: 6px;
    background: #d8d8d8;
    border: 1px solid #b9b9b9;
    border-radius: 999px;
}

/* Thumb */
.controls-panel input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;

    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #1f78ea;
    border: none;

    margin-top: -5px; /* centra il pallino sulla track */
}

.controls-panel input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #1f78ea;
    border: none;
}

/* Focus */
.controls-panel input[type="range"]:focus {
    outline: none;
}


/* Wind strength row more compact */
#CurtainSettingsPanel {
    display: grid;
    grid-template-columns: 58px 82px 34px;
    align-items: center;
    column-gap: 5px;
}

#CurtainSettingsPanel h3 {
    grid-column: 1 / -1;
}

#CurtainSettingsPanel label {
    font-size: 11px !important;
    font-weight: 600 !important;
    white-space: nowrap;
}

#CurtainSettingsPanel input[type="range"] {
    width: 82px !important;
}

#CurtainSettingsPanel span {
    font-size: 11px !important;
    font-weight: 700 !important;
    white-space: nowrap;
}


/* =========================
   UI scale like browser 80%
   Keep canvas 16:9
   ========================= */

:root {
    --topbar-height: 50px;
    --side-panel-width: 205px;
}

/* Top bar più compatta */
.top-control-bar {
    flex: 0 0 var(--topbar-height) !important;
    height: var(--topbar-height) !important;
    min-height: var(--topbar-height) !important;
    padding: 3px 6px !important;
}

.top-buttons {
    height: 44px !important;
    padding: 2px 5px !important;
    gap: 6px !important;
}

/* Layout */
.main-layout {
    height: calc(100vh - var(--topbar-height)) !important;
    padding: 5px !important;
    gap: 5px !important;
}

/* Menu sinistro più stretto */
.controls-panel {
    width: var(--side-panel-width) !important;
    min-width: var(--side-panel-width) !important;
    max-width: var(--side-panel-width) !important;

    padding: 8px !important;
    border-radius: 9px !important;
}

/* Titoli e spazi del menu */
.control-group {
    margin-bottom: 10px !important;
}

.control-group h3 {
    font-size: 11px !important;
    margin-bottom: 5px !important;
    padding-bottom: 4px !important;
}

/* Slider del menu */
.control-row {
    grid-template-columns: 68px minmax(38px, 1fr) 28px !important;
    column-gap: 4px !important;
    margin-bottom: 6px !important;
}

.control-row label {
    font-size: 10.5px !important;
    font-weight: 600 !important;
}

.control-row span {
    font-size: 10.5px !important;
    font-weight: 700 !important;
    min-width: 26px !important;
}

/* Bottoni generici */
button {
    padding: 5px 8px !important;
    font-size: 10.5px !important;
    border-radius: 7px !important;
}

/* Icone top bar e menu */
#ButtonMusic,
#ButtonGlobalAudio,
#ButtonNightDay,
#ButtonAutoSun,
.water-button {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    padding: 2px !important;
}

#ButtonMusic img,
#ButtonGlobalAudio img,
#ButtonNightDay img,
#ButtonAutoSun img,
.water-button img,
.teapot-icon-button img {
    width: 34px !important;
    height: 34px !important;
}

/* Volume compatto */
.music-volume-control {
    height: 34px !important;
    min-width: 165px !important;
    padding: 0 8px !important;
}

.music-volume-control label {
    font-size: 11px !important;
}

.music-volume-control span {
    font-size: 10.5px !important;
}

#MusicVolume {
    width: 84px !important;
}

/* Wind / Strength compatto */
#CurtainSettingsPanel {
    display: grid !important;
    grid-template-columns: 48px 76px 32px !important;
    align-items: center !important;
    column-gap: 4px !important;
}

#CurtainSettingsPanel h3 {
    grid-column: 1 / -1 !important;
}

#CurtainSettingsPanel label {
    font-size: 10.5px !important;
    font-weight: 600 !important;
}

#CurtainSettingsPanel input[type="range"] {
    width: 76px !important;
}

#CurtainSettingsPanel span {
    font-size: 10.5px !important;
    font-weight: 700 !important;
}

/* FPS compatto */
.fps-overlay {
    font-size: 13px !important;
    padding: 4px 7px !important;
    border-radius: 7px !important;
}

/* Freccia: grande abbastanza, ma allineata al menu più stretto */
.toggle-side-panel-button {
    left: var(--side-panel-width) !important;

    width: 34px !important;
    height: 70px !important;

    font-size: 34px !important;
    line-height: 1 !important;
    padding: 0 !important;
}

body.ui-panel-hidden .toggle-side-panel-button {
    left: 0 !important;
}

/* Canvas: NON deformare, resta 16:9 */
#gl-canvas {
    aspect-ratio: 16 / 9 !important;
    width: 100% !important;
    height: auto !important;
    max-height: 100% !important;
}


/* New code for loading bar*************/
.loading-bar-fill {
    width: 0%;
    height: 100%;

    border-radius: 999px;

    background: linear-gradient(
        90deg,
        #ff5fa2,
        #ffc857,
        #8fd3ff
    );

    transition: width 0.35s ease;
}


.camera-help-top-button {
    margin-left: auto;

    width: 48px !important;
    height: 42px !important;

    border: none;
    border-radius: 10px;

    background: rgba(255, 255, 255, 0.85);
    cursor: pointer;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 2px !important;

    box-shadow: 0 3px 8px rgba(255, 255, 255, 0.18);

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

.camera-help-top-button:hover {
    transform: scale(1.06);
    background: rgba(255, 255, 255, 1.0);
}

.camera-help-top-button img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    pointer-events: none;
}

.camera-help-top-button span {
    margin-top: -3px;

    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.4px;

    color: #2b2b2b;

    pointer-events: none;
}


/*************CAMERA HELP LEGEND **********/
.camera-controls-legend {
    position: fixed;

    top: 58px;
    right: 12px;

    z-index: 9999;

    padding: 10px 12px;
    border-radius: 12px;

    background: rgba(0, 0, 0, 0.72);
    color: white;

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

    min-width: 220px;

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    opacity: 1;
    transform: translateY(0);

    transition: opacity 0.18s ease, transform 0.18s ease;
}

.camera-controls-legend.hidden {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}


/* Start screen button should not inherit compact UI button size */
#ButtonStartGame {
    min-width: 220px !important;
    height: 64px !important;

    padding: 14px 34px !important;

    font-size: 20px !important;
    font-weight: 900 !important;

    border-radius: 18px !important;
}

/* Matricola and name ***********/
.student-credit {
    margin-top: 18px;
    padding-top: 14px;

    border-top: 1px solid rgba(255, 255, 255, 0.45);

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;

    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.2px;

    color: rgba(40, 40, 40, 0.68);
}

.student-dot {
    opacity: 0.55;
}

/********** Error if dog model is not loaded **********/
.dog-load-error-overlay {
    position: fixed;
    inset: 0;

    z-index: 20000;

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

    background: rgba(20, 20, 28, 0.55);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.dog-load-error-overlay.hidden {
    display: none;
}

.dog-load-error-card {
    width: 430px;
    max-width: 88vw;

    padding: 30px 34px;

    border-radius: 24px;

    background: rgba(255, 255, 255, 0.92);
    color: #2f2f2f;

    text-align: center;

    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.65);
}

.dog-load-error-icon {
    font-size: 46px;
    margin-bottom: 10px;
}

.dog-load-error-card h2 {
    margin: 0 0 12px 0;

    font-size: 26px;
    font-weight: 900;

    color: #90027d;
}

.dog-load-error-card p {
    margin: 0 0 24px 0;

    font-size: 16px;
    line-height: 1.5;

    color: rgba(30, 30, 30, 0.78);
}

#ButtonRefreshAfterDogError {
    min-width: 170px !important;
    height: 48px !important;

    padding: 10px 22px !important;

    border-radius: 15px !important;

    background: rgba(255, 34, 126, 0.82) !important;
    color: white !important;

    font-size: 16px !important;
    font-weight: 900 !important;
}

.rotation-demo-button {
    width: 100% !important;
    margin-bottom: 8px !important;

    background: rgba(96, 125, 139, 0.88) !important;
    color: white !important;

    font-size: 11px !important;
    font-weight: 800 !important;
}

.rotation-demo-button.active {
    background: rgba(255, 140, 0, 0.92) !important;
}

/*Debug Shadow mode*******/
.shadow-demo-panel {
    padding: 0 !important;
}

.shadow-demo-panel summary {
    padding: 8px 10px !important;

    border-radius: 10px;
    border: 1px solid rgba(40, 40, 40, 0.22);

    background: rgba(255, 255, 255, 0.7);

    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;

    color: #333;

    cursor: pointer;
    list-style-position: inside;
}

.shadow-demo-panel summary:hover {
    background: rgba(255, 255, 255, 0.95);
}

.shadow-demo-description {
    margin: 8px 0 10px 0 !important;

    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;

    color: rgba(40, 40, 40, 0.62) !important;
}

.rotation-demo-button {
    width: 100% !important;
    margin-bottom: 8px !important;

    background: rgba(96, 125, 139, 0.88) !important;
    color: white !important;

    font-size: 12px !important;
    font-weight: 850 !important;
}

.rotation-demo-button.active {
    background: rgba(255, 140, 0, 0.92) !important;
}

/****** Buttons night/day and minigames more close to each other********/
.side-icon-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;

    flex-wrap: wrap;

    margin-top: 4px;
}

.side-icon-row button {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;

    padding: 0 !important;

    border-radius: 12px !important;

    display: flex;
    align-items: center;
    justify-content: center;
}

.side-icon-row button img {
    width: 42px !important;
    height: 42px !important;

    object-fit: contain;
    pointer-events: none;
}

/******* EXIT BUTTON FOR CAMERA HELP MODE *********/
.camera-controls-legend {
    position: fixed;
    top: 56px;
    right: 12px;

    z-index: 9999;

    padding: 12px 36px 12px 14px;

    border-radius: 12px;

    background: rgba(0, 0, 0, 0.66);
    color: white;

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

    min-width: 220px;

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    opacity: 1;
    transform: translateY(0);

    transition: opacity 0.18s ease, transform 0.18s ease;
}

.camera-controls-legend.hidden {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}

.camera-controls-close-button {
    position: absolute;

    top: 6px;
    right: 7px;

    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;

    padding: 0 !important;

    border: none !important;
    border-radius: 50% !important;

    background: rgba(255, 255, 255, 0.22) !important;
    color: white !important;

    font-size: 15px !important;
    font-weight: 900 !important;
    line-height: 20px !important;

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

    cursor: pointer;
    pointer-events: auto;
}

.camera-controls-close-button:hover {
    background: rgb(248, 6, 6) !important;
    transform: scale(1.08);
}

/***** Improving start screen card *******/
.start-description {
    max-width: 620px;
    margin: 18px auto 34px auto !important;

    font-size: 22px !important;
    font-weight: 700 !important;
    line-height: 1.45 !important;

    color: rgba(35, 35, 42, 0.78) !important;
}

.recommended-setup {
    margin: 26px auto 0 auto;
    padding: 18px 22px 16px 22px;

    max-width: 640px;

    border-radius: 22px;

    background: rgba(255, 255, 255, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.55);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        0 8px 24px rgba(0, 0, 0, 0.08);

    text-align: center;
}

.setup-title {
    margin-bottom: 12px;

    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.8px;
    text-transform: uppercase;

    color: rgba(145, 0, 125, 0.78);
}

.setup-tags {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;

    flex-wrap: wrap;

    margin-bottom: 12px;
}

.setup-tags span {
    padding: 7px 12px;

    border-radius: 999px;

    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(255, 255, 255, 0.72);

    font-size: 13px;
    font-weight: 800;

    color: rgba(38, 38, 48, 0.82);

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.recommended-setup p {
    margin: 0 !important;

    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;

    color: rgba(7, 7, 10, 0.758) !important;
}

.student-credit {
    margin-top: 22px !important;
    padding-top: 14px !important;

    border-top: 1px solid rgba(255, 255, 255, 0.45);

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;

    font-size: 12px !important;
    font-weight: 800 !important;
    letter-spacing: 0.25px;

    color: rgba(35, 35, 45, 0.52) !important;
}

.student-dot {
    opacity: 0.45;
}


.inspiration-badge {
    width: fit-content;
    max-width: 90%;

    margin: -14px auto 30px auto;
    padding: 9px 16px 9px 12px;

    display: flex;
    align-items: center;
    gap: 10px;

    border-radius: 999px;

    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.62);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        0 8px 22px rgba(0, 0, 0, 0.08);

    color: rgba(38, 38, 48, 0.72);
}

.inspiration-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.inspiration-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    line-height: 1.15;
}

.inspiration-label {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.8px;
    text-transform: uppercase;

    color: rgba(145, 0, 125, 0.68);
}

.inspiration-title {
    font-size: 13px;
    font-weight: 800;

    color: rgba(42, 42, 52, 0.76);
}


/**** Reedruce all start screen objects******/
#startScreen {
    align-items: center !important;
    justify-content: center !important;
    overflow-y: auto !important;
    padding: 18px 0 !important;
}

.start-card {
    width: min(760px, 78vw) !important;
    max-height: calc(100vh - 70px) !important;

    padding: 36px 42px 28px !important;

    border-radius: 26px !important;
}

.start-logo {
    width: 74px !important;
    height: 74px !important;

    margin-bottom: 14px !important;
}

.start-card h1 {
    margin: 0 0 18px 0 !important;

    font-size: 40px !important;
    line-height: 1.05 !important;
}

.start-description {
    max-width: 600px !important;

    margin: 0 auto 20px auto !important;

    font-size: 19px !important;
    line-height: 1.4 !important;
}

.inspiration-badge {
    margin: 0 auto 22px auto !important;
    padding: 8px 14px 8px 10px !important;
}

.inspiration-icon {
    width: 45px !important;
    height: 45px !important;
}

.inspiration-icon img {
    width: 45px !important;
    height: 45px !important;
}

.inspiration-label {
    font-size: 9px !important;
}

.inspiration-title {
    font-size: 12px !important;
}

#ButtonStartGame {
    min-width: 220px !important;
    height: 58px !important;

    padding: 12px 30px !important;

    font-size: 21px !important;
    border-radius: 18px !important;
}

.recommended-setup {
    max-width: 560px !important;

    margin: 24px auto 0 auto !important;
    padding: 14px 18px 14px 18px !important;

    border-radius: 20px !important;
}

.setup-title {
    margin-bottom: 10px !important;
    font-size: 12px !important;
}

.setup-tags {
    gap: 7px !important;
    margin-bottom: 10px !important;
}

.setup-tags span {
    padding: 6px 10px !important;

    font-size: 12px !important;
}

.recommended-setup p {
    font-size: 12px !important;
    line-height: 1.3 !important;
}

.student-credit {
    margin-top: 18px !important;
    padding-top: 12px !important;

    font-size: 11px !important;
}


#StartDogLogo {
    display: block;

    width: 110px !important;
    height: auto !important;

    margin: 0 auto 12px auto !important;

    object-fit: contain !important;
    object-position: center bottom !important;

    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;

    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.16));
}

/* Compact start screen footer */
.start-card {
    max-height: calc(100vh - 32px) !important;
    /* padding: 22px 44px 16px 44px !important; */
    padding-bottom: 14px !important;
}

#StartDogLogo {
    width: 92px !important;
    margin-bottom: 8px !important;
}

.start-card h1 {
    margin-bottom: 12px !important;
    font-size: 38px !important;
}

.inspiration-badge {
    margin-bottom: 16px !important;
}

.start-description {
    margin-bottom: 18px !important;
    font-size: 18px !important;
    line-height: 1.35 !important;
}

#ButtonStartGame {
    height: 54px !important;
    margin-top: 0 !important;
}

.recommended-setup {
    margin-top: 20px !important;
    padding: 12px 16px !important;
}

.student-credit {
    margin-top: 10px !important;
    padding-top: 8px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
}

/**** Options start game button *****/
.start-control-stack {
    width: min(520px, 80vw);

    display: flex;
    flex-direction: column;
    align-items: stretch;

    margin: 26px auto 0 auto;
}

#ButtonStartGame {
    width: 100% !important;
    height: 64px !important;
    margin: 0 !important;
}

.start-secondary-row {
    width: 100%;

    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 14px;

    margin-top: 16px;
    margin-bottom: 18px;
}

.pet-name-box {
    flex: 1;
    height: 58px;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 0 16px;
    border-radius: 20px;

    background: rgba(255, 255, 255, 0.30);
    border: 1.5px solid rgba(255, 255, 255, 0.70);

    box-shadow:
        0 10px 22px rgba(0, 0, 0, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.pet-name-box label {
    font-size: 17px;
    font-weight: 900;
    color: #74437e;
    white-space: nowrap;
}

#PetNameInput {
    flex: 1;
    min-width: 0;
    height: 40px;

    padding: 0 14px;

    border: none;
    border-radius: 14px;

    background: rgba(255, 255, 255, 0.72);
    color: #45404a;

    font-size: 17px;
    font-weight: 800;

    outline: none;

    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.08),
        0 1px 0 rgba(255, 255, 255, 0.45);
}

#PetNameInput::placeholder {
    color: rgba(70, 65, 75, 0.45);
}

#PetNameInput:focus {
    background: rgba(255, 255, 255, 0.88);
    box-shadow:
        0 0 0 3px rgba(230, 70, 150, 0.16),
        inset 0 2px 5px rgba(0, 0, 0, 0.06);
}

.start-options-button {
    width: 195px;
    height: 62px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    padding: 0 24px;
    border-radius: 22px;

    border: 1.8px solid rgba(170, 75, 170, 0.45);

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.38),
            rgba(210, 160, 220, 0.36)
        );

    color: #7b3c86;

    font-size: 30px;
    font-weight: 950;
    letter-spacing: 0.01em;

    box-shadow:
        0 12px 26px rgba(120, 55, 135, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);

    cursor: pointer;

    transition:
        transform 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.start-options-button:hover {
    transform: translateY(-2px);

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.55),
            rgba(225, 165, 235, 0.50)
        );

    border-color: rgba(190, 70, 185, 0.65);

    box-shadow:
        0 16px 32px rgba(120, 55, 135, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.start-options-button:active {
    transform: translateY(0);
}


.start-secondary-row {
    width: 100%;

    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 16px;

    margin-top: 16px;
    margin-bottom: 18px;
}

.pet-name-box {
    flex: 1;
    height: 62px;
}

.start-settings-icon-button {
    width: 62px;
    height: 62px;

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

    border-radius: 22px;

    border: 1.8px solid rgba(170, 75, 170, 0.45);

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.38),
            rgba(210, 160, 220, 0.36)
        );

    color: #7b3c86;

    font-size: 44px;
    font-weight: 900;

    box-shadow:
        0 12px 26px rgba(120, 55, 135, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);

    cursor: pointer;

    transition:
        transform 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.start-settings-icon-button:hover {
    transform: translateY(-2px);

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.55),
            rgba(225, 165, 235, 0.50)
        );

    border-color: rgba(190, 70, 185, 0.65);

    box-shadow:
        0 16px 32px rgba(120, 55, 135, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.start-settings-icon-button:active {
    transform: translateY(0);
}


/* Final tuning: pet name + settings button */
.start-control-stack {
    width: min(560px, 80vw) !important;
}

.start-secondary-row {
    width: 100% !important;

    display: grid !important;
    grid-template-columns: 1fr 86px;
    gap: 18px !important;

    align-items: stretch !important;

    margin-top: 16px !important;
    margin-bottom: 18px !important;
}

.pet-name-box {
    width: 100% !important;
    max-width: none !important;
    height: 66px !important;

    box-sizing: border-box;

    display: grid !important;
    grid-template-columns: 138px 1fr;
    align-items: center;
    gap: 12px;

    padding: 0 18px !important;
    border-radius: 22px !important;
}

.pet-name-box label {
    font-size: 20px !important;
    font-weight: 950 !important;
    text-align: left;
}

#PetNameInput {
    width: 100% !important;
    height: 46px !important;

    box-sizing: border-box;

    font-size: 21px !important;
    font-weight: 850 !important;

    padding: 0 18px !important;
    border-radius: 17px !important;
}


.start-settings-icon-button {
    width: 86px !important;
    height: 66px !important;

    box-sizing: border-box;
    padding: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    border-radius: 22px !important;

    border: 2px solid rgba(185, 105, 200, 0.55) !important;

    background: rgba(255, 255, 255, 0.32) !important;
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);

    box-shadow:
        0 4px 10px rgba(120, 55, 135, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.62) !important;

    cursor: pointer;

    transition:
        transform 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.start-settings-icon-button img {
    width: 44px !important;
    height: 44px !important;

    object-fit: contain;
    pointer-events: none;

    /* filter: drop-shadow(0 2px 3px rgba(70, 70, 90, 0.18)); */
}

.start-settings-icon-button:hover {
    transform: translateY(-2px);

    background: rgba(255, 255, 255, 0.48) !important;
    border-color: rgba(150, 115, 255, 0.72) !important;

    box-shadow:
        0 4px 10px rgba(120, 55, 135, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.62) !important;
}

.start-settings-icon-button:active {
    transform: translateY(0);
}

/* Keep footer visible in start screen */
.start-control-stack {
    margin-top: 20px !important;
}

.start-secondary-row {
    margin-top: 14px !important;
    margin-bottom: 12px !important;
}

.recommended-setup {
    margin-top: 18px !important;
    padding: 13px 18px !important;
}

.student-credit {
    margin-top: 10px !important;
    padding-top: 8px !important;

    font-size: 12px !important;
    line-height: 1.2 !important;

    position: relative;
    z-index: 2;
}

.recommended-setup {
    margin-top: 14px !important;
}

.start-description {
    margin-bottom: 18px !important;
}


/** FIxing bug odf Name and id not visible*/
/* Final start screen vertical balance - no absolute footer */
.start-card {
    max-height: calc(100vh - 28px) !important;
    padding: 18px 46px 14px 46px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

#StartDogLogo {
    width: 88px !important;
    margin-bottom: 6px !important;
}

.start-card h1 {
    font-size: 36px !important;
    margin-bottom: 10px !important;
}

.inspiration-badge {
    margin-bottom: 14px !important;
}

.start-description {
    font-size: 18px !important;
    line-height: 1.35 !important;
    margin-bottom: 16px !important;
}

.start-control-stack {
    margin-top: 14px !important;
}

#ButtonStartGame {
    height: 58px !important;
}

.start-secondary-row {
    margin-top: 12px !important;
    margin-bottom: 14px !important;
}

.pet-name-box {
    height: 60px !important;
}

.start-settings-icon-button {
    height: 60px !important;
}

.recommended-setup {
    margin-top: 14px !important;
    padding: 12px 18px !important;
}

.setup-title {
    margin-bottom: 8px !important;
}

.setup-tags {
    margin-bottom: 8px !important;
}

.recommended-setup p {
    font-size: 12px !important;
    line-height: 1.25 !important;
}

.student-credit {
    position: static !important;

    margin-top: 10px !important;
    padding-top: 8px !important;

    border-top: 1px solid rgba(255, 255, 255, 0.42);

    font-size: 11px !important;
    line-height: 1.2 !important;
    text-align: center !important;
}
#StartDogLogo {
    width: 78px !important;
}

/* Settings panel******/
/* Start settings modal */
.start-settings-panel {
    position: fixed;
    inset: 0;
    z-index: 10020;

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

    background: rgba(30, 25, 40, 0.22);

    backdrop-filter: blur(12px) saturate(145%);
    -webkit-backdrop-filter: blur(12px) saturate(145%);
}

.start-settings-panel.hidden {
    display: none !important;
}

.start-settings-card {
    width: min(430px, 86vw);

    padding: 24px 26px 26px 26px;
    border-radius: 28px;

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.50),
            rgba(238, 210, 238, 0.44)
        );

    border: 1.8px solid rgba(255, 255, 255, 0.72);

    box-shadow:
        0 24px 70px rgba(55, 35, 70, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);

    color: #3e3547;
}

.start-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 18px;
}

.start-settings-header h2 {
    margin: 0;

    color: #8f168b;
    font-size: 30px;
    font-weight: 950;
    letter-spacing: -0.4px;
}

.start-settings-close-button {
    width: 38px !important;
    height: 38px !important;

    padding: 0 !important;
    border-radius: 50% !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: rgba(255, 255, 255, 0.42) !important;
    color: #7b3c86 !important;

    border: 1.5px solid rgba(255, 255, 255, 0.72) !important;

    font-size: 26px !important;
    font-weight: 900 !important;

    cursor: pointer;
}

.start-settings-close-button:hover {
    background: rgba(255, 255, 255, 0.62) !important;
}

.start-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    padding: 14px 0;

    border-top: 1px solid rgba(255, 255, 255, 0.42);
}

.start-settings-row-column {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
}

.start-settings-label {
    font-size: 18px;
    font-weight: 950;
    color: #6f3d7c;
}

.start-settings-subtitle {
    margin-top: 3px;

    font-size: 13px;
    font-weight: 650;
    line-height: 1.25;

    color: rgba(55, 50, 65, 0.68);
}

.start-settings-pill {
    min-width: 76px !important;
    height: 42px !important;

    padding: 0 18px !important;
    border-radius: 999px !important;

    background: rgba(255, 255, 255, 0.42) !important;
    color: #7b3c86 !important;

    border: 1.5px solid rgba(255, 255, 255, 0.68) !important;

    font-size: 15px !important;
    font-weight: 950 !important;

    cursor: pointer;

    box-shadow:
        0 8px 18px rgba(100, 50, 120, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.start-settings-pill.active {
    background: rgba(235, 76, 156, 0.84) !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.75) !important;
}

.start-scene-choice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.start-scene-button {
    height: 42px !important;

    border-radius: 16px !important;
    border: 1.5px solid rgba(255, 255, 255, 0.68) !important;

    background: rgba(255, 255, 255, 0.38) !important;
    color: #74437e !important;

    font-size: 16px !important;
    font-weight: 950 !important;

    cursor: pointer;
}

.start-scene-button.active {
    background: rgba(235, 76, 156, 0.84) !important;
    color: white !important;
    box-shadow: 0 10px 22px rgba(235, 76, 156, 0.22);
}

/* =========================================================
   FINAL START SCREEN COMPACT OVERRIDE
   Keep this at the very end of the CSS file
   ========================================================= */

#startScreen {
    padding: 10px 0 !important;
    overflow: hidden !important;
}

.start-card {
    width: min(720px, 86vw) !important;
    max-height: calc(100vh - 22px) !important;

    padding: 14px 38px 10px 38px !important;

    overflow: hidden !important;
    box-sizing: border-box !important;
}

#StartDogLogo {
    width: 70px !important;
    margin-bottom: 4px !important;
}

.start-card h1 {
    font-size: 32px !important;
    line-height: 1.05 !important;
    margin-bottom: 8px !important;
}

.inspiration-badge {
    margin-bottom: 10px !important;
    transform: scale(0.92);
    transform-origin: center;
}

.start-description {
    max-width: 620px !important;

    font-size: 16px !important;
    line-height: 1.32 !important;

    margin-bottom: 12px !important;
}

.start-control-stack {
    width: min(520px, 80vw) !important;
    margin-top: 10px !important;
}

#ButtonStartGame {
    height: 50px !important;

    font-size: 22px !important;
    border-radius: 18px !important;
}

.start-secondary-row {
    margin-top: 10px !important;
    margin-bottom: 10px !important;

    grid-template-columns: 1fr 72px !important;
    gap: 14px !important;
}

.pet-name-box {
    height: 52px !important;
    border-radius: 18px !important;
    padding: 0 14px !important;
}

.pet-name-box label {
    font-size: 17px !important;
}

#PetNameInput {
    height: 38px !important;
    font-size: 18px !important;
    border-radius: 14px !important;
}

.start-settings-icon-button {
    width: 72px !important;
    height: 52px !important;
    border-radius: 18px !important;
}

.start-settings-icon-button img {
    width: 42px !important;
    height: 42px !important;
}

.recommended-setup {
    margin-top: 10px !important;
    padding: 10px 14px !important;
    border-radius: 18px !important;
}

.setup-title {
    margin-bottom: 6px !important;
    font-size: 12px !important;
}

.setup-tags {
    gap: 6px !important;
    margin-bottom: 6px !important;
}

.setup-tags span {
    padding: 5px 9px !important;
    font-size: 11px !important;
}

.recommended-setup p {
    font-size: 11px !important;
    line-height: 1.22 !important;
}

.student-credit {
    position: static !important;

    margin-top: 7px !important;
    padding-top: 6px !important;

    font-size: 10px !important;
    line-height: 1.15 !important;
}


/* =========================================================
   Smooth start screen entrance - no UI flash behind
   ========================================================= */

/* =========================================================
   Smooth start screen entrance - fade only
   ========================================================= */

#startScreen {
    opacity: 1;
    transform: none;
}

/* Lo sfondo copre subito tutto, la card parte solo trasparente */
#startScreen .start-card {
    opacity: 0;
    transform: none;
    transition: opacity 0.65s ease;
}

/* Entra solo in fade, senza zoom */
#startScreen.start-visible .start-card {
    opacity: 1;
    transform: none;
}

/* Uscita quando clicchi Start */
#startScreen.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
}

#startScreen.hidden .start-card {
    opacity: 0;
    transform: none;
}


#RotationSettingsPanel #ButtonCollision {
    width: 100%;
    margin: 6px 0 12px 0;
}



/* Smaller title for shadow debug dropdown */
#RotationSettingsPanel details.collapsible-panel > summary {
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    margin-bottom: 8px !important;
    white-space: nowrap !important;
}


/* =========================================================
   Top bar dog action buttons
   ========================================================= */

#ButtonCallDogMode,
#ButtonPetDogMode {
    height: 46px !important;
    min-width: 118px !important;

    padding: 0 16px !important;
    border-radius: 16px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1 !important;

    white-space: nowrap !important;

    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;

    transition:
        transform 0.12s ease,
        filter 0.12s ease,
        box-shadow 0.12s ease !important;
}

#ButtonCallDogMode {
    background: linear-gradient(
        135deg,
        rgba(255, 90, 35, 0.95),
        rgba(255, 125, 65, 0.92)
    ) !important;
}

#ButtonPetDogMode {
    background: linear-gradient(
        135deg,
        rgba(105, 72, 62, 0.95),
        rgba(125, 88, 76, 0.92)
    ) !important;
}

#ButtonCallDogMode:hover,
#ButtonPetDogMode:hover {
    transform: translateY(-1px) !important;
    filter: brightness(1.08) !important;
}

#ButtonCallDogMode:active,
#ButtonPetDogMode:active {
    transform: scale(0.96) !important;
}


#topBar {
    position: relative;
    display: flex;
    align-items: center;
}

#dogActionsGroup {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    
    display: flex;
    align-items: center;
    gap: 14px;
}


/* =========================================================
   Top bar layout: left / center / right
   ========================================================= */

.top-buttons {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    align-items: center !important;

    column-gap: 12px !important;
    overflow: hidden !important;
}

.top-left-actions,
.top-center-actions,
.top-right-actions {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0 !important;
}

.top-left-actions {
    justify-self: start !important;
}

.top-center-actions {
    justify-self: center !important;
}

.top-right-actions {
    justify-self: end !important;
}


/* =========================================================
   Top bar dog action buttons - compact
   ========================================================= */

#ButtonCallDogMode,
#ButtonPetDogMode {
    height: 42px !important;
    min-width: 132px !important;

    padding: 0 14px !important;
    border-radius: 14px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 9px !important;

    font-size: 16px !important;
    font-weight: 800 !important;
    line-height: 1 !important;

    white-space: nowrap !important;

    box-shadow:
        0 5px 14px rgba(0, 0, 0, 0.11),
        inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}

#ButtonCallDogMode {
    background: linear-gradient(
        135deg,
        rgba(255, 98, 45, 0.96),
        rgba(255, 130, 72, 0.94)
    ) !important;
}

#ButtonPetDogMode {
    background: linear-gradient(
        135deg,
        rgba(118, 94, 87, 0.96),
        rgba(124, 113, 109, 0.94)
    ) !important;
}

.dog-action-icon {
    width: 19px !important;
    height: 19px !important;
    object-fit: contain !important;
    flex: 0 0 auto !important;
    pointer-events: none !important;
}

.pet-heart-icon {
    font-size: 17px !important;
    line-height: 1 !important;
}

.dog-action-label {
    line-height: 1 !important;
    pointer-events: none !important;
}

#ButtonCallDogMode:hover,
#ButtonPetDogMode:hover {
    transform: translateY(-1px) !important;
    filter: brightness(1.07) !important;
}

#ButtonCallDogMode:active,
#ButtonPetDogMode:active {
    transform: scale(0.97) !important;
}