/* ===========================================
   JAILMA.COM — styles
   made at 3am, no regrets
   =========================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;600;700;900&family=Special+Elite&family=Caveat:wght@400;700&family=Courier+Prime:wght@400;700&display=swap');

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

:root {
    --bg: #f5f0e8;
    --paper: #fffef9;
    --ink: #1a1a1a;
    --ink-light: #555;
    --ink-faded: #999;
    --red: #c0392b;
    --red-light: #e74c3c;
    --blue: #2471a3;
    --stamp-red: #d32f2f;
    --yellow-highlight: #fff176;
    --tape: rgba(255, 235, 150, 0.7);
    --coffee: rgba(139, 90, 43, 0.15);
    --uml-red: #cc0000;
    --congress-green: #008751;
    --rsp-blue: #0066cc;
    --maoist-maroon: #800020;
    --font-nepali: 'Noto Sans Devanagari', sans-serif;
    --font-typewriter: 'Special Elite', 'Courier Prime', monospace;
    --font-handwritten: 'Caveat', cursive;
}

/* dark mode = jail mode 🌙 */
body.jail-mode {
    --bg: #1a1a1a;
    --paper: #2a2a2a;
    --ink: #e0d8c8;
    --ink-light: #aaa;
    --ink-faded: #777;
    --coffee: rgba(139, 90, 43, 0.08);
}

html {
    scroll-behavior: smooth;
    cursor: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 100 100'><text y='80' font-size='80'>👆</text></svg>") 12 0, auto;
}

body {
    font-family: var(--font-nepali);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.8;
    overflow-x: hidden;
    /* newspaper grain */
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

/* ===== BREAKING NEWS BAR ===== */
.breaking-bar {
    background: var(--red);
    color: white;
    display: flex;
    align-items: center;
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 100;
    font-size: 14px;
    border-bottom: 3px solid #8b0000;
}

.breaking-label {
    background: #8b0000;
    padding: 8px 16px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 11px;
    white-space: nowrap;
    animation: pulse-label 2s infinite;
}

@keyframes pulse-label {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.breaking-text {
    padding: 8px 0;
    font-family: var(--font-nepali);
}

/* ===== HERO ===== */
.hero {
    text-align: center;
    padding: 60px 24px 80px;
    position: relative;
    background: var(--paper);
    border-bottom: 2px dashed var(--ink-faded);
    overflow: hidden;
}

.hero-inner {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.jail-bars {
    width: 180px;
    height: auto;
    margin-bottom: 16px;
    opacity: 0.25;
    transform: rotate(-2deg);
}

.hero-title {
    font-family: var(--font-nepali);
    font-size: clamp(64px, 15vw, 120px);
    font-weight: 900;
    line-height: 1;
    color: var(--ink);
    position: relative;
    display: inline-block;
    transform: rotate(-1.5deg);
}

.hero-title::after {
    /* underline scribble */
    content: '';
    position: absolute;
    bottom: -5px;
    left: -10px;
    right: -10px;
    height: 8px;
    background: var(--red);
    transform: rotate(0.5deg);
    opacity: 0.7;
    border-radius: 4px;
}

.dotcom {
    font-family: var(--font-typewriter);
    font-size: 0.3em;
    color: var(--ink-faded);
    vertical-align: super;
}

.hero-subtitle {
    font-size: 22px;
    color: var(--ink-light);
    margin-top: 20px;
    font-family: var(--font-handwritten);
    font-size: 28px;
    transform: rotate(1deg);
}

/* workplace safety sign */
.safety-sign {
    background: var(--paper);
    border: 4px solid var(--ink);
    border-radius: 8px;
    padding: 20px 32px;
    display: inline-block;
    margin-top: 32px;
    transform: rotate(1.5deg);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.1);
    position: relative;
}

.safety-sign::before {
    content: '📌';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
}

.safety-sign-top {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ink-light);
}

.safety-sign-number {
    font-family: var(--font-typewriter);
    font-size: 72px;
    font-weight: 900;
    color: var(--red);
    line-height: 1;
    margin: 8px 0;
}

.safety-sign-bottom {
    font-size: 16px;
    font-weight: 700;
}

.safety-sign-note {
    font-family: var(--font-handwritten);
    font-size: 16px;
    color: var(--ink-faded);
    margin-top: 8px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 32px;
}

.stat-box {
    background: var(--paper);
    border: 2px solid var(--ink);
    padding: 16px 28px;
    transform: rotate(-0.5deg);
    position: relative;
}

.stat-box:nth-child(2) {
    transform: rotate(1deg);
}

/* tape effect */
.stat-box::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(2deg);
    width: 60px;
    height: 16px;
    background: var(--tape);
    border: 1px solid rgba(200,180,100,0.3);
}

