@font-face {
    font-family: 'Scramble';
    src: url('../fonts/scramble.ttf') format('truetype');
}

@font-face {
    font-family: 'Tilez';
    src: url('../fonts/tilez.ttf') format('truetype');
}

* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-primary, #f3f4f6);
    color: var(--text-primary, #1f2937);
    margin: 0;
    padding: 0;
    padding-top: 60px; /* Space for fixed header */
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
}

.word-list-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 400px;
}

.word-list-selector label {
    font-size: 1.1em;
    font-weight: 500;
    color: var(--text-primary, #1f2937);
}

#word-list-dropdown {
    width: 100%;
    padding: 12px 16px;
    font-size: 1em;
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    background-color: var(--bg-secondary, #ffffff);
    color: var(--text-primary, #1f2937);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#word-list-dropdown:hover {
    border-color: var(--accent-primary, #3b82f6);
}

#word-list-dropdown:focus {
    outline: none;
    border-color: var(--accent-primary, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

#word-list-dropdown optgroup {
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

#word-list-dropdown option {
    padding: 8px;
}

button {
    padding: 10px 10px;
    margin: 2px;
    font-size: 1em;
    cursor: pointer;
    border: none;
    background-color: var(--accent-primary, #3b82f6);
    color: #ffffff;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    flex-grow: 1;
    flex-basis: 30%;
    transition: background-color 0.2s ease;
}

button:hover {
    background-color: var(--accent-hover, #2563eb);
}

.button-container {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.page-title {
    width: 100%;
    max-width: 1200px;
    padding: 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-title header h1 {
    color: var(--text-primary, #1f2937);
    margin: 20px 0;
}

main {
    width: 100%;
    max-width: 1000px;
    padding: 20px;
    background-color: var(--bg-secondary, #ffffff);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    min-height: 400px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

main > * {
    width: 100%;
    text-align: center;
}

#game-mode {
    font-size: 2em;
    color: var(--text-primary, #1f2937);
    margin-bottom: 0px;
}

#game-mode-description {
    font-size: 1.2em;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 5px;
}

.small-text {
    font-size: 0.8em;
    color: var(--text-secondary, #6b7280);
}

/* Style for the Scrabble tiles - Keep authentic cream color */
.tile {
    display: inline-block;
    width: 50px;
    height: 50px;
    margin: 1px;
    background-color: #f2e6d9; /* Authentic Scrabble tile color */
    color: #333;
    font-family: 'Tilez', sans-serif;
    font-size: 4em;
    text-align: center;
    line-height: 50px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.tile:active {
    cursor: grabbing;
}

/* Style for the tiles container */
#tiles-container {
    min-height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-color, #e5e7eb);
    padding: 5px;
    max-width: 100%;
    overflow-x: auto;
    background-color: var(--bg-tertiary, #f9fafb);
    border-radius: 5px;
}

/* Placeholder style */
#tiles-container.empty::after {
    content: "Tiles will appear after selecting a game mode.";
    color: var(--text-secondary, #6b7280);
    font-size: 1em;
    text-align: center;
}

.board {
    display: grid;
    gap: 1px;
    margin-top: 20px;
    margin-bottom: 10px;
    justify-content: center;
    max-width: 100%;
    overflow-x: auto;
}

.board .cell {
    width: 50px;
    height: 50px;
    background-color: var(--bg-secondary, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary, #1f2937);
    font-family: 'Tilez', sans-serif;
    font-size: 1.0em;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.result {
    margin-top: 10px;
    margin-bottom: 10px;
    font-size: 1.5em;
    min-height: 1.5em;
    color: var(--text-primary, #1f2937);
}

#words-section {
    margin-top: 5px;
}

#words-found,
#possible-words {
    margin-top: 10px;
    font-size: 1.0em;
    color: var(--text-secondary, #6b7280);
}

/* SEO Content Section */
.seo-content {
    width: 100%;
    max-width: 1000px;
    padding: 30px 20px;
    margin: 20px auto;
    background-color: var(--bg-secondary, #ffffff);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: left;
}

.seo-content h2 {
    color: var(--text-primary, #1f2937);
    font-size: 1.5em;
    margin-bottom: 15px;
}

.seo-content h3 {
    color: var(--text-primary, #1f2937);
    font-size: 1.2em;
    margin-top: 20px;
    margin-bottom: 10px;
}

.seo-content p {
    color: var(--text-secondary, #4b5563);
    line-height: 1.7;
    margin-bottom: 15px;
}

.seo-content a {
    color: var(--accent-primary, #3b82f6);
    text-decoration: none;
}

.seo-content a:hover {
    text-decoration: underline;
}
