* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0b091f, #11101d, #01010c);
    color: #fff;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

h1 {
    text-align: center;
    font-size: 3em;
    margin-bottom: 20px;
    text-shadow: none;
}

/* Make title clickable */
h1:hover {
    cursor: pointer;
    transform: scale(1.05);
    transition: transform 0.2s;
}

.subtitle {
    text-align: center;
    font-size: 1.2em;
    margin-bottom: 40px;
    color: #ffd700;
}

.search-container {
    position: relative;
    margin-bottom: 30px;
}

#characterSearch {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #ffd700;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    outline: none;
    transition: all 0.3s;
}

#characterSearch:focus {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.search-results {
    position: absolute;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: rgba(20, 20, 40, 0.95);
    border: 2px solid #ffd700;
    border-radius: 10px;
    margin-top: 5px;
    z-index: 100;
    display: none;
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-result-item:hover {
    background: rgba(255, 215, 0, 0.2);
}

.search-result-item strong {
    color: #ffd700;
    font-weight: bold;
}

.search-result-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #ffd700;
}

.guesses-count {
    text-align: center;
    font-size: 1.3em;
    margin-bottom: 35px;
    color: #ffd700;
}

.hints-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.hint-btn {
    padding: 15px 25px;
    font-size: 0.9em;
    border: none;
    border-radius: 8px;
    background: rgba(50, 50, 70, 0.8);
    color: rgba(255, 215, 0, 0.5);
    cursor: not-allowed;
    transition: all 0.3s;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.hint-btn:not(:disabled) {
    background: linear-gradient(135deg, #f39c12, #ffd700);
    color: #000;
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(255, 215, 0, 0.4);
}

.hint-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(255, 215, 0, 0.6);
}

.hint-btn:active:not(:disabled) {
    transform: translateY(0);
}

.hint-btn:disabled {
    opacity: 0.4;
}

/* Add small label showing attempts needed */
.hint-btn::after {
    content: attr(data-attempts);
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75em;
    color: #888;
    white-space: nowrap;
}

.hint-display {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #ffd700;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 40px;
    min-height: 60px;
    font-size: 1.2em;
    text-align: center;
    display: none;
}

.hint-display.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.guesses-grid {
    margin-top: 50px;
}

.guess-row {
    display: grid;
    grid-template-columns: 100px repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

/* Header row for category labels */
.header-row {
    margin-bottom: 25px;
    border-bottom: 3px solid #ffd700;
    padding-bottom: 15px;
}

.header-cell {
    padding: 10px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
    color: #ffd700;
    text-transform: uppercase;
}

/* Character image in guess rows */
.guess-image-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}

.guess-character-img {
    width: 95px;
    height: 95px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid #ffd700;
    transition: transform 0.2s;
}

.guess-character-img:hover {
    transform: scale(1.05);
}

/* Make guess cells square with better reveal animation */
.guess-cell {
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.2);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    opacity: 0;
    transform: scale(0.7);
}

.guess-cell.reveal {
    animation: revealCell 0.6s ease forwards;
}

@keyframes revealCell {
    0% {
        opacity: 0;
        transform: scale(0.7);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.guess-cell.correct {
    background: #2ecc71;
    border-color: #27ae60;
}

.guess-cell.close {
    background: #f39c12;
    border-color: #e67e22;
}

.guess-cell.wrong {
    background: #e74c3c;
    border-color: #c0392b;
}

/* Winning row animation */
.guess-row.winning {
    animation: winningRowPulse 1s ease infinite;
}

@keyframes winningRowPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(46, 204, 113, 0);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 30px rgba(46, 204, 113, 0.6);
    }
}

/* Remove cell label styles since we're not using them anymore */
.cell-label {
    display: none;
}

.win-message {
    text-align: center;
    font-size: 2.5em;
    padding: 40px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.3), rgba(39, 174, 96, 0.3));
    border: 4px solid #2ecc71;
    border-radius: 20px;
    margin-top: 40px;
    animation: celebrateBig 1s ease;
    box-shadow: 0 0 50px rgba(46, 204, 113, 0.5);
    position: relative;
    overflow: hidden;
}

.win-message::before {
    content: '🎉';
    position: absolute;
    font-size: 4em;
    top: -20px;
    left: 20px;
    animation: float 2s ease-in-out infinite;
}

.win-message::after {
    content: '🎉';
    position: absolute;
    font-size: 4em;
    top: -20px;
    right: 20px;
    animation: float 2s ease-in-out infinite 1s;
}