.stat-num {
    font-family: var(--font-typewriter);
    font-size: 36px;
    font-weight: 900;
    display: block;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--ink-light);
    margin-top: 4px;
    display: block;
}

/* coffee stain */
.coffee-stain {
    position: absolute;
    top: 30px;
    right: 40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, transparent 40%, var(--coffee) 42%, var(--coffee) 55%, transparent 57%);
    opacity: 0.6;
    transform: rotate(15deg);
    pointer-events: none;
}

/* ===== SCOREBOARD ===== */
.scoreboard {
    padding: 60px 24px;
    max-width: 800px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 900;
    transform: rotate(-0.8deg);
}

.section-header p {
    font-family: var(--font-handwritten);
    font-size: 20px;
    color: var(--ink-light);
}

.board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.board-card {
    background: var(--paper);
    border: 2px solid var(--ink);
    padding: 24px 20px;
    text-align: center;
    position: relative;
    transition: transform 0.2s;
}

.board-card:hover {
    transform: rotate(-2deg) scale(1.02);
}

/* tape on top of card */
.board-card::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 30%;
    width: 50px;
    height: 14px;
    background: var(--tape);
    transform: rotate(-3deg);
    border: 1px solid rgba(200,180,100,0.3);
}

.board-card.first {
    border-color: var(--red);
    border-width: 3px;
}

.board-rank {
    font-family: var(--font-handwritten);
    font-size: 20px;
    color: var(--ink-faded);
}

.board-count {
    font-family: var(--font-typewriter);
    font-size: 64px;
    font-weight: 900;
    line-height: 1;
    margin: 8px 0;
}

.board-party {
    font-size: 15px;
    font-weight: 700;
}

.board-bar {
    margin-top: 12px;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.board-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

.board-note {
    text-align: center;
    font-family: var(--font-handwritten);
    font-size: 16px;
    color: var(--ink-faded);
    margin-top: 20px;
}

/* ===== TORN PAPER ===== */
.torn-paper {
    height: 30px;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.torn-paper::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 30px;
    background: var(--bg);
    /* jagged edge with clip path */
    clip-path: polygon(
        0% 100%, 3% 60%, 6% 100%, 9% 55%, 12% 100%, 15% 65%, 18% 100%,
        21% 50%, 24% 100%, 27% 70%, 30% 100%, 33% 55%, 36% 100%, 39% 60%,
        42% 100%, 45% 50%, 48% 100%, 51% 65%, 54% 100%, 57% 55%, 60% 100%,
        63% 60%, 66% 100%, 69% 50%, 72% 100%, 75% 70%, 78% 100%, 81% 55%,
        84% 100%, 87% 65%, 90% 100%, 93% 50%, 96% 100%, 100% 60%, 100% 0%, 0% 0%
    );
}

/* ===== WHO'S NEXT ===== */
.whos-next {
    padding: 48px 24px;
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.whos-next h2 {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 8px;
}

.whos-next-subtitle {
    font-family: var(--font-handwritten);
    color: var(--ink-faded);
    font-size: 18px;
    margin-bottom: 24px;
}

.odds-grid {
    display: grid;
    gap: 12px;
}

.odds-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--paper);
    border: 1px solid #ddd;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 15px;
    transition: transform 0.15s;
}

