@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&family=Poppins:wght@400;600&display=swap');

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

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    font-family: 'Poppins', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

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

h1 {
    font-family: 'Dancing Script', cursive;
    font-size: 2.8rem;
    color: #e91e63;
    text-align: center;
    margin-bottom: 5px;
}

#check {
    margin-bottom: 20px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.game-area {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.grid-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.grid {
    display: grid;
    gap: 0;
    border: 3px solid #333;
    background: #333;
}

.cell {
    width: 45px;
    height: 45px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid #ccc;
    transition: width 0.3s, height 0.3s;
}

.cell.black {
    background: #333;
    border-color: #333;
}

.cell .number {
    position: absolute;
    top: 2px;
    left: 3px;
    font-size: 10px;
    color: #e91e63;
    font-weight: bold;
}

.cell input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 1.3rem;
    font-weight: bold;
    text-transform: uppercase;
    background: transparent;
    color: #333;
    outline: none;
    cursor: text;
}

.cell input:focus {
    background: #ffebf0;
}

.cell.correct {
    background: #c8e6c9;
}

.cell.correct input {
    color: #2e7d32;
}

.cell.wrong {
    background: #ffcdd2 !important;
}

.cell.wrong input {
    background: #ffcdd2 !important;
}

.clues-area {
    flex: 1;
    min-width: 250px;
}

.clues-section {
    margin-bottom: 20px;
}

.clues-section h3 {
    color: #e91e63;
    margin-bottom: 12px;
    font-size: 1.1rem;
    border-bottom: 2px solid #fce4ec;
    padding-bottom: 5px;
}

.clue {
    color: #555;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #fce4ec;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.clue:hover {
    background: #f8bbd0;
    transform: translateX(5px);
}

.clue strong {
    color: #e91e63;
    margin-right: 5px;
}

.buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.buttons button {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-check {
    background: linear-gradient(135deg, #e91e63, #c2185b);
    color: white;
}

.btn-check:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(233, 30, 99, 0.4);
}

.btn-reset {
    background: #f5f5f5;
    color: #666;
}

.btn-reset:hover {
    background: #e0e0e0;
}

.result {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    border-radius: 15px;
    display: none;
}

.result.show {
    display: block;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    animation: popIn 0.5s ease;
}

.result h2 {
    font-family: 'Dancing Script', cursive;
    color: #2e7d32;
    font-size: 2rem;
}

/* Surprise Button Styles */
.btn-surprise {
    display: inline-block;
    margin-top: 15px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    border: none;
    border-radius: 30px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(238, 90, 90, 0.4);
}

.btn-surprise:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(238, 90, 90, 0.6);
}

/* Camera Flash Overlay */
.flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
}

.flash-overlay.flash {
    animation: cameraFlash 0.5s ease-out;
}

@keyframes cameraFlash {
    0% {
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.love-note {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #fce4ec, #f8bbd0);
    border-radius: 15px;
    text-align: center;
}

.love-note h3 {
    font-family: 'Dancing Script', cursive;
    color: #e91e63;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.love-note p {
    color: #555;
    font-style: italic;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    h1 {
        font-size: 2rem;
    }
    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    .game-area {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    .grid-container {
        order: 1;
    }
    .clues-area {
        order: 2;
        width: 100%;
        min-width: unset;
    }
    .cell {
        width: 38px;
        height: 38px;
    }
    .cell input {
        font-size: 1.1rem;
    }
    .clues-section h3 {
        font-size: 1rem;
    }
    .clue {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
    .buttons {
        margin-top: 15px;
    }
    .buttons button {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    .love-note {
        padding: 15px;
    }
    .love-note h3 {
        font-size: 1.3rem;
    }
    .love-note p {
        font-size: 0.9rem;
    }
    .result {
        padding: 15px;
    }
    .result h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
        border-radius: 15px;
    }
    h1 {
        font-size: 1.7rem;
    }
    .subtitle {
        font-size: 0.85rem;
        margin-bottom: 15px;
    }
    .cell {
        width: 32px;
        height: 32px;
    }
    .cell .number {
        font-size: 8px;
        top: 1px;
        left: 2px;
    }
    .cell input {
        font-size: 1rem;
    }
    .clue {
        font-size: 0.8rem;
        padding: 5px 8px;
    }
    .buttons button {
        min-width: 100px;
        padding: 8px 12px;
    }
}

@media (max-width: 400px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 10px;
    }
    h1 {
        font-size: 1.5rem;
    }
    .cell {
        width: 28px;
        height: 28px;
    }
    .cell input {
        font-size: 0.9rem;
    }
    .clues-section h3 {
        font-size: 0.95rem;
    }
    .clue {
        font-size: 0.75rem;
    }
}