@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');
*{
    margin: 0rem;
    padding: 0rem;
    box-sizing: border-box;
    font-family: "Roboto", sans-serif;
    color: #D2C1B6;
}
.body {
  transform: scale(0.9); 
}
html {
  font-size: 14px; 
}
body{
    margin: 0rem;
    padding: 0rem;
    overflow-x: hidden !important;
    background-color: #1B3C53;
}
.body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #1B3C53;
    transition: ease-in-out 1s;
    flex-direction: column;
    padding: 1rem;
   animation: main 1s ease-in-out forwards; 
   justify-content: flex-start;
}
.main{
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background-color: #234C6A;
    padding: 2rem;
    margin: 0rem;
    gap: 2rem;
    border-radius: 1rem;
    width: 40vw;
    height: 100vh;
    & h1{
        font-size: 3rem;
    }
}
.time-count{
    display: flex;
    align-items: center;
    justify-content: center;
    background-color:#456882;
    padding: 2rem;
    border-radius: 0.5rem;
    width: 40vw;
    position: relative;
    margin-left: 4vw;
    
    & p{
        font-size: 5rem;
        font-weight: 500;
    }
}
.time{
       display: flex;
    align-items: center;
    justify-content: center;
    background-color:#456882;
    border-radius: 0.5rem;
    width: 40vw;
    position: relative;
    
    & p{
        font-size: 5rem;
        font-weight: 500;
    }
}
.time-main{
    display: flex;
    align-items: center;
    justify-content: center;    
}
.time_in_lap{
        display:flex;
        align-items:center;
        justify-content:center;
        margin: 0.5rem;
        background-color: #1B3C53;
        padding:0.3rem;
        border-radius:0.5rem;
        width:10vw;
        margin: 0rem;
}
.btns{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30vw;
    gap: 2vw;
    & button{
        padding: 0.5rem;
        height: 2.5rem;
        width: 9rem;
        border-radius: 1rem;
        border: 1px solid #1B3C53;
        background-color: #456882;
        transition: ease-in-out 0.5s;
        font-weight: 400;
        font-size: 1.3rem;
        align-items: center;
        justify-content: center;
        
    }
}
button:hover{
 background-color:#1B3C53;
 border: 2px solid #456882;
}
.sec{
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
}
.time-sec-mili{
    display: flex;
    align-items: center;
    justify-content: center;
}
.mili{
    font-size: 1.5rem !important;
    padding: 1rem;
}
.control{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 1.5rem;
    padding: 1rem;
    background-color :#234C6A;
    border-radius:1rem;
}
.time-laped{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2vw;
    border: 3px solid  #234C6A;
    margin-top: 1rem;
    border-radius:0.5rem ;
    & p{
        font-size: 1.3rem;
    }
}
.leap{
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    width: 40vw;
    background-color:#456882;
    color: black;
    height: 100vh;
    border-radius: 1rem;
    margin: 1rem;
    overflow: auto;
    padding: 0;
}
.lap{
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 1rem;
}
.leap::-webkit-scrollbar {
    width: 8px;
}
.leap::-webkit-scrollbar{
    width: 0px;
}

/* Table styling */
.leap .table {
    display: flex;
    align-items: center;
    justify-content: space-between; 
    font-size: 2rem;
    width: 100%;
    padding: 0.5rem;
    margin: 0;
    text-align: center;
    gap: 2vw; 
}
.leap h1 {
    background-color: #234C6A;
    width: 100%;
    padding: 0.5rem;
    margin: 0;
    text-align: center;
}
.leap .table p {
    flex: 1;
    text-align: center;
}
.main-table {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: #234C6A;
    z-index: 2;
    border-radius: 1rem 1rem 0 0;
}

/* Base .p class - Default for desktop (1400px+) */
.p {
    font-size: 1.4rem;
    font-weight: 500;
    line-height: 1.4;
}

/* Mobile devices (up to 600px) */
@media screen and (max-width: 600px) {
    html {
        font-size: 12px;
    }
    
    .body {
        transform: scale(1);
        padding: 0.5rem;
        flex-direction: column;
    }
    
    .main {
        width: 90vw;
        height: auto;
        padding: 1.5rem 1rem;
        gap: 1.5rem;
        margin-bottom: 1rem;
        margin-top: 5rem;
        
        & h1 {
            font-size: 2rem;
        }
    }
    
    .time {
        width: 90vw;
    }
    
    .time-count {
        width: 90vw;
        padding: 1rem;
        margin-left: 0;
        flex-wrap: wrap;
        
        & p {
            font-size: 2.5rem;
        }
    }
    
    .mili {
        font-size: 1rem !important;
        padding: 0.5rem;
    }
    
    .btns {
        width: 90vw;
        gap: 1vw;
        flex-wrap: wrap;
        
        & button {
            width: 45%;
            height: 2.5rem;
            font-size: 1rem;
            margin: 0.25rem;
        }
    }
    
    .leap {
        width: 90vw;
        height: 50vh;
        margin: 0.5rem 0;
        
        & h1 {
            font-size: 1.8rem;
        }
    }
    
    .time_in_lap {
        width: 28vw;
        padding: 0.5rem 0.2rem;
        
        & p {
            font-size: 0.9rem;
        }
    }
    
    .time-laped {
        gap: 1vw;
        padding: 0.5rem;
        
        & p {
            font-size: 1rem;
        }
    }
    
    /* Fixed .p class for mobile */
    .p {
        font-size: 0.95rem;
        font-weight: 500;
    }
}