.odds-row:hover {
    transform: translateX(4px);
    border-color: var(--red);
}

.odds-name {
    flex: 1;
    text-align: left;
    font-weight: 600;
}

.odds-party {
    font-size: 12px;
    color: var(--ink-faded);
}

.odds-meter {
    width: 100px;
    height: 12px;
    background: #eee;
    border-radius: 6px;
    overflow: hidden;
}

.odds-meter-fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, #f39c12, var(--red));
}

.odds-percent {
    font-family: var(--font-typewriter);
    font-weight: 700;
    min-width: 50px;
    text-align: right;
    color: var(--red);
}

/* ===== WANTED POSTERS ===== */
.wanted-section {
    padding: 60px 24px;
    max-width: 800px;
    margin: 0 auto;
}

.wanted-header {
    text-align: center;
    font-size: 28px;
    margin-bottom: 32px;
}

.wanted-header .sub {
    display: block;
    font-family: var(--font-handwritten);
    font-size: 20px;
    font-weight: 400;
    color: var(--ink-light);
}

.wanted-grid {
    display: grid;
    gap: 32px;
}

.wanted-card {
    background: var(--paper);
    border: 3px solid var(--ink);
    padding: 0;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}

.wanted-card:nth-child(odd) {
    transform: rotate(-0.7deg);
}

.wanted-card:nth-child(even) {
    transform: rotate(0.5deg);
}

.wanted-card:hover {
    transform: rotate(0deg) scale(1.01);
    box-shadow: 6px 6px 0 rgba(0,0,0,0.1);
}

/* ARRESTED stamp */
.stamp {
    position: absolute;
    top: 20px;
    right: -15px;
    background: transparent;
    color: var(--stamp-red);
    border: 4px solid var(--stamp-red);
    padding: 6px 20px;
    font-family: var(--font-typewriter);
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 4px;
    text-transform: uppercase;
    transform: rotate(12deg);
    opacity: 0.85;
    z-index: 5;
    border-radius: 4px;
    pointer-events: none;
}

.wanted-card-body {
    padding: 28px 24px;
}

.wanted-card-top {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* mugshot frame */
.mugshot {
    width: 100px;
    height: 120px;
    background: #ddd;
    border: 2px solid var(--ink);
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    overflow: hidden;
}

/* height chart lines */
.mugshot::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 18px,
        rgba(0,0,0,0.1) 18px,
        rgba(0,0,0,0.1) 19px
    );
    pointer-events: none;
}

.mugshot::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 24px;
    background: var(--ink);
}

.wanted-info h3 {
    font-size: 22px;
    font-weight: 900;
    line-height: 1.3;
}

.wanted-info .name-np {
    font-size: 15px;
    color: var(--ink-light);
    font-weight: 400;
}

.wanted-info .nickname {
    font-family: var(--font-handwritten);
    color: var(--red);
    font-size: 16px;
}

.wanted-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--ink-light);
}

.wanted-meta strong {
    color: var(--ink);
}

.wanted-charges {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(211, 47, 47, 0.06);
    border-left: 3px solid var(--red);
    font-size: 13px;
}

/* speech bubble for quip */
.speech-bubble {
    position: relative;
    background: var(--yellow-highlight);
    padding: 12px 16px;
    margin-top: 16px;
    font-family: var(--font-handwritten);
    font-size: 18px;
    color: var(--ink);
    border-radius: 4px;
    transform: rotate(-0.5deg);
}

.speech-bubble::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 24px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 12px solid var(--yellow-highlight);
}

/* string/yarn from conspiracy board */
.yarn {
    position: absolute;
    top: -20px;
    left: 50%;
    width: 2px;
    height: 20px;
    background: var(--red);
    opacity: 0.4;
}

.wanted-timer {
    font-family: var(--font-typewriter);
    font-size: 12px;
    color: var(--ink-faded);
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dashed #ddd;
}

