/* --- Stopwatch Wrapper (Matches Connect Four Theme) --- */
#sw-wrapper {
    font-family: 'Press Start 2P', monospace; /* Fallback to monospace if font not loaded */
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background-color: #111827; /* Gray 900 */
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 2px solid #374151; /* Gray 700 */
    color: white;
}

/* --- Display Area --- */
.sw-display-container {
    background-color: #000;
    border: 4px solid #333;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    width: 100%;
    text-align: center;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
    position: relative;
    overflow: hidden;
}

/* Glass reflection effect on display */
.sw-display-container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.05), transparent);
    pointer-events: none;
}

.sw-time {
    font-size: 3rem;
    color: #00FFFF; /* Glitch Cyan */
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    letter-spacing: 2px;
    line-height: 1;
}

.sw-millis {
    font-size: 1.5rem;
    color: #FF00FF; /* Glitch Magenta */
}

/* --- Controls --- */
.sw-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
    margin-bottom: 20px;
}

.sw-btn {
    padding: 15px 10px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 4px 0 rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.sw-btn:active:not(:disabled) {
    transform: translateY(4px);
    box-shadow: none;
}

.sw-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
}

/* Specific Button Colors */
.sw-btn.start {
    background-color: #10b981; /* Green */
    color: #064e3b;
    border-bottom: 4px solid #059669;
}

.sw-btn.stop {
    background-color: #ef4444; /* Red */
    color: #7f1d1d;
    border-bottom: 4px solid #dc2626;
}

.sw-btn.lap {
    background-color: #3b82f6; /* Blue */
    color: #1e3a8a;
    border-bottom: 4px solid #2563eb;
}

.sw-btn.reset {
    background-color: #f59e0b; /* Yellow/Orange */
    color: #78350f;
    border-bottom: 4px solid #d97706;
}

/* --- Laps Panel --- */
.sw-laps-panel {
    width: 100%;
    background-color: #1f2937;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #374151;
}

.sw-laps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 2px solid #374151;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: #9ca3af;
}

#sw-laps-list {
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Press Start 2P', monospace, sans-serif; /* Better for alignment */
}

/* Custom Scrollbar for Laps */
#sw-laps-list::-webkit-scrollbar {
    width: 8px;
}
#sw-laps-list::-webkit-scrollbar-track {
    background: #111; 
}
#sw-laps-list::-webkit-scrollbar-thumb {
    background: #4b5563; 
    border-radius: 4px;
}

.sw-lap-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 4px;
    border-bottom: 1px solid #374151;
    color: #d1d5db;
    font-size: 0.9rem;
}

.sw-lap-item:first-child {
    color: #00FFFF; /* Highlight most recent lap */
    font-weight: bold;
}

.sw-lap-index {
    color: #6b7280;
    width: 40px;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .sw-time { font-size: 2rem; }
    .sw-millis { font-size: 1rem; }
    #sw-wrapper { padding: 15px; }
}