body { 
    font-family: sans-serif; 
    text-align: center; 
    margin: 0; 
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f7f3f3;
    padding-top: 60px;
}

main {
    flex: 1;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Left-align about page content */
.content-container {
     align-self: flex-start;
     text-align: left;
     width: 100%;
     max-width: 700px;
     margin: 0 auto;
}

/* Resize images in about page content */
.content-container img {
    width: 250px;
    height: auto;
    max-width: 100%;
    display: inline-block;
}

/* Navbar Styling */
.navbar {
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: #4CAF50;
        color: white;
        padding: 10px 0;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        z-index: 1000;
        gap: 40px;
}

@media (max-width: 600px) {
    .navbar {
        gap: 24px;
        padding: 10px 0;
    }
}
.navbar a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 0 15px;
}
.navbar a:hover {
    text-decoration: underline;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}
.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 10px;
}
.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}
.close-button:hover, .close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
.rules-list {
    text-align: left;
    margin-top: 10px;
}

.game-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Prominent Score Display */
.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}
.current-turn-score {
    font-size: 3.5em;
    font-weight: bold;
    color: #ec7063;
    margin: 0;
    line-height: 1;
}
.score-label {
    font-size: 1em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

/* Shaded Pig Boxes */
.pig-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.pig-box {
    width: 120px;
    height: 120px;
    background-color: #f2f2f2;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: box-shadow 0.3s ease-in-out;
}
.pig-image {
    max-width: 100%;
    max-height: 100%;
    opacity: 1;
}

/* Flash Animations */
@keyframes flash-green-low {
    0% { box-shadow: 0 0 5px #c8e6c9; }
    50% { box-shadow: 0 0 15px #81c784, 0 0 20px #a5d6a7; }
    100% { box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
}
@keyframes flash-green-medium {
    0% { box-shadow: 0 0 5px #a5d6a7; }
    50% { box-shadow: 0 0 25px #4caf50, 0 0 30px #81c784; }
    100% { box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
}
@keyframes flash-green-high {
    0% { box-shadow: 0 0 5px #81c784; }
    50% { box-shadow: 0 0 35px #2e7d32, 0 0 40px #4caf50; }
    100% { box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
}
@keyframes flash-red {
    0% { box-shadow: 0 0 5px #ffcdd2; }
    50% { box-shadow: 0 0 40px #e53935, 0 0 50px #ef9a9a; }
    100% { box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
}
.flash-low { animation: flash-green-low 0.8s ease-in-out; }
.flash-medium { animation: flash-green-medium 0.8s ease-in-out; }
.flash-high { animation: flash-green-high 0.8s ease-in-out; }
.flash-red { animation: flash-red 0.8s ease-in-out 3; }

/* Pig Spin Animation */
.spin-animation {
    opacity: 1;
    animation: spin 0.8s ease-in-out forwards;
}
@keyframes spin {
    0% { transform: rotateY(0deg) scale(0); opacity: 0; }
    80% { transform: rotateY(720deg) scale(1.2); opacity: 1; }
    100% { transform: rotateY(720deg) scale(1); opacity: 1; }
}

/* Shake Animations */
.shake-low { animation: shake-low 0.5s cubic-bezier(.36,.07,.19,.97) both; }
.shake-high { animation: shake-high 0.5s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake-low {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}
@keyframes shake-high {
    10%, 90% { transform: translate3d(-3px, 0, 0); }
    20%, 80% { transform: translate3d(6px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-12px, 0, 0); }
    40%, 60% { transform: translate3d(12px, 0, 0); }
}

/* Leaning Jowler Background Flash */
.leaning-jowler-flash { animation: leaning-jowler-flash 1s ease-in-out; }
.double-jowler-flash { animation: leaning-jowler-flash 1s ease-in-out infinite; }
@keyframes leaning-jowler-flash {
    0% { background-color: #f7f3f3; }
    50% { background-color: #ffd700; }
    100% { background-color: #f7f3f3; }
}

/* Horizontal Progress Bar Styling */
.progress-container {
    width: 80%;
    height: 25px;
    background-color: #e0e0e0;
    border-radius: 12px;
    border: 2px solid #ccc;
    margin-top: 20px;
    position: relative;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(to right, #4caf50, #8bc34a);
    transition: width 0.5s ease-in-out;
    border-radius: 10px;
    position: absolute;
    left: 0;
}
.progress-label {
    font-weight: bold;
    font-size: 1em;
    color: #333;
    z-index: 2;
}

/* Button Container Styling */
.button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; 
    margin-top: 10px;
}
button { 
    font-size: 1em;
    padding: 10px 20px;
    margin: 5px;
    cursor: pointer;
    border: none;
    border-radius: 30px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
#roll-button { background-color: #fce883; }
#bank-button { background-color: #8bc34a; }
#reset-button { background-color: #e0e0e0; }

.footer {
    width: 100%;
    background-color: #333;
    color: white;
    text-align: center;
    padding: 10px 0;
    margin-top: auto;
}