@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@400;700&display=swap');

/* --- Global Styles --- */
body {
    font-family: 'Sarabun', sans-serif;
    background-color: #f4f7f6;
    margin: 0;
    padding: 0;
    color: #333;
    line-height: 1.6;
}

header {
    background: #007bff;
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

h1 { margin: 0; font-size: 2.2em; }
h2 { 
    color: #007bff; 
    border-bottom: 2px solid #007bff;
    padding-bottom: 5px;
    margin-top: 35px;
    font-size: 1.6em;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

/* --- Controls Section --- */
.controls {
    background: #e9ecef;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.controls label {
    font-weight: bold;
    margin-right: 10px;
}

select {
    padding: 7px 12px;
    font-size: 1em;
    border-radius: 5px;
    border: 2px solid #007bff;
    cursor: pointer;
    background-color: white;
}

/* --- Code Grid --- */
.code-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.code-card {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    text-align: center;
    transition: 0.2s;
}

.code-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.2);
}

.character {
    display: block;
    font-size: 3em;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.morse-code {
    display: block;
    font-size: 1.4em;
    font-family: monospace;
    color: #dc3545;
    margin-bottom: 10px;
}

/* --- Buttons --- */
.play-button {
    padding: 8px 15px;
    border: none;
    background: #28a745;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.2s;
}

.play-button:hover {
    background: #1e7e34;
}

.play-button:disabled {
    background: #888;
    cursor: not-allowed;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 15px;
    margin-top: 30px;
    background: #eee;
    color: #666;
    border-top: 1px solid #ddd;
    font-size: 0.9em;
}
footer a {
    color: #007bff;
    text-decoration: none;
}
footer a:hover {
    text-decoration: underline;
}