:root {
    --primary-color: #ff9a9e;
    --secondary-color: #fad0c4;
    --accent-color: #a18cd1;
    --text-color: #2d3436;
    --bg-color: #fff0f5;
    /* Lavender Blush */
    --panel-border: 3px solid #2d3436;
    --comic-font: 'Bangers', cursive;
    --body-font: 'Outfit', sans-serif;
}

body {
    font-family: var(--body-font);
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--comic-font);
    letter-spacing: 1px;
}

/* Loader */
#isekai-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.summoning-circle {
    position: relative;
    width: 150px;
    height: 150px;
    margin-bottom: 20px;
}

.rune-ring {
    position: absolute;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color);
}

.rune-ring.outer {
    width: 100%;
    height: 100%;
    border-style: dashed;
    animation: spin 10s linear infinite;
}

.rune-ring.inner {
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    border-style: solid;
    border-color: var(--accent-color);
    animation: spin-reverse 5s linear infinite;
}

.loading-text {
    color: var(--accent-color);
    animation: pulse 1.5s infinite;
}

.progress-bar-container {
    width: 300px;
    height: 10px;
    background: #eee;
    border-radius: 5px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.5s ease;
}

/* Navbar */
.isekai-nav {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--primary-color);
    padding: 15px 0;
}

.navbar-brand {
    font-family: var(--comic-font);
    font-size: 1.5rem;
    color: var(--accent-color) !important;
}

.nav-link {
    font-weight: 500;
    color: var(--text-color) !important;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* Hero Section (Anime Title Screen) */
.hero-section {
    position: relative;
    min-height: 100vh;
    padding-top: 80px;
    overflow: hidden;
    background: #fff0f5;
}

.hero-bg-fx {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-conic-gradient(from 0deg,
            rgba(255, 154, 158, 0.1) 0deg 10deg,
            transparent 10deg 20deg);
    animation: spin 60s linear infinite;
    z-index: 0;
}

.title-panel {
    position: relative;
    z-index: 2;
}

.chapter-badge {
    background: #000;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    padding: 5px 15px;
    font-weight: bold;
    letter-spacing: 2px;
    transform: skew(-15deg);
    display: inline-block;
    margin-bottom: 10px;
    box-shadow: 5px 5px 0 rgba(255, 154, 158, 0.5);
}

.anime-title {
    font-size: 5rem;
    line-height: 0.9;
    color: #2d3436;
    text-transform: uppercase;
    transform: rotate(-2deg);
    text-shadow: 3px 3px 0 #fff, 6px 6px 0 #000;
    margin-bottom: 10px;
}

.text-stroke {
    color: #ff9a9e;
    -webkit-text-stroke: 2px #000;
    text-shadow: none;
    /* Reset shadow for stroke effect */
}

.anime-subtitle {
    font-size: 1.2rem;
    color: #636e72;
    background: rgba(255, 255, 255, 0.8);
    display: inline-block;
    padding: 5px 10px;
    font-weight: bold;
    margin-bottom: 30px;
}

/* System Log Stats */
.system-log-box {
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid #00f3ff;
    padding: 15px;
    color: #00f3ff;
    font-family: monospace;
    font-size: 0.9rem;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
    max-width: 400px;
}

.log-header {
    border-bottom: 1px dashed rgba(0, 243, 255, 0.5);
    margin-bottom: 10px;
    padding-bottom: 5px;
}

.blink {
    animation: blink 1s infinite;
}

.log-entry {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.cmd {
    width: 120px;
    color: #aaa;
}

.log-bar {
    flex-grow: 1;
    height: 8px;
    background: #333;
    margin: 0 10px;
    position: relative;
}

.log-bar div {
    height: 100%;
    background: #00f3ff;
    box-shadow: 0 0 5px #00f3ff;
}

.luck-bar div {
    background: #ff5f56;
    box-shadow: 0 0 5px #ff5f56;
}

.val {
    width: 40px;
    text-align: right;
    color: #fff;
}

/* Hero Character Card */
.hero-card-container {
    perspective: 1000px;
    position: relative;
    display: inline-block;
}

.hero-card-frame {
    background: #fff;
    padding: 15px 15px 60px 15px;
    /* Polaroid bottom heavy */
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.2);
    transform: rotate(3deg);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s;
    max-width: 400px;
    margin: 0 auto;
}

.hero-card-frame:hover {
    transform: rotate(0deg) scale(1.02);
}

.hero-card-img {
    width: 100%;
    height: auto;
    border: 2px solid #000;
}

.card-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0) 60%);
    pointer-events: none;
    opacity: 0.5;
}

