body {
    display: flex;
    flex-direction: column; /* Changed to column to stack header and container */
    justify-content: flex-start; /* Align items from the start */
    align-items: center;
    min-height: 100vh;
    margin: 0;
    font-family: 'Arial', sans-serif;
    background-color: #000;
    color: #333;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.7); /* Black w/ opacity */
    display: flex; /* Use flexbox for centering */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
}

.modal-content {
    background-color: #000;
    margin: auto;
    padding: 20px;
    width: 80%; /* Could be more specific */
    max-width: 500px;
    position: relative;
    color: white; /* White text for modal content */
    text-align: center;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: white;
    text-decoration: none;
    cursor: pointer;
}

.modal-table {
    width: 100%;
    border-collapse: collapse; /* Remove space between borders */
    margin-top: 20px;
}

.modal-table th,
.modal-table td {
    border: 1px solid white; /* White border */
    padding: 8px;
    text-align: left;
    color: white; /* White text */
}
#main-header {
    background-color: #0273beff; /* Blue header */
    color: white;
    padding: 15px 0;
    text-align: center;
    font-size: 2em;
    font-weight: bold;
    width: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.omikuji-container {
    background-color: #fff;
    border-radius: 15px;
    /* box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); */
    padding: 30px 20px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    position: relative;
    overflow: hidden;
    /* Removed border */
}

#bulletin-board-container {
    color:#fff;
    border-radius: 10px;
    padding: 20px;
    margin-top: 30px;
    width: 90%;
    max-width: 400px;
    text-align: left;
}

.bulletin-post {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.omikuji-container::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: linear-gradient(45deg, #ffecd2 0%, #fcb69f 100%);
    z-index: -1;
    filter: blur(15px);
    opacity: 0.6;
}

h1 {
    color: #333; /* 和風な赤茶色 */
    font-size: 2.5em;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

#timer-display {
    text-align: center;
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

#timer-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 5px;
    margin: 10px 0;
}

#timer-bar {
    height: 20px;
    width: 100%;
    background-color: #f00;
    border-radius: 5px;
    transition: width 0.1s linear;
}

#attempts-container {
    margin-top: 15px;
    font-size: 1.2em;
    font-weight: bold;
    color: #d35400;
}

#omikuji-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 columns */
    grid-template-rows: repeat(2, 1fr);    /* 2 rows */
    gap: 15px;
    margin-top: 30px;
    width: 100%;
    max-width: 600px; /* Adjust as needed */
    margin-left: auto;
    margin-right: auto;
}

.omikuji-card {
    background-color: #e67e22; /* Initial card color */
    color: white;
    border: none;
    border-radius: 10px;
    padding: 20px 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    /* box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80px; /* Fixed height for cards */
    text-align: center;
    user-select: none; /* Prevent text selection */
}

.omikuji-card:hover:not(.revealed) {
    background-color: #d35400;
    transform: translateY(-2px);
    /* box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); */
}

.omikuji-card.revealed {
    background-color: #f9f9f9; /* Color after revealing */
    color: #333; /* Blue text color after revealing */
    cursor: default;
    /* box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08); */
    transform: none;
    pointer-events: none; /* Disable further clicks */
    animation: revealEffect 0.5s ease-out forwards;
}

@keyframes revealEffect {
    from {
        transform: scale(0.9);
        opacity: 0.5;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive adjustments for grid */
@media (max-width: 768px) {
    #omikuji-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 columns on smaller screens */
        gap: 10px;
    }
    .omikuji-card {
        font-size: 1em;
        height: 70px;
    }
}

@media (max-width: 480px) {
    #omikuji-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on very small screens */
        gap: 8px;
    }
    .omikuji-card {
        font-size: 0.9em;
        height: 60px;
        padding: 15px 5px;
    }
}



/* Animation for result display */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.omikuji-result-animation {
    animation: fadeInScale 0.5s ease-out forwards;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    h1 {
        font-size: 2em;
    }
    #draw-button {
        padding: 12px 25px;
        font-size: 1.1em;
    }
    #result-display {
        font-size: 1.5em;
    }
}
