/* Define CSS variables for easier theme management */
:root {
    --color-primary-bg-start: rgb(20, 70, 180);
    --color-primary-bg-end: rgb(60, 0, 80);
    --color-text: white;
    --color-accent-gold: #FFD700;
    --color-accent-yellow: #FFFF00;
    --color-container-bg: rgba(0, 0, 0, 0.75);
    --color-shadow: rgba(255, 255, 0, 0.5);
    --color-button-play-bg: #28a745;
    --color-button-play-text: white;
    --color-button-stop-bg: #dc3545;
    --color-button-stop-text: white;
    --font-family-main: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --border-radius-medium: 0.75rem;
    --border-radius-small: 0.5rem;
}

/* Basic reset and body styling */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px; /* Base font size */
}

body {
    background: linear-gradient(to bottom, var(--color-primary-bg-start), var(--color-primary-bg-end));
    color: var(--color-text);
    font-family: var(--font-family-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-y: auto; /* Prevents scrollbars from star overflow */
    position: relative; /* Needed for absolute positioning of stars */
    padding: 2rem 1rem; /* Add padding for smaller screens */
}

/* Star background styles */
#star-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.3; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.1); }
}

/* Main container styling */
.container {
    background: var(--color-container-bg);
    border-radius: var(--border-radius-medium);
    padding: clamp(1.5rem, 5vw, 3rem);
    text-align: center;
    box-shadow: 0 0 25px var(--color-shadow);
    max-width: 600px;
    width: 90%;
    z-index: 1;
}

h1 {
    color: var(--color-accent-gold);
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

h2 {
    color: var(--color-accent-yellow);
    font-size: clamp(1rem, 3vw, 1.5rem);
    margin-bottom: 2rem;
    font-weight: 400;
}

/* Control groups styling */
.controls {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem; /* Increased gap slightly between controls */
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem; /* Space within a control group */
}

label {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text);
}

/* Slider styling */
input[type="range"] {
    width: 100%;
    max-width: 300px;
    accent-color: var(--color-accent-gold);
    cursor: pointer;
    height: 8px;
    background: #555;
    border-radius: 5px;
    appearance: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--color-accent-gold);
    border-radius: 50%;
    border: 2px solid var(--color-container-bg);
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--color-accent-gold);
    border-radius: 50%;
    border: 2px solid var(--color-container-bg);
    cursor: pointer;
}

/* General value display */
.value-display {
    font-size: 1.1rem;
    color: var(--color-accent-yellow);
    min-height: 1.5em;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 500;
}

/* Styling for the description area */
.description-area {
    margin-top: 0.5rem;
    font-family: var(--font-family-main);
    font-size: 1.0rem;
    color: var(--color-text);
    max-width: 450px; /* Slightly wider */
    line-height: 1.5;
    text-align: left;
    padding-left: 1em;
    min-height: 4.5em;
    font-weight: 400;
    border-left: 2px solid var(--color-accent-yellow); /* Add a visual separator */
    padding-left: 0.8em; /* Adjust padding for border */
}

/* Styling for the ACTUAL FREQUENCY display */
.actual-freq-display {
    font-weight: 600; /* Make it bolder */
    color: var(--color-accent-gold); /* Use gold color */
    font-size: 1.2rem; /* Slightly larger */
}


/* Select dropdown styling */
select#frequency-select {
    padding: 0.6rem 1.2rem;
    font-size: 1.1rem;
    border-radius: var(--border-radius-small);
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--color-text);
    border: 1px solid var(--color-accent-yellow);
    cursor: pointer;
    min-width: 280px; /* Wider dropdown */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFD700%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.8em auto;
    padding-right: 3rem;
}

select#frequency-select:focus {
    outline: 2px solid var(--color-accent-gold);
    outline-offset: 2px;
    box-shadow: 0 0 10px var(--color-accent-gold);
}

select#frequency-select option {
    background-color: var(--color-primary-bg-end);
    color: var(--color-text);
}

/* Button styling - Keep as is */
.button {
    padding: 0.8rem 1.8rem;
    font-size: 1.3rem;
    font-weight: 600;
    border-radius: var(--border-radius-small);
    cursor: potter; /* Should be pointer */
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;

    background-color: var(--color-button-play-bg);
    color: var(--color-button-play-text);
}

.button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.button.active {
    background-color: var(--color-button-stop-bg);
    color: var(--color-button-stop-text);
}

.button:focus-visible,
input[type="range"]:focus-visible,
select:focus-visible {
    outline: 3px solid var(--color-accent-gold);
    outline-offset: 3px;
}

.button:focus:not(:focus-visible),
input[type="range"]:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
    outline: none;
}

.button svg {
    display: inline-block;
    vertical-align: middle;
}
