:root {
    --primary-bg: #1a1a1a;
    --card-bg: rgba(255, 255, 255, 0.1);
    --card-hover: rgba(255, 255, 255, 0.2);
    --accent: #fff;
    --text-muted: #ccc;
}

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

body {
    background: url('https://i.imgur.com/yWazGMM.gif') center/cover fixed no-repeat;
    background-color: var(--primary-bg);
    color: var(--accent);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

.timer-section {
    text-align: center;
    margin-bottom: 40px;
}

.timer-display {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    font-variant-numeric: tabular-nums;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0 12px;
    height: 42px;
    backdrop-filter: blur(5px);
    transition: all 0.2s;
}

.input-wrapper:focus-within {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
}

.timer-controls input {
    width: 45px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
}

.timer-controls input::-webkit-outer-spin-button,
.timer-controls input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-suffix {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin-left: 4px;
    pointer-events: none;
}

.btn-control {
    height: 42px;
    padding: 0 20px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
}

.btn-control:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-control:active {
    transform: translateY(0);
}

.sounds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.sound-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 180px;
}

.sound-card:focus-visible, .btn-control:focus-visible, .input-wrapper:focus-within {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.sound-card:hover {
    background: var(--card-hover);
    transform: translateY(-3px);
}

.sound-card.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 15px rgba(255,255,255,0.1);
}

.sound-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
    filter: brightness(0.8) grayscale(0.3);
    transition: 0.3s;
}

.sound-card.active .sound-icon {
    filter: brightness(1) grayscale(0) drop-shadow(0 0 8px rgba(255,255,255,0.5));
}

.sound-name {
    font-weight: 500;
    margin-bottom: auto;
}

.volume-wrapper {
    width: 100%;
    margin-top: 15px;
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    visibility: hidden;
}

.sound-card.active .volume-wrapper {
    height: auto;
    opacity: 1;
    visibility: visible;
    margin-top: 10px;
}

input[type=range].volume-slider {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
    height: 20px;
    display: block;
}

input[type=range].volume-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    transition: 0.2s;
}

.sound-card:hover input[type=range].volume-slider::-webkit-slider-runnable-track {
    background: rgba(255, 255, 255, 0.5);
}

input[type=range].volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
    transition: transform 0.1s;
}

input[type=range].volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type=range].volume-slider::-moz-range-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

input[type=range].volume-slider::-moz-range-thumb {
    height: 16px;
    width: 16px;
    border: none;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}
