body {
    font-family: 'Georgia', 'Times New Roman', Times, serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

header {
    background-color: #003366; /* A nice school-like navy blue */
    color: #ffffff;
    padding-top: 1rem;
    text-align: center;
    border-bottom: 5px solid #ffd700; /* Gold accent */
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
}

header p {
    margin: 0;
    font-style: italic;
    padding-bottom: 1rem;
}

nav {
    background-color: #002244;
    padding: 0.5rem 0;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    font-weight: bold;
}

nav a:hover, #auth-link:hover {
    background-color: #ffd700;
    color: #003366;
}

#auth-link {
    cursor: pointer;
    border: none;
}

main {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.article {
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow-wrap: break-word; /* Prevents long text from breaking the layout */
}

.article h2 {
    margin-top: 0;
    color: #003366;
}

.article-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.content-section {
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.content-section h3 {
    margin-top: 0;
    color: #003366;
    border-bottom: 2px solid #f4f4f4;
    padding-bottom: 0.5rem;
}

footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    background-color: #333;
    color: #a9a9a9;
    border-top: 5px solid #002244;
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    margin: 0 0.75rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #ffd700;
}
.login-container {
    background: #fff;
    padding: 2rem;
    border-radius: 5px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.login-form input {
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.login-form textarea {
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    /* Match the article font styles for a better writing experience */
    font-family: 'Georgia', 'Times New Roman', Times, serif;
    font-size: 1.1rem;
    line-height: 1.6;
    resize: vertical; /* Allow users to resize the box vertically */
}

.login-form label {
    text-align: left;
    font-weight: bold;
    font-size: 0.9rem;
}

.login-form button {
    padding: 0.8rem;
    border: none;
    border-radius: 4px;
    background-color: #003366;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-form button:hover {
    background-color: #0055aa;
}

.subtle-link {
    font-size: 0.9rem;
}

.about-container {
    background: #fff;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    text-align: center;
}

.profile-card {
    background: #f9f9f9;
    border: 1px solid #eee;
    padding: 1rem;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
}

.profile-card h3 {
    margin: 0 0 0.25rem 0;
}

.profile-card .role {
    margin: 0;
    color: #555;
    font-style: italic;
}

/* --- Game Styles --- */
.game-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.game-card {
    display: block;
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.game-card h3 {
    margin-top: 0;
    color: #003366;
}

.game-container {
    /* Use a sans-serif font for the game, like Wordle */
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background: transparent;
    box-shadow: none;
    padding: 1rem;
    text-align: center;
}

.game-container h2 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #000;
}

.game-message {
    min-height: 1.5rem;
    font-weight: bold;
    margin: 1rem 0;
}
.game-message.win { color: #6aaa64; }
.game-message.error { color: #c23b22; }

/* --- Animation Keyframes --- */
@keyframes flip {
    0% { transform: rotateX(0); }
    100% { transform: rotateX(180deg); }
}

@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

@keyframes pop {
    50% { transform: scale(1.1); }
}
/* Cookle Styles */
.cookle-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 5px;
    width: clamp(280px, 90vw, 350px);
    height: clamp(340px, 110vw, 420px);
    margin: 0 auto 1.5rem auto;
}

.cookle-tile {
    width: 100%;
    height: 100%;
    border: 2px solid #878a8c; /* Darker border for empty tiles */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;
    transition: transform 0.2s;
}
.cookle-tile.flipped {
    animation: flip 0.5s ease forwards;
}
.cookle-tile.shake {
    animation: shake 0.6s ease-in-out;
}
.cookle-tile.pop {
    animation: pop 0.1s ease-in-out;
}


/* Tile states */
.cookle-tile.grey { background-color: #878a8c; color: white; border-color: #878a8c; transform: rotateX(180deg); }
.cookle-tile.yellow { background-color: #b59f3b; color: white; border-color: #b59f3b; transform: rotateX(180deg); }
.cookle-tile.green { background-color: #538d4e; color: white; border-color: #538d4e; transform: rotateX(180deg); }


.cookle-keyboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 500px; /* More compact keyboard */
    margin: 0 auto;
}

.cookle-keyboard button {
    padding: 0;
    flex-grow: 1;
    height: 55px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 4px;
    border: none;
    background-color: #d3d6da;
    cursor: pointer;
    transition: background-color 0.2s;
    text-transform: uppercase;
}

/* Make Enter and Backspace wider */
.cookle-keyboard button:nth-last-child(1), /* Backspace */
.cookle-keyboard button:nth-last-child(10) { /* Enter */
    flex-grow: 2;
    font-size: 1.2rem;
    padding: 0 10px;
}

.cookle-keyboard button:hover {
    background-color: #b8bcbf;
}
.cookle-keyboard button[data-state="grey"] { background-color: #878a8c; color: white; }
.cookle-keyboard button[data-state="yellow"] { background-color: #b59f3b; color: white; }
.cookle-keyboard button[data-state="green"] { background-color: #538d4e; color: white; }

/* --- Full Article Page Styles --- */
.article-full {
    background-color: #fff;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow-wrap: break-word; /* Prevents long text from breaking the layout */
}

.article-full h2 {
    margin-top: 0;
    font-size: 2.2rem;
    color: #003366;
}

.article-full .article-content {
    font-size: 1.1rem;
    margin-top: 1.5rem;
}

.back-link {
    display: inline-block;
    margin-top: 2rem;
    font-weight: bold;
}

/* --- Article Image Styles --- */
.article-image-container {
    margin: 0 0 1.5rem 0;
}

.article-image-container figcaption {
    font-size: 0.9rem;
    color: #555;
    font-style: italic;
    padding: 0.5rem 0;
    text-align: center;
}

.article-image-preview {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px 5px 0 0;
    border: 1px solid #eee;
}

.article-image-full {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #eee;
}

/* Adjust padding for articles with images */
.article {
    padding: 0;
}

.article-text-content {
    padding: 1.5rem;
}

/* --- Manageable Item Styles (Dashboard) --- */
.manageable-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.manageable-item:last-child {
    border-bottom: none;
}

.manage-buttons {
    display: flex;
    gap: 0.5rem;
}

.edit-btn {
    background-color: #007bff;
    color: white;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
}

.delete-btn {
    background-color: #c23b22; /* A soft red */
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
}

/* --- Homepage Cartoon Grid --- */
.cartoon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.cartoon-preview img {
    width: 100%;
    border-radius: 5px;
    border: 1px solid #eee;
    transition: transform 0.2s;
}

.cartoon-preview img:hover {
    transform: scale(1.03);
}

.cartoon-title {
    font-weight: bold;
    margin: 0.5rem 0 0.25rem 0;
}

.cartoon-artist {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* --- Other Media Page Styles --- */
.joke-item {
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.joke-item:last-of-type {
    border-bottom: none;
}

.quote-item {
    background: #f9f9f9;
    border-left: 5px solid #003366;
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    font-style: italic;
    font-size: 1.1rem;
}
.quote-item footer {
    background: none;
    border: none;
    padding: 0;
    margin-top: 0.5rem;
    font-style: normal;
    font-weight: bold;
    color: #555;
    font-size: 1rem;
}