@keyframes celebrateBig {
    0% {
        transform: scale(0.5) rotate(-5deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(2deg);
    }
    70% {
        transform: scale(0.95) rotate(-1deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.hidden {
    display: none;
}

/* Confetti effect overlay - stays within viewport */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #ffd700;
    pointer-events: none;
    z-index: 9999;
    animation: confettiFall 4s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    20% {
        transform: translateY(-100px) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Character Index Button */
.index-btn {
    display: block;
    margin: 0 auto 30px;
    padding: 12px 25px;
    font-size: 1em;
    border: 2px solid #ffd700;
    border-radius: 8px;
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.index-btn:hover {
    background: rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
}

/* Character Index Modal */
.character-index-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.character-index-modal.show {
    display: flex;
}

.character-index-content {
    background: linear-gradient(135deg, #0b091f, #01010c);
    border: 3px solid #ffd700;
    border-radius: 15px;
    padding: 30px;
    max-width: 95vw;
    width: 1400px;
    max-height: 90vh;
    overflow-y: auto;
}

.character-index-content h2 {
    text-align: center;
    color: #ffd700;
    margin-bottom: 15px;
    font-size: 2em;
}

.character-count {
    text-align: center;
    color: #ffd700;
    margin-bottom: 20px;
    font-size: 1.1em;
}

/* Easy Mode Toggle Button */
.easy-mode-toggle {
    display: block;
    margin: 0 auto 20px;
    padding: 12px 30px;
    font-size: 1em;
    border: 2px solid rgba(100, 100, 120, 0.5);
    border-radius: 8px;
    background: rgba(100, 100, 120, 0.2);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.easy-mode-toggle:hover {
    background: rgba(100, 100, 120, 0.3);
    border-color: rgba(100, 100, 120, 0.7);
    transform: translateY(-2px);
}

.easy-mode-toggle.active {
    background: rgba(46, 204, 113, 0.3);
    border-color: #2ecc71;
    color: #2ecc71;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.3);
}

.easy-mode-toggle.active:hover {
    background: rgba(46, 204, 113, 0.4);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.5);
}

.character-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.character-index-item {
    padding: 12px;
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.character-index-item:hover {
    background: rgba(255, 215, 0, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

.character-index-item span {
    font-size: 0.85em;
    text-align: center;
    line-height: 1.2;
}

.character-index-img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid #ffd700;
}

/* Crossed-out character styling */
.character-index-item.crossed-out::before,
.character-index-item.crossed-out::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(220, 38, 38, 0.15);
    pointer-events: none;
    border-radius: 8px;
}

.character-index-item.crossed-out::before {
    background: linear-gradient(
        to bottom right,
        transparent calc(50% - 3px),
        rgba(220, 38, 38, 0.9) calc(50% - 3px),
        rgba(220, 38, 38, 0.9) calc(50% + 3px),
        transparent calc(50% + 3px)
    );
}

.character-index-item.crossed-out::after {
    background: linear-gradient(
        to top right,
        transparent calc(50% - 3px),
        rgba(220, 38, 38, 0.9) calc(50% - 3px),
        rgba(220, 38, 38, 0.9) calc(50% + 3px),
        transparent calc(50% + 3px)
    );
}

/* Dim the character when crossed out */
.character-index-item.crossed-out {
    opacity: 0.6;
}

/* Add red glow on crossed-out hover */
.character-index-item.crossed-out:hover {
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.5);
}

/* Transition for smooth crossing out */
.character-index-item::before,
.character-index-item::after {
    transition: opacity 0.2s ease;
    opacity: 0;
}

.character-index-item.crossed-out::before,
.character-index-item.crossed-out::after {
    opacity: 1;
}

.close-btn {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 1em;
    border: 2px solid #ffd700;
    border-radius: 8px;
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(255, 215, 0, 0.4);
}

/* Win character image */
.win-character-img {
    width: 150px;
    height: 150px;
    border-radius: 15px;
    border: 4px solid #ffd700;
    margin: 20px 0;
    object-fit: cover;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* Appearances list in character index */
.appearances-list {
    text-align: center;
    color: #ffd700;
    margin-bottom: 20px;
    font-size: 0.9em;
    padding: 15px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    line-height: 1.6;
}

.appearances-list strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1em;
}

/* Close but wrong character message */
.close-but-wrong-message {
    background: rgba(243, 156, 18, 0.2);
    border: 2px solid #f39c12;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1em;
    color: #f39c12;
    font-weight: bold;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.close-but-wrong-message.show {
    opacity: 1;
    transform: translateY(0);
}



body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1; /* Pushes footer to bottom */
}

footer {
    margin-top: auto;
    padding: 40px 20px;
    text-align: center;
    font-size: 12px;
    color: #999;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}