/* sticky note annotation */
.sticky-note {
    position: absolute;
    bottom: -8px;
    right: 16px;
    background: #ffeaa7;
    padding: 8px 12px;
    font-family: var(--font-handwritten);
    font-size: 14px;
    color: #333;
    transform: rotate(3deg);
    box-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    z-index: 5;
    max-width: 180px;
}

/* ===== CHANGELOG ===== */
.changelog {
    padding: 48px 24px;
    max-width: 600px;
    margin: 0 auto;
}

.changelog h2 {
    text-align: center;
    font-size: 22px;
    margin-bottom: 24px;
}

.changelog-entries {
    border-left: 2px solid var(--ink-faded);
    padding-left: 20px;
}

.changelog-entry {
    margin-bottom: 16px;
    position: relative;
}

.changelog-entry::before {
    content: '●';
    position: absolute;
    left: -26px;
    color: var(--red);
    font-size: 12px;
}

.changelog-date {
    font-family: var(--font-typewriter);
    font-size: 12px;
    color: var(--ink-faded);
    display: block;
}

.changelog-text {
    font-size: 14px;
    color: var(--ink-light);
}

/* ===== ABOUT ===== */
.about {
    padding: 48px 24px;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.about h2 {
    font-size: 24px;
    margin-bottom: 16px;
    font-weight: 900;
}

.about p {
    font-size: 15px;
    color: var(--ink-light);
    margin-bottom: 12px;
    line-height: 1.8;
}

.about-btw {
    font-family: var(--font-handwritten);
    font-size: 18px !important;
    color: var(--ink) !important;
    background: var(--yellow-highlight);
    padding: 12px 16px;
    display: inline-block;
    transform: rotate(0.5deg);
}

.about-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 2px solid var(--ink);
    background: var(--paper);
    color: var(--ink);
    text-decoration: none;
    font-family: var(--font-nepali);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s;
    cursor: pointer;
}

.share-btn:hover {
    background: var(--ink);
    color: var(--paper);
    transform: translateY(-2px);
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 40px 24px;
    border-top: 2px dashed var(--ink-faded);
    font-size: 14px;
    color: var(--ink-faded);
}

.footer p { margin-bottom: 8px; }

.footer-version {
    font-family: var(--font-typewriter);
    font-size: 11px;
}

.footer-chai a {
    color: var(--red);
    text-decoration: none;
    border-bottom: 1px dashed var(--red);
}

/* ===== JAIL MODE TOGGLE ===== */
.jail-mode-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--ink);
    background: var(--paper);
    font-size: 22px;
    cursor: pointer;
    z-index: 200;
    transition: all 0.2s;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.15);
}

.jail-mode-toggle:hover {
    transform: scale(1.1) rotate(-10deg);
}

body.jail-mode .jail-mode-toggle {
    background: var(--ink);
    border-color: var(--ink-light);
}

/* ===== CONFETTI CANVAS ===== */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-2deg); }
    75% { transform: rotate(2deg); }
}

.wanted-card {
    animation: fadeIn 0.6s ease both;
}

.wanted-card:nth-child(1) { animation-delay: 0.1s; }
.wanted-card:nth-child(2) { animation-delay: 0.3s; }
.wanted-card:nth-child(3) { animation-delay: 0.5s; }
.wanted-card:nth-child(4) { animation-delay: 0.7s; }

.board-card {
    animation: fadeIn 0.4s ease both;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .hero { padding: 40px 16px 60px; }
    .hero-title { font-size: 64px; }
    .hero-stats { gap: 16px; }
    .stat-box { padding: 12px 16px; }
    .stat-num { font-size: 28px; }
    .safety-sign { padding: 16px 20px; }
    .safety-sign-number { font-size: 48px; }
    .scoreboard, .wanted-section, .whos-next { padding: 40px 16px; }
    .wanted-card-top { flex-direction: column; }
    .mugshot { width: 80px; height: 100px; }
    .stamp { font-size: 16px; right: -10px; }
    .coffee-stain { display: none; }
    .sticky-note { display: none; }
    .odds-meter { width: 60px; }
    .about-actions { flex-direction: column; align-items: center; }
}