.scouter-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 80px;
    height: 80px;
    pointer-events: none;
}

.scouter-ring {
    width: 100%;
    height: 100%;
    border: 2px dashed #00f3ff;
    border-radius: 50%;
    animation: spin 5s linear infinite;
}

.power-level {
    position: absolute;
    bottom: -25px;
    right: 0;
    color: #00f3ff;
    font-family: monospace;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.8);
    padding: 2px 5px;
    font-size: 0.8rem;
}

.speech-bubble-hero {
    position: absolute;
    top: -20px;
    right: -30px;
    background: #fff;
    border: 3px solid #000;
    padding: 15px;
    border-radius: 50%;
    font-family: var(--comic-font);
    font-size: 1.1rem;
    z-index: 5;
    transform: rotate(5deg);
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.2);
    max-width: 200px;
}

/* Start Button */
.btn-start-game {
    display: inline-block;
    background: #000;
    padding: 5px;
    /* Border thickness */
    border: none;
    transition: transform 0.1s;
    text-decoration: none;
}

.btn-inner {
    display: block;
    background: #ff5f56;
    color: #fff;
    font-family: var(--comic-font);
    font-size: 1.5rem;
    padding: 10px 40px;
    border: 2px solid #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-start-game:hover {
    transform: scale(1.05);
}

.btn-start-game:hover .btn-inner {
    background: #ff0000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
    color: #fff;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Media Queries for Hero */
@media (max-width: 991px) {
    .anime-title {
        font-size: 3.5rem;
    }

    .hero-card-frame {
        max-width: 300px;
    }
}

/* Section Titles */
.section-title span {
    background: linear-gradient(120deg, var(--secondary-color) 0%, var(--secondary-color) 100%);
    background-repeat: no-repeat;
    background-size: 100% 40%;
    background-position: 0 80%;
    padding: 0 10px;
}

.section-padding {
    padding: 80px 0;
}

/* Status Window (RPG Redesign) */
.rpg-theme {
    background: rgba(13, 17, 23, 0.95);
    /* Deep dark blue */
    border: 3px double #00f3ff;
    /* Cyan neon border */
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3), inset 0 0 50px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    position: relative;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}

