* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.3s, color 0.3s;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* ✨ CANVAS AU-DESSUS */
canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    pointer-events: none;
    opacity: 0.6;
    mix-blend-mode: screen;
}

/* APP */
.app {
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* DARK MODE */
body.dark {
    background: #0a0a0a;
}

body.dark .app {
    background: rgba(10,10,10,0.9);
}

/* PAGE */
.page {
    display: none;
    flex: 1;
    text-align: center;
    padding: 20px;
}

.page.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* TITRE */
.title {
    font-size: 26px;
    background: linear-gradient(to right, gold, white);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* INPUT */
input[type="number"] {
    width: 80%;
    padding: 15px;
    font-size: 20px;
    border-radius: 15px;
    border: none;
    text-align: center;
    margin: 20px auto;
    background: rgba(255,255,255,0.8);
}

/* DARK INPUT */
body.dark input[type="number"] {
    background: rgba(255,255,255,0.08);
    color: white;
}

/* TIMER */
#display {
    font-size: clamp(40px, 12vw, 80px);
    margin: 10px 0;
    background: linear-gradient(to right, gold, white);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* BUTTONS */
.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.controls button {
    flex: 1;
    padding: 15px;
    font-size: 16px;
    border-radius: 15px;
    border: none;
    background: linear-gradient(145deg, #ffd700, #c9a000);
    color: black;
    font-weight: bold;
}

/* DARK BUTTON */
body.dark .controls button {
    background: linear-gradient(145deg, #ffd700, #8c6b00);
    color: black;
}

/* SETTINGS */
.setting {
    margin: 15px 0;
    display: flex;
    justify-content: space-between;
    color: black;
}

/* DARK SETTINGS */
body.dark .setting {
    color: white;
}

/* NAV */
.nav {
    display: flex;
    padding: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(10px);
}

/* DARK NAV */
body.dark .nav {
    background: rgba(20,20,20,0.9);
}

.nav button {
    flex: 1;
    margin: 5px;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(145deg, #ffd700, #c9a000);
    font-weight: bold;
}

/* PC */
@media (min-width: 768px) {
    .app {
        height: 800px;
        border-radius: 25px;
        box-shadow: 0 0 40px rgba(255,215,0,0.2);
    }
}