* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #0a0a0a;
    color: #ffffff;
    height: 100vh;
    overflow: hidden;
}

.clock-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: relative;
}

.clock-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #1a1a1a;
}

.clock-area.active {
    background-color: #104020; /* Dark Green for active */
    box-shadow: inset 0 0 50px rgba(32, 128, 64, 0.5);
}

.clock-area.active.byo-yomi {
    background-color: #502800; /* Dark Orange for Byo-yomi */
    box-shadow: inset 0 0 50px rgba(160, 80, 0, 0.5);
}

.clock-area.active.warning {
    background-color: #500000; /* Dark Red for low time */
    box-shadow: inset 0 0 50px rgba(160, 0, 0, 0.5);
}

.clock-area.inactive {
    background-color: #0d0d0d;
    color: #666666;
}

.clock-area.lost {
    background-color: #1a0000;
    color: #ff3333;
}

.player-2 {
    transform: rotate(180deg);
    border-bottom: 2px solid #333;
}

.player-label {
    font-size: 2rem;
    font-weight: 600;
    opacity: 0.6;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.time-display {
    font-size: 6rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -2px;
}

.byo-info {
    font-size: 1.5rem;
    font-weight: 600;
    opacity: 0.8;
    margin-top: 10px;
}

.controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 20px;
    background: rgba(25, 25, 25, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px 30px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.controls button {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: white;
    transition: transform 0.2s;
    outline: none;
}

.controls button:active {
    transform: scale(0.9);
}

.quick-selectors {
    position: absolute;
    top: calc(50% + 45px);
    left: 50%;
    transform: translate(-50%, 0);
    display: flex;
    gap: 15px;
    z-index: 10;
}

.quick-selectors button {
    background: rgba(25, 25, 25, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.quick-selectors button:hover {
    background: rgba(32, 128, 64, 0.8);
}

.quick-selectors button:active {
    transform: scale(0.9);
}

.d-none {
    display: none !important;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #1e1e1e;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.modal-content h2 {
    margin-bottom: 20px;
    text-align: center;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #aaa;
}

.setting-group input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #0a0a0a;
    color: white;
    font-size: 1.1rem;
    outline: none;
}

.setting-group input:focus {
    border-color: #208040;
}

.btn-save, .btn-cancel {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
}

.btn-save {
    background: #208040;
    color: white;
}

.btn-save:hover {
    background: #28a050;
}

.btn-cancel {
    background: transparent;
    color: #888;
    margin-top: 5px;
}

.btn-cancel:hover {
    color: white;
}

@media (max-width: 600px) {
    .time-display {
        font-size: 5rem;
    }
}
