/* ============================================================
   FELLA OF THE MONTH — Main Stylesheet
   Comic Sans. Retro. No apologies.
   ============================================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Patrick Hand", "Comic Sans MS", "Comic Sans", cursive;
    background-color: #f0f0ef;
    color: #222;
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: #3366bb;
    text-decoration: underline;
    font-family: inherit;
}

a:hover {
    color: #cc0000;
}

/* ============================================================
   Flash Messages
   ============================================================ */

.flash-container {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.flash {
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    font-family: "Patrick Hand", "Comic Sans MS", "Comic Sans", cursive;
}

.flash-success {
    background: #d4edda;
    color: #155724;
    border-bottom: 3px solid #28a745;
}

.flash-error {
    background: #f8d7da;
    color: #721c24;
    border-bottom: 3px solid #dc3545;
}

/* ============================================================
   Page Wrapper
   ============================================================ */

.page-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
}

/* ============================================================
   Panel / Card
   ============================================================ */

.panel {
    background: #fff;
    border-radius: 10px;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.25);
    padding: 20px;
    margin-bottom: 20px;
}

/* ============================================================
   Site Header
   ============================================================ */

.site-header {
    text-align: center;
    padding: 24px 16px 12px;
}

.site-header h1 {
    font-size: 2rem;
    color: #2255aa;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
    margin-bottom: 4px;
}

.site-header h2 {
    font-size: 1.3rem;
    color: #555;
    font-weight: normal;
}

.site-blurb {
    font-size: 0.95rem;
    color: #666;
    max-width: 500px;
    margin: 8px auto 0;
    font-style: italic;
}

/* ============================================================
   Deadline Banner
   ============================================================ */

.cookie-banner {
    background: #fff3e0;
    border: 3px solid #e67e00;
    border-radius: 8px;
    padding: 14px 20px;
    text-align: center;
    font-size: 1.1rem;
    color: #b35900;
    margin-bottom: 16px;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.2);
}

.deadline-banner {
    background: #fff8e1;
    border: 3px solid #cc0000;
    border-radius: 8px;
    padding: 14px 20px;
    text-align: center;
    font-size: 1.1rem;
    color: #cc0000;
    margin-bottom: 16px;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.2);
}

.voting-closed-banner {
    background: #f8d7da;
    border: 3px solid #dc3545;
    border-radius: 8px;
    padding: 14px 20px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #721c24;
    margin-bottom: 16px;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.2);
}

/* ============================================================
   Mobile: Big Red Bulletin Board Button
   ============================================================ */

.mobile-board-btn-wrap {
    display: block;
    margin-bottom: 20px;
}

.btn-red-big {
    display: block;
    width: 100%;
    padding: 16px 24px;
    font-size: 1.3rem;
    font-family: "Patrick Hand", "Comic Sans MS", "Comic Sans", cursive;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(to bottom, #ff4444, #cc0000);
    border: 2px solid #990000;
    border-radius: 10px;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.3);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.1s;
}

.btn-red-big:hover {
    color: #fff;
    background: linear-gradient(to bottom, #ff6666, #dd0000);
    transform: translateY(-1px);
}

.btn-red-big:active {
    transform: translateY(1px);
    box-shadow: 2px 2px 6px rgba(0,0,0,0.3);
}

/* ============================================================
   Main Grid — Mobile first, then desktop
   ============================================================ */

.main-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 768px) {
    .main-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
        align-items: start;
    }

    .mobile-board-btn-wrap {
        display: none;
    }
}

/* ============================================================
   Ballot Panel
   ============================================================ */

.ballot-panel h2 {
    font-size: 1.4rem;
    color: #2255aa;
    margin-bottom: 12px;
    border-bottom: 2px dashed #aac;
    padding-bottom: 8px;
}

