* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body, html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    transition: background-color 0.4s, color 0.2s;
}

body {
    background-color: #DFD3C3;
    color: #37353E;
}

.main-table {
    width: 100%;
    height: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.main-table td {
    padding: 7px;
    vertical-align: middle;
}

.parent-cell {
    width: 35%;
    height: 100%;
    position: relative;
    text-align: center;
}

#theme-toggle {
    color: #37353E;
    position: absolute;
    top: 24px;
    right: 16px;
    background: transparent;
    font-size: 18px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s;
    text-shadow: 3px 3px 8px #37353E80;
}

#theme-toggle:hover { transform: scale(1.50); }

#parent-time {
    color: #3E5F44;
    font-size: 3.4rem;
    font-weight: bold;
    margin-bottom: 40px;
    width: 100%;
}

.button-container {
    display: flex;
    gap: 18px;
    justify-content: center;
}

#pause-button, #reset-button {
    max-width: 160px;
    padding: 16px;
    font-size: 17px;
    color: #37353E;
    background: transparent;
    border: 1px solid #37353E;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    flex: 1;
    transition: all 0.3s;
}

#pause-button { display: none; }

#pause-button:hover, #reset-button:hover {
    color: #DFD3C3;
    border: none;
    transform: scale(0.94);
}

#pause-button:hover { background: #3E5F44; }
#reset-button:hover { background: #C44A3A; }

.ot-switch-container {
    position: absolute;
    bottom: 24px;
    left: 24px;
    box-sizing: border-box;
}

.ot-switch-container input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10;
    width: 100%;
    height: 100%;
    cursor: pointer;
    opacity: 0;
}

.ot-switch-container label {
    position: relative;
    display: flex;
    box-sizing: border-box;
}

.ot-switch-container label:before {
    content: "";
    width: 24px;
    height: 14px;
    background: #C44A3A;
    background-size: 14px;
    border-radius: 50%;
    display: inline-block;
    transition: all 0.3s ease-in;
    box-shadow: 3px 3px 8px #37353E80;
}

.ot-switch-container label:after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border: 3px solid white;
    border-radius: 50%;
    left: 0;
    bottom: 0;
    background: #C44A3A;
    box-sizing: border-box;
    transition: all 0.3s ease-in;
}

.ot-switch-container input[type="checkbox"]:checked + label:before {
    background: #3E5F44;
}

.ot-switch-container input[type="checkbox"]:checked + label:after {
    left: 10px;
    background: #3E5F44;
}

.ot-amount {
    position: absolute;
    bottom: 20px;
    left: 58px;
    font-size: 1rem;
    color: #37353E;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.ot-amount.visible {
    opacity: 1;
    transform: translateX(0);
}

.data-button-container {
    position: absolute;
    bottom: 24px;
    right: 16px;
}

.data-button-container svg {
    width: 20px;
    height: 20px;
    fill: #37353E;
}

#copy-button, #paste-button {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

#paste-button { margin-left: 10px; }

#copy-button:hover, #paste-button:hover {
    transform: scale(1.50);
}

.children-cell { 
    width: 65%; 
    height: 100%; 
}

.grid-table {
    width: 100%;
    height: 100%;
    border-collapse: collapse;
}

.grid-table td { padding: 7px; }

.child-card {
    border-radius: 15px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.4s;
    box-shadow: 1px 1px #37353e4d;
}

.child-card:hover { transform: scale(1.03); }

.group-a { background-color: #D5C7A3; }
.group-b { background-color: #BDB395; }
.group-break { background-color: #f2e2b180; }

.child-label {
    font-size: 1.15rem;
    font-weight: bold;
    margin-bottom: 7px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-display {
    font-size: 2.2rem;
    font-weight: bold;
    padding: 18px 10px;
    width: 100%;
    min-height: 95px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.child-card.running {
    color: #3E5F44;
    background: transparent;
    transform: scale(1.20);
    box-shadow: none;
}

#mars-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: #3E5F44;
    color: #DFD3C3;
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: bold;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 9999;
    white-space: nowrap;
}

#mars-toast.visibility {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

#mars-toast.error { background: #C44A3A; }


/* _____ DARK THEME _____ */

body.dark {
    background-color: #1A1A1D;
    color: #D3DAD9;
}

body.dark #theme-toggle {
    color: #D3DAD9;
}

body.dark #parent-time { color: #4ade80; }

body.dark #pause-button,
body.dark #reset-button {
    background: transparent;
    color: #D3DAD9;
    border: 1px solid #D3DAD9;
}

body.dark #pause-button:hover,
body.dark #reset-button:hover {
    color: #1A1A1D;
    border: none;
}

body.dark #pause-button:hover { background: #4ade80; }
body.dark #reset-button:hover { background: #DC2525; }

body.dark .ot-switch-container label:before,
body.dark .ot-switch-container label:after {
    background: #DC2525;
}

body.dark .ot-switch-container input[type="checkbox"]:checked + label:before,
body.dark .ot-switch-container input[type="checkbox"]:checked + label:after {
    background: #4ade80;
}

body.dark .ot-amount { color: #D3DAD9; }

body.dark .data-button-container svg { fill: #D3DAD9; }

body.dark .child-card {
    box-shadow: 1px 1px black;
}

body.dark .group-a { background-color: #31363F; }
body.dark .group-b { background-color: #222831; }
body.dark .group-break { background-color: #34495580; }

body.dark .child-card.running {
    color: #4ade80;
    background: transparent;
    box-shadow: none;
}

body.dark #mars-toast {
    background: #4ade80;
    color: #1A1A1D;
}

body.dark #mars-toast.error {
    background: #DC2525;
    color: #1A1A1D;
}