/* Tablets (601px to 800px) */
@media screen and (min-width: 601px) and (max-width: 800px) {
    html {
        font-size: 13px;
    }
    
    .body {
        transform: scale(0.95);
        padding: 1rem;
    }
    
    .main {
        width: 85vw;
        height: auto;
        padding: 2rem 1.5rem;
        gap: 1.8rem;
        
        & h1 {
            font-size: 2.5rem;
        }
    }
    
    .time {
        width: 80vw;
    }
    
    .time-count {
        width: 80vw;
        padding: 1.5rem;
        margin-left: 0;
        
        & p {
            font-size: 3.5rem;
        }
    }
    
    .mili {
        font-size: 1.3rem !important;
        padding: 0.8rem;
    }
    
    .btns {
        width: 75vw;
        gap: 1.5vw;
        flex-wrap: wrap;
        
        & button {
            width: 8rem;
            height: 2.5rem;
            font-size: 1.1rem;
        }
    }
    
    .leap {
        width: 85vw;
        height: 60vh;
        margin: 1rem 0;
    }
    
    .time_in_lap {
        width: 25vw;
        padding: 0.4rem;
    }
    
    .time-laped {
        gap: 1.5vw;
        
        & p {
            font-size: 1.1rem;
        }
    }
    
    /* Fixed .p class for tablets */
    .p {
        font-size: 1.15rem;
        font-weight: 500;
    }
}

/* Medium tablets/small laptops (800px to 1100px) */
@media screen and (min-width: 800px) and (max-width: 1100px) {
    .body {
        flex-direction: column;
    }
    
    .main {
        width: 75vw;
        height: auto;
        padding: 2rem;
        gap: 2rem;
        height: 50vh;
        
        & h1 {
            font-size: 2.8rem;
        }
    }
    
    .time {
        width: 75vw;
    }
    
    .time-count {
        width: 70vw;
        padding: 1.8rem;
        margin-left: 0;
        
        & p {
            font-size: 4rem;
        }
    }
    
    .mili {
        font-size: 1.4rem !important;
    }
    
    .btns {
        width: 65vw;
        gap: 2vw;
        
        & button {
            width: 8.5rem;
            font-size: 1.2rem;
        }
    }
    
    .leap {
        width: 75vw;
        height: 50vh;
        margin: 1rem 0;
    }
    
    .time_in_lap {
        width: 20vw;
    }
    
    /* Fixed .p class for medium screens */
    .p {
        font-size: 1.25rem;
        font-weight: 500;
    }
}

/* Laptops (1100px to 1400px) */
@media screen and (min-width: 1100px) and (max-width: 1400px) {
    .main {
        width: 60vw;
        
        & h1 {
            font-size: 2.8rem;
        }
    }
    
    .time {
        width: 60vw;
    }
    
    .time-count {
        width: 42vw;
        margin-left: 3vw;
        
        & p {
            font-size: 4.5rem;
        }
    }
    
    .btns {
        width: 35vw;
        
        & button {
            width: 8.5rem;
        }
    }
    
    .leap {
        width: 60vw;
    }
    
    .time_in_lap {
        width: 12vw;
    }
    
    /* Fixed .p class for laptops */
    .p {
        font-size: 1.3rem;
        font-weight: 500;
    }
}

/* Large desktops (1400px+) */
@media screen and (min-width: 1400px) {
    html {
        font-size: 15px;
    }
    
    .main {
        width: 38vw;
        
        & h1 {
            font-size: 3.2rem;
        }
    }
    
    .time {
        width: 38vw;
    }
    
    .time-count {
        width: 36vw;
        margin-left: 3.5vw;
        
        & p {
            font-size: 5.5rem;
        }
    }
    
    .mili {
        font-size: 1.6rem !important;
    }
    
    .btns {
        width: 32vw;
        
        & button {
            width: 9.5rem;
            font-size: 1.4rem;
        }
    }
    
    .leap {
        width: 38vw;
    }
    
    .time_in_lap {
        width: 9vw;
    }
    
    .time-laped {
        & p {
            font-size: 1.4rem;
        }
    }
    
    /* Base .p class already handles this */
}

/* Landscape mode (short height screens) */
@media screen and (max-height: 400px) and (min-width: 300px) {
    .body {
        flex-direction: row;
        justify-content: space-around;
        align-items: flex-start;
        padding: 0.5rem;
    }
    
    .main {
        width: 48vw;
        height: 95vh;
        padding: 1rem;
        gap: 1rem;
        
        & h1 {
            font-size: 1.8rem;
        }
    }
    
    .time-count {
        padding: 1rem;
        
        & p {
            font-size: 2.5rem;
        }
    }
    
    .mili {
        font-size: 1rem !important;
        padding: 0.5rem;
    }
    
    .btns {
        & button {
            height: 2rem;
            font-size: 1rem;
        }
    }
    
    .leap {
        width: 48vw !important;
        height: 95vh;
        margin: 0;
        
        & h1 {
            font-size: 1.8rem;
        }
    }
    
    /* Fixed .p class for landscape - now readable */
    .p {
        font-size: 1rem;
        font-weight: 500;
        line-height: 1.3;
    }
}