
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #000;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    touch-action: manipulation;
}

button {
    font-family: inherit;
    border: 0;
    outline: none;
    cursor: pointer;
}

#app {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

/* =========================
   LUMIÈRE
========================= */

#lightScreen {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #00152b;
}

#lightBackground {
    position: absolute;
    inset: 0;
    background: #00152b;
    transition: background 0.5s ease;
}

#canvasLayer,
#effectLayer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.lightCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.effect {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#brightnessLayer {
    position: absolute;
    inset: 0;
    background: #000;
    opacity: 0.25;
    pointer-events: none;
    z-index: 50;
}

#timerDisplay {
    position: absolute;
    top: max(20px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    letter-spacing: 2px;
    z-index: 100;
    pointer-events: none;
}

#showControls {
    position: absolute;
    right: 15px;
    bottom: calc(15px + env(safe-area-inset-bottom));
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

#showControls img {
    width: 22px;
    height: 22px;
}


/* =========================
   BARRE
========================= */

#bottomBar {
    position: absolute;
    z-index: 300;
    left: 0;
    right: 0;
    bottom: 0;

    min-height: 74px;
    padding:
        8px
        6px
        calc(8px + env(safe-area-inset-bottom))
        6px;

    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;

    background: rgba(5,5,5,0.88);
    backdrop-filter: blur(18px);
    border-top: 1px solid rgba(255,255,255,0.08);

    transition: transform 0.3s ease;
}

#bottomBar.hidden {
    transform: translateY(120%);
}

.navButton {
    min-width: 0;
    height: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;

    color: rgba(255,255,255,0.7);
    background: transparent;
    border-radius: 12px;
}

.navButton:active {
    background: rgba(255,255,255,0.12);
}

.navButton img {
    width: 23px;
    height: 23px;
}

.navButton span {
    font-size: 9px;
    white-space: nowrap;
}


/* =========================
   PANNEAU
========================= */

#panel {
    position: absolute;
    z-index: 400;
    left: 0;
    right: 0;
    bottom: 0;

    height: min(78vh, 680px);

    background: rgba(10,10,10,0.97);
    border-radius: 24px 24px 0 0;

    transform: translateY(105%);
    transition: transform 0.3s ease;

    overflow: hidden;
}

#panel.open {
    transform: translateY(0);
}

#panelContent {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding:
        55px
        18px
        calc(30px + env(safe-area-inset-bottom))
        18px;

    scrollbar-width: none;
}

#panelContent::-webkit-scrollbar {
    display: none;
}

.closeButton {
    position: absolute;
    z-index: 10;
    top: 13px;
    right: 15px;

    width: 40px;
    height: 40px;
    border-radius: 50%;

    background: rgba(255,255,255,0.08);

    display: flex;
    align-items: center;
    justify-content: center;
}

.closeButton img {
    width: 20px;
    height: 20px;
}


/* =========================
   CONTENU
========================= */

.pageTitle {
    margin: 0 0 6px;
    color: #fff;
    font-size: 25px;
    font-weight: 700;
}

.pageSubtitle {
    margin: 0 0 22px;
    color: rgba(255,255,255,0.45);
    font-size: 13px;
}

.sectionTitle {
    margin: 24px 0 12px;
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}


/* =========================
   COULEURS
========================= */

.colorGrid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.colorCard {
    height: 78px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
    overflow: hidden;
    color: white;
    text-align: left;
    padding: 14px;
}

.colorCard span {
    position: relative;
    z-index: 2;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 5px #000;
}


/* =========================
   LISTES
========================= */

.optionGrid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.optionButton {
    min-height: 58px;
    padding: 10px 12px;
    border-radius: 15px;

    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.06);

    color: rgba(255,255,255,0.85);
    text-align: left;

    transition: 0.2s;
}

.optionButton.active {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.35);
}

.optionButton .small {
    display: block;
    margin-top: 4px;
    color: rgba(255,255,255,0.4);
    font-size: 10px;
}


/* =========================
   FAVORIS
========================= */

.favoriteCard {
    display: flex;
    align-items: center;
    gap: 10px;

    width: 100%;
    margin-bottom: 10px;
    padding: 12px;

    background: rgba(255,255,255,0.06);
    border-radius: 15px;
}

.favoritePreview {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    flex-shrink: 0;
}

.favoriteInfo {
    flex: 1;
    min-width: 0;
}

.favoriteInfo strong {
    display: block;
    color: white;
    font-size: 14px;
}

.favoriteInfo small {
    color: rgba(255,255,255,0.4);
}

.deleteFavorite {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: white;
    background: rgba(255,60,60,0.15);
}

.empty {
    padding: 35px 15px;
    text-align: center;
    color: rgba(255,255,255,0.35);
}


/* =========================
   MINUTEUR
========================= */

.timerBig {
    text-align: center;
    color: white;
    font-size: 50px;
    font-weight: 200;
    letter-spacing: 3px;
    margin: 20px 0;
}

.timerInputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.timerInput {
    width: 100%;
    height: 58px;

    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;

    background: rgba(255,255,255,0.06);
    color: white;

    text-align: center;
    font-size: 22px;
}

.mainAction {
    width: 100%;
    height: 56px;
    margin-top: 15px;

    border-radius: 16px;

    background: white;
    color: black;

    font-size: 15px;
    font-weight: 700;
}

.stopAction {
    background: rgba(255,60,60,0.18);
    color: #fff;
}


/* =========================
   LUMINOSITÉ
========================= */

.brightnessValue {
    text-align: center;
    color: white;
    font-size: 45px;
    margin: 25px 0;
}

.range {
    width: 100%;
    height: 6px;
    appearance: none;
    border-radius: 10px;
    background: rgba(255,255,255,0.18);
}

.range::-webkit-slider-thumb {
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
}

.range::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: white;
}


/* =========================
   FAVORI
========================= */

.saveFavorite {
    width: 100%;
    height: 55px;
    margin-top: 18px;

    border-radius: 15px;

    background: rgba(255,255,255,0.1);
    color: white;
}


/* =========================
   DESKTOP : SIMULATION MOBILE
========================= */

@media (min-width: 700px) {

    body {
        background: #181818;
    }

    #app {
        width: 390px;
        max-width: 390px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        box-shadow: 0 0 60px rgba(0,0,0,0.6);
    }
}

