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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #e8f0fe 0%, #f0e6f6 50%, #fce4ec 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    transition: max-width 0.3s ease;
}

.container.game-active {
    max-width: 720px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #4a2c82;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Input */
.input-group {
    display: flex;
    gap: 0.5rem;
}

#word-input {
    flex: 1;
    font-size: 1.4rem;
    padding: 0.75rem 1rem;
    border: 3px solid #ccc;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s;
}

#word-input:focus {
    border-color: #7c4dff;
}

button[type="submit"] {
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    background: #7c4dff;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

button[type="submit"]:hover {
    background: #651fff;
}

button[type="submit"]:active {
    transform: scale(0.96);
}

/* Result area */
.result-area {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 16px;
    animation: fadeIn 0.3s ease;
}

.result-area.hidden {
    display: none;
}

.result-area.hit {
    background: white;
    box-shadow: 0 4px 20px rgba(124, 77, 255, 0.15);
    border: 2px solid #e0d4f5;
}

.result-area.miss {
    background: #fff3e0;
    border: 2px solid #ffe0b2;
}

.result-title {
    font-size: 1.5rem;
    color: #4a2c82;
    margin-bottom: 1rem;
}

.riddle-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #444;
}

.riddle-content p {
    margin-bottom: 0.3rem;
}

.photo-content {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 12px;
    margin-top: 0.5rem;
}

.game-frame {
    width: 100%;
    height: 700px;
    border: none;
    border-radius: 12px;
    margin-top: 0.5rem;
    background: white;
}

.hint {
    margin-top: 1rem;
    font-size: 1.1rem;
    font-style: italic;
    color: #7c4dff;
    font-weight: 500;
}

.miss-text {
    font-size: 1.1rem;
    color: #e65100;
}

/* Word log */
.word-log {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid rgba(0,0,0,0.08);
}

.word-log h2 {
    font-size: 1rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.word-chip {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: white;
    border: 1.5px solid #ddd;
    border-radius: 20px;
    font-size: 0.95rem;
    color: #555;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.word-chip:hover {
    background: #f0e6f6;
    border-color: #b39ddb;
}

.word-chip.correct {
    background: #e8f5e9;
    border-color: #a5d6a7;
    color: #2e7d32;
}

.empty-state {
    font-size: 0.95rem;
    color: #aaa;
    font-style: italic;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }

    #word-input {
        font-size: 1.1rem;
    }

    .game-frame {
        height: 500px;
    }
}
