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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(250deg, #7C3085 0%, #c091c1 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 700px;
    width: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

h1 {
    font-family: Avenir, sans-serif;
    font-size: 8rem;
    color: rgb(252, 56, 35);
    margin-bottom: 10px;
}

.subtitle {
    color: #616061;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.clear-data-btn {
    padding: 6px 12px;
    background: transparent;
    color: #888;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.clear-data-btn:hover {
    background: #f8f8f8;
    color: #666;
    border-color: #ccc;
}

.show-everything-btn {
    padding: 6px 12px;
    background: transparent;
    color: #888;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
    margin-left: 8px;
}

.show-everything-btn:hover {
    background: #f8f8f8;
    color: #666;
    border-color: #ccc;
}

.show-everything-btn.active {
    background: #611f69;
    color: white;
    border-color: #611f69;
}

.show-everything-btn.active:hover {
    background: #4a154b;
    border-color: #4a154b;
}

.show-everything-btn.hidden {
    display: none;
}

.puzzle-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 8px;
}

.nav-button {
    padding: 10px 20px;
    background: #611f69;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-button:hover:not(:disabled) {
    background: #4a154b;
}

.nav-button:disabled {
    background: #e0e0e0;
    color: #aaa;
    cursor: not-allowed;
}

.puzzle-indicator {
    font-size: 16px;
    font-weight: 700;
    color: #611f69;
    min-width: 120px;
    text-align: center;
}

.game-info {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.attempts-left {
    font-size: 1.1rem;
    color: #1d1c1d;
}

.attempts-left strong {
    color: #611f69;
    font-size: 1.3rem;
}

.test-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.test-button {
    padding: 8px 16px;
    background: #e0e0e0;
    color: #1d1c1d;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.test-button:hover {
    background: #d0d0d0;
}

#messageIndex {
    font-size: 14px;
    font-weight: 600;
    color: #616061;
    min-width: 70px;
    text-align: center;
}

/* Slack-style message card */
.message-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 28px;
    margin-bottom: 25px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-header {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
}

.avatar-container {
    flex-shrink: 0;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 5px;
    background-size: cover;
    background-position: center;
    background-color: #e0e0e0;
}

.avatar.hidden {
    visibility: hidden;
}

.avatar.pixelated {
    filter: blur(8px) brightness(0.9);
    image-rendering: pixelated;
}

.message-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.username {
    font-weight: 700;
    color: #1d1c1d;
    font-size: 18px;
}

.username.hidden {
    color: #ccc;
}

.timestamp {
    font-size: 14px;
    color: #616061;
    display: flex;
    gap: 6px;
}

.channel {
    font-size: 14px;
    color: #1264a3;
    font-weight: 500;
}

.channel.hidden {
    color: #ccc;
}

.hidden {
    opacity: 0.3;
}

.message-content {
    margin-top: 10px;
    padding-left: 64px;
    line-height: 1.5;
    color: #1d1c1d;
    font-size: 18px;
}

.message-content p {
    white-space: pre-line;
}

.slack-emoji {
    display: inline-block;
    width: 26px;
    height: 26px;
    vertical-align: middle;
    margin: 0 2px;
}

.mention {
    color: #1264a3;
    font-weight: 600;
    background-color: rgba(18, 100, 163, 0.1);
    padding: 3px 5px;
    border-radius: 3px;
}

.mention-special {
    color: #946a00;
    font-weight: 600;
    background-color: rgba(255, 196, 0, 0.15);
    padding: 3px 5px;
    border-radius: 3px;
}

.message-images {
    margin-top: 14px;
    padding-left: 64px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.message-images img {
    max-width: 400px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: transform 0.2s;
}

.message-images img:hover {
    transform: scale(1.02);
}

.message-reactions {
    margin-top: 8px;
    padding-left: 64px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #fff;
    border: 1px solid #d1d2d3;
    border-radius: 12px;
    font-size: 12px;
    color: #1d1c1d;
    transition: background-color 0.1s, border-color 0.1s;
    cursor: pointer;
    user-select: none;
}

.reaction-pill:hover {
    background: #f8f8f8;
    border-color: #b8b9ba;
}

.reaction-pill.reacted {
    background: #e8f5fa;
    border-color: #1264a3;
}

.reaction-pill.reacted .reaction-count {
    color: #1264a3;
}

.reaction-pill .reaction-emoji {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.reaction-pill .reaction-count {
    font-weight: 600;
    font-size: 11px;
    line-height: 1;
}

/* Game controls */
.game-controls {
    margin-bottom: 25px;
}

.input-section {
    display: flex;
    gap: 10px;
}

#guessInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s;
}

#guessInput:focus {
    outline: none;
    border-color: #611f69;
}

button {
    padding: 12px 24px;
    background: #611f69;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: #4a154b;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Feedback */
.feedback {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.feedback.correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Guess history */
.guess-history {
    margin-top: 25px;
}

.guess-history h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #1d1c1d;
}

#guessList {
    list-style: none;
}

#guessList li {
    padding: 10px;
    margin-bottom: 8px;
    background: #f8f8f8;
    border-radius: 6px;
    border-left: 4px solid #611f69;
}

/* Game over screen */
.game-over {
    text-align: center;
    padding: 30px;
    background: #f8f8f8;
    border-radius: 8px;
    margin-bottom: 20px;
}

.game-over.hidden {
    display: none;
}

.game-over h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #1d1c1d;
}

.game-over.win h2 {
    color: #2d9d78;
}

.game-over.lose h2 {
    color: #e01e5a;
}

.stats {
    margin: 20px 0;
    font-size: 1.1rem;
}

.share-button {
    margin-top: 15px;
    background: #007a5a;
}

.share-button:hover {
    background: #006644;
}

/* Responsive design */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    .input-section {
        flex-direction: column;
    }

    button {
        width: 100%;
    }

    .message-content,
    .message-images,
    .message-reactions {
        padding-left: 0;
    }

    .message-card {
        padding: 20px;
    }

    .avatar {
        width: 42px;
        height: 42px;
    }

    .username {
        font-size: 16px;
    }

    .message-content {
        font-size: 16px;
    }

    .message-images img {
        max-width: 100%;
    }

    .game-info {
        flex-direction: column;
        align-items: stretch;
    }

    .puzzle-controls {
        gap: 10px;
    }

    .nav-button {
        padding: 8px 16px;
        font-size: 13px;
    }

    .puzzle-indicator {
        min-width: 100px;
        font-size: 14px;
    }
}
