#cw-generator {
    border: 2px solid #BF4230;
    padding: 20px;
    max-width: 600px;
    margin: 20px 0px;
    font-family: Arial, sans-serif;
    position: relative;  /* Für Verlauf, falls nötig */
    background: #fff;
    font-family: 'Courier New', monospace;
}

#cw-text {
    width: 100%;
    height: 80px;
    border: 1px solid #ccc;
    padding: 5px;
    font-size: 14px;
}

.cw-controls {
    margin-top: 15px;
}

#wpm-slider, #freq-slider, #pause-slider {
    width: 100%;
}

.wpm-presets button {
    margin-right: 5px;
}

.cw-controls label,
.cw-controls input[type="range"],
.wpm-presets {
    margin-top: 10px;
    display: block;
}

/* Wrapper für die Anzeige */
#cw-display-wrapper {
    width: 100%;
    overflow: hidden;    /* Alles was rausguckt, wird abgeschnitten */
    margin-top: 30px;
    display: flex;
    justify-content: center;   /* Zentriert das Grid */
}

/* Das Grid selbst */
#cw-display-grid {
    display: grid;
    grid-template-rows: auto auto;
    width: calc(21 * 39px);   /* Feste Breite für 21 Boxen */
}

/* Die Reihen */
.cw-row {
    display: grid;
    grid-template-columns: repeat(21, 35px);
    gap: 4px;
}

/* Boxen */
.cw-box {
    width: 35px;
    height: 40px;
    text-align: center;
    line-height: 40px;
    font-size: 2rem;
    color: #ccc;
}

.cw-box.active {
    color: #B71C1C;
    font-weight: bold;
}

.cw-box.gray {
    color: #999;
}

/* Optional: Fade-Effekt links und rechts */
#cw-generator::before,
#cw-generator::after {
    content: "";
    position: absolute;
    top: 70px;  /* Anpassen je nach Position */
    width: 30px;
    height: 80px;  /* Höhe der zwei Reihen */
    z-index: 2;
}

#cw-generator::before {
    left: 0;
    background: linear-gradient(to right, #fff, rgba(255,255,255,0));
}

#cw-generator::after {
    right: 0;
    background: linear-gradient(to left, #fff, rgba(255,255,255,0));
}

#cw-start {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 10px;
}

#cw-start:hover {
    background-color: #45a049;
}

#cw-stop {
    background-color: #e53935;
    color: white;
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px;
}

#cw-stop:hover {
    background-color: #d32f2f;
}

#cw-text-display {
    font-family: 'Courier New', monospace;
    color: #666;
    margin-top: 20px;
    text-align: center;
    word-break: break-word;
}
#cw-text-display .active {
    color: #B71C1C;
    font-weight: bold;
}