.ballot-instructions {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.vote-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rank-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rank-label {
    font-weight: bold;
    font-size: 1rem;
    padding: 6px 10px;
    border-radius: 6px;
    display: inline-block;
}

.rank-1 { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.rank-2 { background: #e9ecef; color: #495057; border: 1px solid #adb5bd; }
.rank-3 { background: #fde8d8; color: #7d3c0a; border: 1px solid #e0925a; }

.pts {
    font-size: 0.8rem;
    opacity: 0.75;
}

.voting-closed-box {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #ccc;
    font-size: 1.2rem;
    color: #666;
}

/* ============================================================
   Form Elements (shared)
   ============================================================ */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: bold;
    font-size: 0.95rem;
    color: #333;
}

input[type="text"],
input[type="password"],
input[type="datetime-local"],
select,
textarea {
    font-family: "Patrick Hand", "Comic Sans MS", "Comic Sans", cursive;
    font-size: 1rem;
    padding: 10px;
    border-radius: 6px;
    border: 2px solid #aaa;
    width: 100%;
    background: #fff;
    color: #222;
    transition: border-color 0.2s;
    min-height: 44px;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3366bb;
    box-shadow: 0 0 0 3px rgba(51,102,187,0.2);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn-submit {
    font-family: "Patrick Hand", "Comic Sans MS", "Comic Sans", cursive;
    font-size: 1.05rem;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(to bottom, #5599dd, #3366bb);
    border: 1px solid #2255aa;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 3px 3px 8px rgba(0,0,0,0.2);
    min-height: 44px;
    width: 100%;
    transition: transform 0.1s;
}

.btn-submit:hover {
    background: linear-gradient(to bottom, #66aaee, #4477cc);
    transform: translateY(-1px);
}

.btn-submit:active {
    transform: translateY(1px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 1px 1px 4px rgba(0,0,0,0.2);
}

.btn-small {
    font-family: "Patrick Hand", "Comic Sans MS", "Comic Sans", cursive;
    font-size: 0.85rem;
    color: #fff;
    background: linear-gradient(to bottom, #5599dd, #3366bb);
    border: 1px solid #2255aa;
    border-radius: 6px;
    padding: 6px 12px;
    text-decoration: none;
    display: inline-block;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
    cursor: pointer;
    min-height: 32px;
    line-height: 20px;
}

.btn-small:hover {
    color: #fff;
    background: linear-gradient(to bottom, #66aaee, #4477cc);
}

.btn-small.btn-secondary {
    background: linear-gradient(to bottom, #aaa, #888);
    border-color: #666;
}

.btn-small.btn-secondary:hover {
    background: linear-gradient(to bottom, #bbb, #999);
    color: #fff;
}

.btn-delete {
    font-family: "Patrick Hand", "Comic Sans MS", "Comic Sans", cursive;
    font-size: 0.8rem;
    color: #fff;
    background: linear-gradient(to bottom, #ff5555, #cc2222);
    border: 1px solid #aa1111;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-delete:hover {
    background: linear-gradient(to bottom, #ff6666, #dd3333);
}

.btn-logout {
    font-family: "Patrick Hand", "Comic Sans MS", "Comic Sans", cursive;
    font-size: 0.9rem;
    color: #fff;
    background: linear-gradient(to bottom, #ff6666, #cc3333);
    border: 1px solid #aa2222;
    border-radius: 6px;
    padding: 6px 14px;
    text-decoration: none;
    display: inline-block;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
    min-height: 32px;
    line-height: 20px;
}

.btn-logout:hover {
    color: #fff;
    background: linear-gradient(to bottom, #ff8888, #dd4444);
}

/* ============================================================
   Bulletin Board
   ============================================================ */

.bulletin-panel h2 {
    font-size: 1.4rem;
    color: #7d3c0a;
    margin-bottom: 8px;
    border-bottom: 2px dashed #c8a46e;
    padding-bottom: 8px;
}

.board-warning {
    font-family: "Patrick Hand", "Comic Sans MS", "Comic Sans", cursive;
    font-size: 1rem;
    font-weight: bold;
    color: #8b0000;
    background: #fff8e1;
    border: 2px dashed #cc9900;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.post-form-wrap {
    margin-bottom: 20px;
}

.post-form-wrap h3 {
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 12px;
}

.post-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Corkboard */
.board-corkboard {
    background: #c8a46e;
    padding: 20px;
    border-radius: 10px;
    border: 3px solid #a07840;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.2), 3px 3px 10px rgba(0,0,0,0.25);
    min-height: 120px;
}

.candidate-section {
    margin-bottom: 24px;
}

.candidate-header {
    font-size: 1.1rem;
    color: #3d1c00;
    background: rgba(255,255,255,0.4);
    padding: 6px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: inline-block;
}

/* Sticky Notes */
.sticky-note {
    background: #fffacd;
    border-radius: 4px;
    padding: 14px 14px 10px;
    box-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    position: relative;
    margin: 12px 8px;
    display: inline-block;
    width: calc(100% - 16px);
    word-wrap: break-word;
}

.sticky-note::before {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    background: #cc3333;
    border-radius: 50%;
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    z-index: 1;
}

.post-author {
    font-size: 1rem;
    color: #333;
    display: block;
    margin-bottom: 6px;
}

.post-body {
    font-size: 0.95rem;
    color: #444;
    white-space: pre-wrap;
    margin-bottom: 8px;
}

.post-time {
    font-size: 0.75rem;
    color: #888;
    display: block;
    text-align: right;
}

.empty-board {
    text-align: center;
    color: #6b4e1e;
    font-size: 1rem;
    padding: 30px;
    opacity: 0.8;
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
    text-align: center;
    padding: 30px 16px 20px;
    color: #888;
    font-size: 0.9rem;
    line-height: 1.8;
    border-top: 2px dashed #ccc;
    margin-top: 20px;
}

/* ============================================================
   Admin Pages
   ============================================================ */

.admin-centered {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 20px;
}

.admin-login-panel {
    max-width: 420px;
    width: 100%;
    text-align: center;
}

.admin-login-panel h1 {
    font-size: 1.8rem;
    color: #2255aa;
    margin-bottom: 8px;
}

.admin-login-panel p {
    color: #666;
    margin-bottom: 20px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.admin-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-header h1 {
    font-size: 1.6rem;
    color: #2255aa;
}

.admin-header-links {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-panel h2 {
    font-size: 1.25rem;
    color: #2255aa;
    margin-bottom: 16px;
    border-bottom: 2px dashed #aac;
    padding-bottom: 8px;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-form .btn-submit {
    max-width: 260px;
}

.hint {
    font-size: 0.8rem;
    color: #888;
    font-weight: normal;
}

.empty-state {
    color: #888;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.stats-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    background: #f0f4ff;
    font-size: 0.95rem;
}

/* Admin Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    font-family: "Patrick Hand", "Comic Sans MS", "Comic Sans", cursive;
}

.admin-table th {
    background: #e8eef8;
    color: #2255aa;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid #aac;
    font-size: 0.85rem;
}

.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: #f8f9ff;
}

.admin-table code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
}

.results-table .rank-winner {
    background: #fffde7;
}

.results-table .rank-winner td {
    font-weight: bold;
}

.votes-table .dupe-row {
    background: #fff3f3;
}

.dupe-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    color: #856404;
}
