* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f7f7f7;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.container {
    max-width: 500px;
    width: 100%;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 1.8rem;
    color: #333;
}

.score-display {
    font-size: 1.2rem;
    color: #666;
}

.score-label {
    margin-right: 5px;
}

#score {
    font-weight: bold;
    color: #333;
}

.score-separator {
    margin: 0 2px;
    color: #999;
}

#max-score {
    color: #999;
}

/* Input display */
.input-display {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    text-align: center;
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    min-height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 10px;
}

.cursor {
    animation: blink 1s infinite;
    color: #666;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Message display */
.message {
    text-align: center;
    height: 24px;
    font-size: 0.9rem;
    margin-bottom: 15px;
    color: #666;
}

.message.error {
    color: #d63031;
}

.message.success {
    color: #00b894;
}

/* Honeycomb layout */
.honeycomb {
    position: relative;
    width: 240px;
    height: 253px;
    margin: 0 auto 20px;
}

.hexagon {
    position: absolute;
    width: 80px;
    height: 92px;
    background: #e0e0e0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.15s;
    user-select: none;
}

.hexagon:hover {
    transform: scale(1.05);
}

.hexagon:active {
    transform: scale(0.95);
}

.hexagon.center {
    background: #f7c744;
}

.hexagon.center:hover {
    background: #f5bc1e;
}

/* Hexagon positions - honeycomb pattern with touching edges */
.hexagon:nth-child(1) { /* Center */
    left: 80px;
    top: 80px;
}

.hexagon:nth-child(2) { /* Right */
    left: 160px;
    top: 80px;
}

.hexagon:nth-child(3) { /* Top right */
    left: 120px;
    top: 11px;
}

.hexagon:nth-child(4) { /* Bottom right */
    left: 120px;
    top: 149px;
}

.hexagon:nth-child(5) { /* Left */
    left: 0px;
    top: 80px;
}

.hexagon:nth-child(6) { /* Bottom left */
    left: 40px;
    top: 149px;
}

.hexagon:nth-child(7) { /* Top left */
    left: 40px;
    top: 11px;
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 0.3s ease-in-out;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.control-btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    border: 2px solid #ddd;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.15s;
}

.control-btn:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.control-btn:active {
    transform: scale(0.95);
}

.shuffle-btn {
    border-radius: 50%;
    width: 56px;
    height: 56px;
    padding: 0;
    font-size: 0.85rem;
}

.enter-btn {
    background: #333;
    color: white;
    border-color: #333;
}

.enter-btn:hover {
    background: #444;
    border-color: #444;
}

/* Found words section */
.found-words-section {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.found-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 500;
}

.new-game-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.new-game-btn:hover {
    background: #f0f0f0;
}

.found-words {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.found-word {
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.found-word.pangram {
    background: #f7c744;
    font-weight: bold;
}

.found-word .points {
    color: #666;
    font-size: 0.8rem;
    margin-left: 4px;
}

/* Loading overlay */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.loading.hidden {
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top-color: #f7c744;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 400px) {
    .honeycomb {
        transform: scale(0.85);
        margin-bottom: 0;
    }

    .controls {
        gap: 8px;
    }

    .control-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }
}