.rpg-header {
    background: linear-gradient(90deg, #0d1117 0%, #1c2333 50%, #0d1117 100%);
    border-bottom: 2px solid #00f3ff;
    padding: 10px;
    text-align: center;
    position: relative;
}

.window-title {
    color: #00f3ff;
    font-family: var(--comic-font);
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-shadow: 0 0 5px #00f3ff;
}

.header-deco {
    color: #ffd700;
    /* Gold */
    font-size: 1.2rem;
    margin: 0 10px;
}

/* Character Column */
.char-col {
    padding: 40px 20px;
    border-right: 1px solid rgba(0, 243, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rpg-frame {
    position: relative;
    border: 3px solid #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    padding: 3px;
    background: rgba(0, 0, 0, 0.5);
    display: inline-block;
    max-width: 200px;
}

.rpg-avatar {
    width: 100%;
    height: auto;
    display: block;
}

.level-badge {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: #d32f2f;
    color: #fff;
    padding: 2px 10px;
    border: 2px solid #ffd700;
    font-weight: bold;
    font-family: var(--comic-font);
    white-space: nowrap;
}

.rpg-name {
    color: #fff;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 5px;
}

.rpg-class {
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* Vital Bars */
.vital-bars {
    width: 100%;
    padding: 0 10px;
}

.vital-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.vital-label {
    width: 30px;
    font-weight: bold;
    font-size: 0.8rem;
    color: #aaa;
}

.vital-bar-track {
    flex-grow: 1;
    background: #333;
    height: 12px;
    border: 1px solid #555;
    position: relative;
}

.vital-bar-fill {
    height: 100%;
    font-size: 0.6rem;
    line-height: 10px;
    text-align: right;
    padding-right: 5px;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
}

.hp-fill {
    background: linear-gradient(90deg, #c62828, #e53935);
}

.mp-fill {
    background: linear-gradient(90deg, #1565c0, #1e88e5);
}

/* Info Column */
.info-col {
    padding: 40px 30px;
}

.panel-label {
    color: #ffd700;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 5px;
    margin-bottom: 15px;
    font-family: var(--comic-font);
    letter-spacing: 1px;
}

.rpg-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    color: #ddd;
    font-size: 0.95rem;
    line-height: 1.6;
}

.rpg-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.rpg-stat-row {
    background: rgba(0, 243, 255, 0.05);
    padding: 8px 12px;
    border-left: 3px solid #00f3ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.full-width {
    grid-column: 1 / -1;
}

.stat-key {
    color: #888;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.stat-val {
    color: #fff;
    font-weight: 500;
}

.email-val {
    word-break: break-all;
    font-size: 0.9rem;
}

.btn-rpg-action {
    background: linear-gradient(180deg, #ffd700, #ffb300);
    border: 2px solid #fff;
    color: #3e2723;
    font-weight: bold;
    font-family: var(--comic-font);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    letter-spacing: 1px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    padding: 10px 20px;
}

.btn-rpg-action:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    color: #000;
}

/* Responsive Tweak for Border */
@media (max-width: 991px) {
    .char-col {
        border-right: none;
        border-bottom: 1px solid rgba(0, 243, 255, 0.2);
    }
}

/* Grimoire Cards (Magical Tablets) */
.grimoire-card {
    background: #1e1e2e;
    border: 2px solid rgba(255, 255, 255, 0.1);
    padding: 30px 20px;
    text-align: center;
    border-radius: 15px;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.grimoire-card:hover {
    transform: translateY(-10px);
}

/* Color Variations */
.magic-card-purple {
    border-bottom: 4px solid #d05ce3;
    box-shadow: 0 10px 30px rgba(208, 92, 227, 0.2);
}

.magic-card-purple:hover {
    box-shadow: 0 15px 40px rgba(208, 92, 227, 0.4);
}

.magic-card-cyan {
    border-bottom: 4px solid #00f3ff;
    box-shadow: 0 10px 30px rgba(0, 243, 255, 0.2);
}

.magic-card-cyan:hover {
    box-shadow: 0 15px 40px rgba(0, 243, 255, 0.4);
}

.magic-card-orange {
    border-bottom: 4px solid #ffa502;
    box-shadow: 0 10px 30px rgba(255, 165, 2, 0.2);
}

.magic-card-orange:hover {
    box-shadow: 0 15px 40px rgba(255, 165, 2, 0.4);
}

/* Icons & Circles */
.card-icon-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.magic-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    animation: spin 10s linear infinite;
}

.magic-card-purple .magic-circle {
    border-color: #d05ce3;
}

.magic-card-cyan .magic-circle {
    border-color: #00f3ff;
}

.magic-card-orange .magic-circle {
    border-color: #ffa502;
}

.card-icon {
    font-size: 2.5rem;
    color: #fff;
    z-index: 2;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.magic-card-purple .card-icon {
    color: #d05ce3;
}

.magic-card-cyan .card-icon {
    color: #00f3ff;
}

.magic-card-orange .card-icon {
    color: #ffa502;
}

/* Titles */
.magic-title {
    font-family: var(--comic-font);
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 5px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.magic-subtitle {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 25px;
    font-weight: 500;
}

/* Spell Slots (List) */
.spell-list {
    list-style: none;
    padding: 0;
    text-align: left;
    margin-top: 10px;
}

.spell-slot {
    background: rgba(0, 0, 0, 0.3);
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    color: #ddd;
    font-size: 0.95rem;
}

.spell-slot:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
    color: #fff;
}

.magic-card-purple .spell-slot:hover {
    border-left-color: #d05ce3;
}

.magic-card-cyan .spell-slot:hover {
    border-left-color: #00f3ff;
}

.magic-card-orange .spell-slot:hover {
    border-left-color: #ffa502;
}

.mastery {
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    color: #fff;
}

.spell-list {
    list-style: none;
    padding: 0;
    text-align: left;
    margin-top: 20px;
}

.spell-list li {
    padding: 5px 0;
    border-bottom: 1px dashed #eee;
}

.spell-list li::before {
    content: '✨';
    margin-right: 10px;
}

/* Quest Board (Guild Notice Board) */
.quest-section {
    position: relative;
    padding: 60px 0;
}

.quest-wood-bg {
    /* Now acts as the actual Board Frame */
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1400px;
    height: calc(100% - 80px);
    background: #8b4513;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjN2Y0YTAwIi8+PC9zdmc+');
    border-radius: 15px;
    box-shadow:
        inset 0 0 50px rgba(0, 0, 0, 0.8),
        /* Inner shadow */
        0 20px 50px rgba(0, 0, 0, 0.5);
    /* Drop shadow from wall */
    border: 12px solid #5d4037;
    /* Dark Wood Frame */
    outline: 4px solid #dda15e;
    /* Gold Trim */
    z-index: 0;
}

.board-header {
    position: relative;
    z-index: 2;
    background: #fff;
    display: inline-block;
    padding: 10px 30px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 3px solid #5d4037;
    transform: rotate(-1deg);
    margin-top: -20px;
    /* Overlap top of board */
}

.board-title {
    font-family: var(--comic-font);
    font-size: 2rem;
    color: #5d4037;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.board-subtitle {
    margin: 0;
    color: #8d6e63;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Quest Paper (Compact Bounty Poster) */
.quest-paper {
    background: #fdf6e3;
    padding: 20px;
    position: relative;
    box-shadow: 3px 6px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: top center;
    border: 1px solid #d4c5a3;
    /* Reduced height */
    min-height: 380px;
    display: flex;
    flex-direction: column;
}

.quest-paper::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 16px;
    background: #fdf6e3;
    -webkit-mask-image: linear-gradient(to bottom, transparent 50%, black 50%),
        repeating-linear-gradient(45deg, transparent 0, black 2px, transparent 4px),
        repeating-linear-gradient(-45deg, transparent 0, black 2px, transparent 4px);
    -webkit-mask-composite: source-in;
    clip-path: polygon(0% 0%, 100% 0%, 100% 80%, 95% 100%, 90% 85%, 85% 100%, 80% 85%, 75% 100%, 70% 85%, 65% 100%, 60% 85%, 55% 100%, 50% 85%, 45% 100%, 40% 85%, 35% 100%, 30% 85%, 25% 100%, 20% 85%, 15% 100%, 10% 85%, 5% 100%, 0% 80%);
}

.quest-paper:hover {
    transform: scale(1.03) rotate(0deg) !important;
    z-index: 10;
    box-shadow: 8px 15px 25px rgba(0, 0, 0, 0.4);
}

.quest-paper:nth-child(odd) {
    transform: rotate(1deg);
}

.quest-paper:nth-child(even) {
    transform: rotate(-1deg);
}

.pin {
    width: 16px;
    height: 16px;
    background: radial-gradient(circle at 30% 30%, #ff5f56, #bf360c);
    border-radius: 50%;
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
    z-index: 5;
}

.quest-header {
    border-bottom: 2px solid #5d4037;
    margin-bottom: 10px;
    padding-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quest-type {
    font-family: 'Impact', sans-serif;
    font-size: 1.2rem;
    color: #5d4037;
    letter-spacing: 1px;
}

.quest-rank {
    font-weight: bold;
    font-size: 1rem;
    padding: 0;
    border: 2px solid;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(10deg);
}

.rank-s {
    color: #d63031;
    border-color: #d63031;
}

.rank-a {
    color: #e67e22;
    border-color: #e67e22;
}

.rank-s-plus {
    color: #8e44ad;
    border-color: #8e44ad;
    box-shadow: 0 0 5px rgba(142, 68, 173, 0.4);
}

.quest-title {
    font-family: var(--comic-font);
    font-size: 1.1rem;
    color: #2d3436;
    text-align: center;
    margin-bottom: 10px;
    line-height: 1.2;
}

.quest-img-box {
    text-align: center;
    margin-bottom: 10px;
    background: #e4d7c1;
    padding: 10px;
    border-radius: 5px;
    border: 1px dashed #bcaaa4;
}

.quest-img-box i {
    font-size: 2rem;
    color: #5d4037;
}

.quest-desc {
    font-size: 0.85rem;
    color: #4e342e;
    margin-bottom: 10px;
    line-height: 1.4;
    flex-grow: 1;
}

.quest-stats {
    background: rgba(0, 0, 0, 0.05);
    padding: 8px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-size: 0.8rem;
}

.stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-weight: bold;
    color: #5d4037;
}

.stat span {
    color: #d63031;
}

.quest-tags {
    margin-bottom: 20px;
    text-align: center;
}

.quest-tags span {
    background: #5d4037;
    color: #fff;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin: 0 2px;
}

.btn-accept-quest {
    display: block;
    width: 100%;
    padding: 12px;
    background: #d63031;
    color: #fff;
    text-align: center;
    font-family: var(--comic-font);
    font-size: 1.1rem;
    text-decoration: none;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
    border: 2px solid #b71c1c;
}

.btn-accept-quest:hover {
    background: #b71c1c;
    color: #fff;
    transform: scale(1.02);
}

.stamp-mark {
    display: none;
    /* Hidden by default */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg) scale(2);
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    border: 3px solid #fff;
    padding: 5px 10px;
    opacity: 0;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

/* Animation Classes */
.btn-accept-quest.stamped .btn-text {
    visibility: hidden;
}

.btn-accept-quest.stamped .stamp-mark {
    display: block;
    animation: stamp-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes stamp-in {
    0% {
        transform: translate(-50%, -50%) rotate(-15deg) scale(3);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) rotate(-15deg) scale(1);
        opacity: 1;
    }
}

.quest-accepted-anim {
    animation: take-quest 0.5s ease-in forwards;
}

@keyframes take-quest {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2) translateY(-20px);
        opacity: 0.8;
    }

    100% {
        transform: scale(0) translateY(100px);
        opacity: 0;
    }
}



.btn-accept:hover {
    background: #6d4c41;
    color: #fff;
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background-color: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    right: -17px;
    background-color: #fff;
    border: 4px solid var(--accent-color);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.left {
    left: 0;
}

.right {
    left: 50%;
}

.left::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    right: 30px;
    border: medium solid white;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent white;
}

.right::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    left: 30px;
    border: medium solid white;
    border-width: 10px 10px 10px 0;
    border-color: transparent white transparent transparent;
}

.right::after {
    left: -16px;
}

.timeline-item .content {
    padding: 20px;
    background-color: white;
    position: relative;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Battle Report (Experience) */
.battle-report {
    background: #fff;
    border: 3px solid #2d3436;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.2) !important;
    position: relative;
    overflow: hidden;
    padding: 0 !important;
    /* Reset padding for header */
}

.report-header {
    background: #2d3436;
    color: #fff;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.report-type {
    color: #ffd700;
}

.battle-title {
    font-family: var(--comic-font);
    font-size: 1.2rem;
    margin: 15px 15px 5px 15px;
    color: #2d3436;
}

.battle-realm {
    font-size: 0.9rem;
    color: #636e72;
    margin: 0 15px 15px 15px;
    font-weight: bold;
    border-bottom: 2px dashed #b2bec3;
    padding-bottom: 10px;
}

.battle-stats {
    padding: 0 15px 15px 15px;
    font-size: 0.9rem;
}

.battle-stats p {
    margin-bottom: 5px;
}

.battle-stats i {
    width: 20px;
    text-align: center;
    margin-right: 5px;
    color: var(--primary-color);
}

/* Adventurer Card (Premium) */
.adventurer-card {
    width: 100%;
    max-width: 450px;
    height: 280px;
    margin: 0 auto;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    display: flex;
    flex-direction: column;
}

.card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEgMWgydjJIMUMxeiIgZmlsbD0iI2ZmZiIgZmlsbC1vcGFjaXR5PSIwLjEiLz48L3N2Zz4=');
    opacity: 0.3;
}

.card-header-band {
    background: #2d3436;
    color: #ffd700;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #ffd700;
    z-index: 2;
}

.guild-name {
    font-family: var(--comic-font);
    letter-spacing: 2px;
}

.card-rank {
    font-weight: 800;
    font-size: 1.2rem;
    text-shadow: 0 0 5px #ffd700;
}

.card-content {
    flex-grow: 1;
    display: flex;
    padding: 20px;
    position: relative;
    z-index: 2;
    gap: 20px;
}

.card-photo {
    width: 100px;
    height: 120px;
    border: 3px solid #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    background: #fff;
    overflow: hidden;
}

.card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.holo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(125deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.4) 45%, rgba(255, 255, 255, 0.4) 55%, rgba(255, 255, 255, 0) 60%);
    pointer-events: none;
}

.card-details {
    flex-grow: 1;
    color: #2d3436;
}

.adventurer-name {
    font-family: var(--comic-font);
    margin: 0;
    font-size: 1.5rem;
    color: #2d3436;
    border-bottom: 2px solid #2d3436;
    display: inline-block;
    padding-bottom: 2px;
}

.adventurer-class {
    font-weight: bold;
    margin-top: 5px;
    font-size: 0.9rem;
}

.adventurer-id {
    font-family: monospace;
    color: #636e72;
    font-size: 0.8rem;
}

.skill-tags {
    margin-top: 10px;
}

.tag {
    background: #2d3436;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-right: 5px;
}

.social-links-mini {
    display: flex;
    gap: 10px;
}

.social-links-mini a {
    color: #2d3436;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.social-links-mini a:hover {
    color: var(--primary-color);
}

.card-stamp {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 80px;
    height: 80px;
    border: 3px solid rgba(214, 48, 49, 0.6);
    border-radius: 50%;
    color: rgba(214, 48, 49, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: rotate(-15deg);
    font-weight: bold;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.card-stamp i {
    font-size: 1.5rem;
}

.card-footer-band {
    background: #2d3436;
    padding: 5px;
    color: #fff;
    text-align: center;
}

.barcode {
    font-family: 'Libre Barcode 39', cursive;
    /* Fallback if not loaded */
    letter-spacing: 3px;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Job Board (Commission) */
.commission-board {
    position: relative;
    padding-top: 20px;
}

.paper-clip {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: #555;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.commission-paper {
    background: #fdf6e3;
    /* Cream/Parchment */
    padding: 30px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.1);
    transform: rotate(1deg);
    border: 1px solid #d4c5a3;
    position: relative;
}

.commission-paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjZmZmIi8+CjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IiNjY2MiLz4KPC9zdmc+');
    opacity: 0.1;
    pointer-events: none;
}

.paper-title {
    text-align: center;
    font-family: var(--comic-font);
    border-bottom: 2px dashed #b2bec3;
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: #2d3436;
}

.paper-label {
    font-weight: bold;
    font-size: 0.9rem;
    color: #636e72;
    margin-bottom: 5px;
    display: block;
}

.paper-input {
    width: 100%;
    border: none;
    border-bottom: 2px solid #b2bec3;
    background: transparent;
    padding: 8px;
    font-family: 'Gloria Hallelujah', cursive, sans-serif;
    /* Handwritten style fallback */
    color: #2d3436;
    transition: border-color 0.3s;
}

.paper-input:focus {
    outline: none;
    border-bottom-color: var(--primary-color);
}

.btn-stamp {
    margin-top: 20px;
    width: 100%;
    background: #fff;
    border: 2px solid #d63031;
    color: #d63031;
    font-family: var(--comic-font);
    font-size: 1.2rem;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    font-weight: bold;
}

.btn-stamp:hover {
    background: #d63031;
    color: #fff;
    transform: rotate(-2deg) scale(1.02);
}

/* Small Animation Helpers */
@keyframes stamp-bounce {
    0% {
        transform: scale(2);
        opacity: 0;
    }

    50% {
        transform: scale(0.9);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.stamped {
    animation: stamp-bounce 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Animations */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes spin-reverse {
    0% {
        transform: rotate(360deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

.floating-anim {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Sakura Animation */
#sakura-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    /* Behind everything */
    pointer-events: none;
}

.sakura {
    position: absolute;
    background-color: #ffb7b2;
    /* Pinkish */
    border-radius: 100% 0 100% 0;
    opacity: 0.8;
    transform-origin: center;
    animation: fall linear infinite, sway ease-in-out infinite;
}

@keyframes fall {
    0% {
        top: -10%;
    }

    100% {
        top: 110%;
    }
}

@keyframes sway {

    0%,
    100% {
        transform: translateX(0) rotate(0deg);
    }

    50% {
        transform: translateX(20px) rotate(45deg);
    }
}

/* Responsive Design */
@media screen and (max-width: 991px) {
    .anime-title {
        font-size: 3rem;
    }

    .hero-card-frame {
        max-width: 280px;
        margin-top: 30px;
    }

    .speech-bubble-hero {
        top: -10px;
        right: -10px;
        font-size: 0.9rem;
        padding: 10px;
    }
}

@media screen and (max-width: 768px) {

    /* Quest Board Mobile */
    .quest-wood-bg {
        width: 100%;
        left: 0;
        transform: none;
        border-width: 5px;
        border-radius: 0;
    }

    .quest-paper {
        margin-bottom: 30px;
        transform: rotate(0deg) !important;
        /* Straighter for readability on mobile */
        min-height: auto;
    }

    .board-title {
        font-size: 1.8rem;
    }

    /* Adventurer Card Mobile */
    .adventurer-card {
        height: auto;
        min-height: 280px;
    }

    .card-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    .adventurer-name {
        font-size: 1.2rem;
    }

    .social-links-mini {
        justify-content: center;
        margin-top: 10px;
    }

    .card-stamp {
        width: 60px;
        height: 60px;
        font-size: 0.6rem;
        bottom: 10px;
        right: 10px;
    }

    .card-stamp i {
        font-size: 1.2rem;
    }
}

@media screen and (max-width: 600px) {

    /* Timeline Mobile */
    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item::before {
        left: 60px;
        border: medium solid white;
        border-width: 10px 10px 10px 0;
        border-color: transparent white transparent transparent;
    }

    .left::after,
    .right::after {
        left: 15px;
    }

    .right {
        left: 0%;
    }

    /* Hero Mobile */
    .anime-title {
        font-size: 2.2rem;
        letter-spacing: -1px;
    }

    .system-log-box {
        font-size: 0.8rem;
    }

    .btn-inner {
        padding: 10px 20px;
        font-size: 1.2rem;
    }
}