* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at center, #4a90e2 0%, #2c5999 100%);
    font-family: Arial, sans-serif;
    touch-action: manipulation;
}

.game-container {
    background: rgba(44, 89, 153, 0.7);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}

@media (min-width: 600px) {
    .game-container {
        width: 400px;
        padding: 15px;
    }
}

.game-title {
    color: #fff;
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.8em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-header {
    margin-bottom: 10px;
}

.score-container {
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-size: 1.1em;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 5px;
}

.word-display {
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 5px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

#currentWord {
    color: #fff;
    font-size: 1.2em;
    font-weight: bold;
    letter-spacing: 1px;
    min-height: 24px;
    flex-grow: 1;
}

#gameCanvas {
    background: rgba(44, 89, 153, 0.9);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    touch-action: none;
    width: 100%;
    height: auto;
    max-width: 400px;
    padding: 2px;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

button {
    padding: 8px 16px;
    font-size: 1em;
    background: linear-gradient(to bottom, #ffd700, #ffa500);
    color: #000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    touch-action: manipulation;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@media (min-width: 600px) {
    button {
        padding: 12px 24px;
        font-size: 1.1em;
    }
}

button:hover:not(:disabled) {
    background: linear-gradient(to bottom, #ffd700, #ff8c00);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

button:disabled {
    background: linear-gradient(to bottom, #cccccc, #999999);
    cursor: not-allowed;
    color: #666;
}

#submitWord {
    background: linear-gradient(to bottom, #4CAF50, #45a049);
    color: white;
    min-width: 100px;
}

#submitWord:hover:not(:disabled) {
    background: linear-gradient(to bottom, #45a049, #3d8b40);
}

#restartButton {
    background: linear-gradient(to bottom, #f44336, #d32f2f);
    color: white;
}

#restartButton:hover {
    background: linear-gradient(to bottom, #d32f2f, #b71c1c);
}

.high-scores-panel {
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 5px;
    color: #fff;
}

.high-scores-panel h2 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.4em;
}

#highScoresList {
    list-style-position: inside;
    padding: 0 10px;
}

#highScoresList li {
    margin: 8px 0;
    font-size: 1.1em;
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

@keyframes tileSelect {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

@keyframes tileFall {
    0% { transform: translateY(-100%) scale(1); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes tileDisappear {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0) scale(1); }
    20% { transform: translateX(-5px) scale(0.95); }
    40% { transform: translateX(5px) scale(0.95); }
    60% { transform: translateX(-3px) scale(0.95); }
    80% { transform: translateX(3px) scale(0.95); }
}

.tile-select {
    animation: tileSelect 0.3s ease-out;
}

.tile-fall {
    animation: tileFall 0.5s ease-out;
}

.tile-disappear {
    animation: tileDisappear 0.3s ease-out;
}

.tile-invalid {
    animation: shake 0.5s ease-in-out;
}

.selected-letter {
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.words-history {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    margin-top: 15px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.words-history h3 {
    color: #fff;
    margin-bottom: 8px;
    font-size: 1.2em;
    text-align: center;
}

.words-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.word-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 5px 10px;
    color: #fff;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.word-score {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 3px;
    padding: 2px 5px;
    font-size: 0.8em;
    font-weight: bold;
}

.game-summary {
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 5px;
    color: #fff;
}

.game-summary h2 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.6em;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.final-score {
    text-align: center;
    font-size: 1.4em;
    margin-bottom: 20px;
    color: #fff;
}

.words-summary {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 5px;
    padding: 10px;
}

.words-summary h3 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 1.2em;
    text-align: center;
}

#highScoresButton {
    background: linear-gradient(to bottom, #4a90e2, #357abd);
    color: white;
    margin-left: 10px;
}

#highScoresButton:hover {
    background: linear-gradient(to bottom, #357abd, #2a5f96);
} 