/* Add your styles here */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: Arial, sans-serif;
    padding: 0;
    text-align: center;
    background-color: #f4f4f4;
}

h1 {
    color: #333;
    margin: 0;
}

#header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

#header-top {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

#language-selector {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

#language-selector:hover {
    border-color: #999;
}

#logo {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}

.logo-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 20px;
    font-weight: bold;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #333;
}

.validation-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: left;
}

#app {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex: 1;
}

textarea {
    width: 100%;
    min-height: 100px;
    margin-bottom: 20px;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    resize: none; /* Disable manual resizing */
    overflow: hidden; /* Hide scrollbars */
}

textarea:focus {
    outline: none;
}

/* Automatically adjust the height of the textarea */
textarea.auto-expand {
    overflow-y: hidden;
}

#tile-tracker {
    text-align: left;
    margin-bottom: 20px;
}

#solved-tile-tracker {
    text-align: left;
    margin-bottom: 20px;
}

/* Green background on outer page when solved */
body.solved {
    background-color: #d4edda;
}

.tile-grid {
    display: flex;
    flex-wrap: wrap; /* Ensure all tiles wrap within a single grid */
    gap: 10px; /* Add spacing between tiles */
    justify-content: center; /* Center the tiles within the grid */
    margin-top: 20px;
}

/* Remove unnecessary tile-row class to avoid breaking layout */
.tile-row {
    display: unset; /* Reset to default behavior */
    flex-wrap: unset; /* Remove wrapping from individual rows */
    gap: unset; /* Remove extra spacing */
    justify-content: unset; /* Remove centering from individual rows */
    width: unset; /* Remove forced full width */
}

/* Update styles for separate option */
.tile-column {
    display: flex;
    flex-wrap: wrap; /* Allow tiles to wrap within each column */
    gap: 10px; /* Add spacing between tiles */
    justify-content: center; /* Center tiles within each column */
    margin-bottom: 20px; /* Add spacing between columns */
    width: 100%; /* Force each category to take up the full row */
}

.tile {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.tile.used {
    background: #ddd;
    color: #aaa;
    text-decoration: line-through;
}

.tile.overused {
    background: #ffcccc;
    color: #900;
    font-weight: bold;
}

.tile.blank {
    background: #cce5ff;
    color: #004085;
    font-weight: bold;
    border: 1px solid #b8daff;
}

/* Update blank tile style when overused tiles are present */
.tile.blank.overused {
    background: #ffcccc;
    color: #900;
    font-weight: bold;
    border: 1px solid #900;
}

.tile.blank.empty {
    background: #cce5ff;
    border: 1px dashed #b8daff;
    color: transparent;
}

.tile.blank.empty.overused {
    background: #ffcccc;
    border: 1px dashed #900;
}

.tile.stacked.used {
    background: #ddd;
    color: #aaa;
    text-decoration: line-through;
}

.tile.placeholder {
    visibility: hidden;
    width: 30px;
    height: 30px;
}

button {
    padding: 10px 20px;
    font-size: 16px;
    color: #fff;
    background-color: #007BFF;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}

#success-message {
    margin-top: 20px;
    padding: 15px;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

footer {
    margin-top: auto;
    padding: 15px;
    background-color: #f8f9fa;
    border-top: 1px solid #ddd;
    text-align: center;
    font-size: 14px;
    color: #6c757d;
}

footer p {
    margin: 0;
    line-height: 1.5;
}

/* Style for the tile counter */
.tile-counter {
    font-size: 18px;
    font-weight: bold;
    margin-top: 10px;
    color: #333;
    text-align: center;
}

/* Style for stacked tiles with counters */
.tile.stacked {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    font-size: 18px;
    font-weight: bold;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin: 5px;
}

.tile.stacked .counter {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 12px;
    color: #555;
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
}

.tile.blank.stacked {
    background: #cce5ff;
    color: #004085;
    font-weight: bold;
    border: 1px solid #b8daff;
    width: 50px;
    height: 50px;
    font-size: 18px;
}

.tile.blank.empty.stacked {
    background: #cce5ff;
    border: 1px dashed #b8daff;
    color: transparent;
    width: 50px;
    height: 50px;
}

.tile.blank.stacked.overused, .tile.stacked.overused, 
.tile.blank.empty.stacked.overused {
    background-color: #ffcccc;
    color: #900;
}

.tile.blank.stacked.overused,
.tile.blank.empty.stacked.overused {

    border: 1px solid #900;
}