/* manual.css - Premium styling for the HTML game manual */

/* Global Styles */
html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Yuji Mai', serif;
    background: #050508;
    background-image:
        radial-gradient(circle at 50% 0%, rgba(26, 26, 46, 0.8) 0%, transparent 70%),
        linear-gradient(135deg, #050508 0%, #0a0a1a 100%);
    color: #d0d0d0;
    line-height: 1.8;
}

h1,
h2,
h3 {
    font-family: 'Yuji Mai', serif;
    color: #ffcc00;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
    letter-spacing: 2px;
}

h1 {
    text-align: center;
    font-size: clamp(1.5rem, 8vw, 3.5rem);
    margin-bottom: 3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    background: linear-gradient(to bottom, #fff 0%, #ffcc00 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(255, 204, 0, 0.4));
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #050508;
}

::-webkit-scrollbar-thumb {
    background: #222;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ffcc00;
}

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* Section Card */
.section-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.4s ease;
}

.section-card:hover {
    border-color: rgba(255, 204, 0, 0.2);
    box-shadow: 0 0 40px rgba(255, 204, 0, 0.05);
}

/* Spoiler Button */
.spoiler-btn {
    background: linear-gradient(90deg, rgba(255, 204, 0, 0.1), transparent);
    border: none;
    border-left: 2px solid #ffcc00;
    color: #ffcc00;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Yuji Mai', serif;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    width: 100%;
    text-align: left;
}

.spoiler-btn:hover {
    background: rgba(255, 204, 0, 0.15);
    padding-left: 2rem;
}

/* Details Panel */
.details {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 1.5rem;
}

.story-box {
    line-height: 1.8;
    color: #e0e0e0;
    text-align: justify;
    padding: 0 1rem;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
}

.story-box p {
    margin-bottom: 1.2rem;
}

.details img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 0.5rem;
}

/* Grid for images */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Table for class/gender details */
.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.info-table th,
.info-table td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    text-align: left;
}

.info-table th {
    background: rgba(255, 255, 255, 0.12);
}

/* NPC Card */
.npc-profile {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid #4a90e2;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.npc-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.npc-avatar {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.npc-info h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #4a90e2;
}

.npc-location {
    font-size: 0.9rem;
    color: #aaa;
}

.npc-story {
    font-style: italic;
    color: #ccc;
    position: relative;
    padding-left: 1rem;
}

.npc-story::before {
    content: '"';
    position: absolute;
    left: 0;
    top: -0.5rem;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}

/* Choice Table */
.choice-table {
    width: 100%;
    margin-top: 1rem;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.choice-table th,
.choice-table td {
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    text-align: left;
}

.choice-table th {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    background: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.choice-label {
    font-weight: 600;
    color: #4a90e2;
}

/* Karma Badges */
.karma-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.karma-pos {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.karma-neg {
    background: rgba(244, 67, 54, 0.2);
    color: #ef5350;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

/* Reward Styling */
.reward-item {
    color: #ffd700;
    font-weight: 600;
}

.reward-info {
    font-size: 0.85rem;
    color: #aaa;
}

/* Floor Context */
.floor-context {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
}

.floor-context h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #fff;
    border-left: 3px solid #ff5722;
    padding-left: 0.5rem;
}

/* Monster Gallery */
.monster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.monster-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.2rem;
    transition: transform 0.3s ease, background 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.monster-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.monster-visual {
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
}

.monster-sprite {
    height: 100px;
    object-fit: contain;
    image-rendering: pixelated;
}

.monster-info h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #fff;
}

.monster-lore {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.4;
    font-style: italic;
}

.monster-skill {
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.floor-tag {
    background: #ffcc00;
    color: #000;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.5rem;
    vertical-align: middle;
}


.skill-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.skill-tag {
    background: #6200ea;
    color: #fff;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
}

.skill-name {
    font-weight: 600;
    color: #bb86fc;
}

.skill-desc {
    font-size: 0.85rem;
    color: #999;
}

.variant-box {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #888;
}

/* Game Systems */
.system-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1rem;
}

.system-box {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid #bb86fc;
}

.system-box h3 {
    margin-top: 0;
    color: #bb86fc;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Control Keys */
.control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.8rem;
    border-radius: 6px;
}

.control-key {
    background: #333;
    color: #eee;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    border: 1px solid #555;
    border-bottom: 3px solid #111;
    font-family: monospace;
    font-weight: bold;
    min-width: 1.5rem;
    text-align: center;
}

/* Karma Comparison */
.karma-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.karma-card {
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.karma-card.light {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.karma-card.dark {
    background: rgba(156, 39, 176, 0.1);
    border: 1px solid rgba(156, 39, 176, 0.2);
}

.karma-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Class & Gender Gallery */
.class-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.class-section:last-child {
    border-bottom: none;
}

.class-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.class-header h3 {
    margin: 0;
    font-size: 1.8rem;
    color: #ffcc00;
}

.class-description {
    color: #ccc;
    font-style: italic;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 3px solid #ffcc00;
}

.gender-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gender-card {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    gap: 1.2rem;
    transition: transform 0.3s ease;
}

.gender-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.07);
}

.gender-portrait {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.gender-info {
    flex: 1;
}

.gender-label {
    font-size: 0.8rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
}

.gender-skill {
    margin-top: 0.8rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Boss Cards */
.boss-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.boss-card {
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.05), rgba(255, 50, 0, 0.05));
    border: 1px solid rgba(255, 204, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    position: relative;
    overflow: hidden;
}

.boss-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(255, 204, 0, 0.1), transparent);
    pointer-events: none;
}

.boss-visual {
    width: 100%;
    height: 320px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.boss-sprite {
    height: 280px;
    width: auto;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.8));
}

/* Deep Monster Cards (Vertical Layout Support) */
.deep-monster-visual {
    width: 100%;
    height: 320px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.deep-monster-sprite {
    height: 300px;
    width: auto;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.8));
}


.deep-warning {
    border-left-color: #f44336 !important;
    background: rgba(244, 67, 54, 0.05) !important;
}

.death-penalty {
    border-left-color: #9c27b0 !important;
    background: rgba(156, 39, 176, 0.05) !important;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .npc-header {
        flex-direction: column;
        text-align: center;
    }

    .monster-grid,
    .boss-grid {
        grid-template-columns: 1fr;
    }
}