* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: linear-gradient(-45deg, #0f2027, #203a43, #2c5364, #1a3a4a);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

body {
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    background: linear-gradient(-45deg, #0f2027, #203a43, #2c5364, #1a3a4a);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: relative;
    min-height: 100vh;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(29, 233, 182, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(29, 196, 233, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(29, 233, 182, 0.08) 0%, transparent 70%);
    animation: floatingGlow 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes floatingGlow {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    z-index: 1;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

.background-wrapper {
    position: relative;
    width: 1024px;
    height: 1024px;
    filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.5));
    animation: subtleFloat 6s ease-in-out infinite;
}

@keyframes subtleFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.background-image {
    width: 1024px;
    height: 1024px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

/* Menu Screen - Clickable areas */
.menu-clickable-area {
    position: absolute;
    cursor: pointer;
    z-index: 10;
    transition: opacity 0.2s ease;
}

.menu-clickable-area:hover {
    opacity: 0.8;
}

.start-game-area {
    top: 34%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 560px;
    height: 180px;
}

.twitter-area {
    bottom: 44%;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 70px;
}

.site-area {
    bottom: 32%;
    right: 50%;
    transform: translateX(50%);
    width: 300px;
    height: 70px;
}

/* Game Screen */
.game-container {
    position: absolute;
    left: 194px;
    top: 196px;
    transform: none;
    background: transparent;
    padding: 35px 25px 25px 25px;
    border-radius: 0;
    box-shadow: none;
    z-index: 10;
    width: 598px;
    height: 531px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    box-sizing: border-box;
    overflow: visible;
}

.crossword-grid {
    display: grid;
    gap: 0;
    background: transparent;
    padding: 0;
    margin-bottom: 15px;
    width: fit-content;
    border: 1px solid #333;
}

.back-btn {
    position: absolute;
    top: 60px;
    right: 30px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #1de9b6 0%, #1dc4e9 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 3px 12px rgba(29, 233, 182, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(29, 233, 182, 0.5);
    background: linear-gradient(135deg, #1dc4e9 0%, #1de9b6 100%);
}

.back-btn:active {
    transform: translateY(0);
}

.crossword-grid {
    display: grid;
    gap: 0;
    background: transparent;
    padding: 0;
    margin-bottom: 10px;
    width: fit-content;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border-radius: 2px;
}

.crossword-cell {
    width: 38px;
    height: 23px;
    background: white;
    border: 1px solid #c5c5c5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    transition: all 0.2s ease;
}

.crossword-cell:nth-child(14n) {
    border-right: 1px solid #c5c5c5;
}

.crossword-cell.empty {
    background: #e8e8e8;
    border-color: #d5d5d5;
    opacity: 0.4;
}

.crossword-cell.empty {
    background: #f0f0f0;
}

.crossword-cell.number {
    cursor: pointer;
    background: #f0fdf9;
    border-color: #1de9b6;
}

.crossword-cell.number:hover {
    background: #e6fcf5;
    border-color: #1dc4e9;
    box-shadow: 0 0 8px rgba(29, 233, 182, 0.3);
}

.cell-number {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 9px;
    color: #1de9b6;
    font-weight: bold;
}

.crossword-cell.correct {
    background: #d1f4e8 !important;
    animation: correctPulse 0.5s ease;
    border-color: #1de9b6;
}

.crossword-cell.incorrect {
    background: #ffe5e5 !important;
    animation: incorrectShake 0.5s ease;
    border-color: #ff6b7a;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.submit-btn {
    width: 545px;
    padding: 11px;
    background: linear-gradient(135deg, #1de9b6 0%, #1dc4e9 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(29, 233, 182, 0.4);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 233, 182, 0.6);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #333;
}

#questionText {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    line-height: 1.5;
}

.answer-input {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.answer-input input {
    width: 35px;
    height: 40px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    border: 2px solid #ddd;
    border-radius: 5px;
    transition: border-color 0.3s ease;
}

.answer-input input:focus {
    outline: none;
    border-color: #1de9b6;
}

.done-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #1de9b6 0%, #1dc4e9 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(29, 233, 182, 0.4);
}

.done-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 233, 182, 0.6);
}
