/* ==========================================================================
   Mindbug Rulebook Styling - Authentic Print Recreation
   ========================================================================== */

#rules.rules {
    position: relative;
    max-width: 840px;
    margin: 0 auto;
    padding: 44px 44px 48px 44px;
    background-color: #fbf8ee;
    color: #1f2328;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", Arial, sans-serif;
    font-size: 15.5px;
    line-height: 1.6;
    border: 1px solid #dcd5c2;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22);
    box-sizing: border-box;
    overflow: hidden;
}

/* Grungy Ink Splatters on Top Edge */
#rules.rules::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    pointer-events: none;
    z-index: 1;
    background-image: url("images/grunge_top.svg");
    background-repeat: no-repeat;
    background-position: top center;
    background-size: 100% 48px;
}

/* Grungy Ink Splatters on Left and Right Edges */
#rules.rules::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
    background-image: url("images/grunge_left.svg"), url("images/grunge_right.svg");
    background-repeat: repeat-y, repeat-y;
    background-position: left top, right top;
    background-size: 32px 600px, 32px 600px;
}

/* Cover / Banner Image across the full width of the rule text */
#rules .cover {
    position: relative;
    text-align: center;
    margin: 8px 0 24px 0;
    z-index: 2;
    width: 100%;
}

#rules .cover img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.15);
    display: block;
}

/* Comic Speech Bubble Over Banner (Right of the creature) */
#rules .cover .speech-bubble {
    position: absolute;
    top: 50%;
    right: 4%;
    transform: translateY(-50%);
    width: 56%;
    max-width: 400px;
    background: #ffffff;
    border: 2.5px solid #1a1e24;
    border-radius: 16px;
    padding: 12px 18px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
    text-align: left;
    z-index: 5;
}

#rules .cover .speech-bubble p {
    margin: 0;
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.38;
    color: #1a1e24;
    font-style: italic;
}

/* Speech Bubble Pointer (pointing left towards the creature) */
#rules .cover .speech-bubble::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -16px;
    transform: translateY(-50%);
    border-width: 9px 16px 9px 0;
    border-style: solid;
    border-color: transparent #1a1e24 transparent transparent;
    display: block;
    width: 0;
}

#rules .cover .speech-bubble::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -12px;
    transform: translateY(-50%);
    border-width: 7px 13px 7px 0;
    border-style: solid;
    border-color: transparent #ffffff transparent transparent;
    display: block;
    width: 0;
}

@media (max-width: 600px) {
    #rules .cover .speech-bubble {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        width: 96%;
        max-width: 100%;
        margin: 12px auto 0 auto;
    }
    #rules .cover .speech-bubble::before,
    #rules .cover .speech-bubble::after {
        display: none;
    }
}

/* Card Annotation Diagram */
#rules .card-annotation-diagram {
    max-width: 500px;
    margin: 22px auto 26px auto;
    position: relative;
    z-index: 2;
    text-align: center;
}

#rules .card-annotation-diagram svg {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Keyword Example Diagram */
#rules .keyword-example-diagram {
    max-width: 660px;
    margin: 16px auto 24px auto;
    position: relative;
    z-index: 2;
    text-align: center;
}

#rules .keyword-example-diagram svg {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    overflow: visible;
}

#rules .keyword-example-diagram .diagram-card {
    cursor: zoom-in;
    transform-box: fill-box;
    transform-origin: center center;
    transition: transform 0.22s ease-out, filter 0.22s ease-out;
}

#rules .keyword-example-diagram .diagram-card:hover {
    transform: scale(2.1);
    filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.9));
}

/* Yucata Platform Guidance Box */
#rules .deviation {
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.08) 0%, rgba(2, 136, 209, 0.04) 100%);
    border-left: 4px solid #00acc1;
    border-top: 1px solid rgba(0, 172, 193, 0.2);
    border-right: 1px solid rgba(0, 172, 193, 0.15);
    border-bottom: 1px solid rgba(0, 172, 193, 0.15);
    padding: 16px 20px;
    margin: 20px 0 28px 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

#rules .deviation h3 {
    color: #00838f;
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 800;
}

#rules .deviation p {
    margin: 0;
    color: #2c383d;
    font-size: 0.95rem;
    line-height: 1.55;
}

/* Chapters Layout */
#rules .chapter {
    position: relative;
    z-index: 2;
    margin-bottom: 32px;
}

/* Authentic Mindbug Chapter Header */
#rules .chapter-header {
    display: flex;
    align-items: center;
    margin: 28px 0 16px 0;
    position: relative;
    padding-left: 8px;
}

/* Mindbug Eye Badge */
#rules .chapter-header .chapter-eye-badge {
    position: relative;
    width: 66px;
    height: 40px;
    flex-shrink: 0;
    margin-right: -34px;
    z-index: 3;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

#rules .chapter-header .chapter-eye-badge svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Dark Slate Title Bar with Centered Title & Amber Borders */
#rules .chapter-header .chapter-title-bar {
    flex: 1;
    height: 30px;
    background: linear-gradient(180deg, #32373e 0%, #1f2227 55%, #15171a 100%);
    border-top: 1.5px solid #e67e22;
    border-bottom: 2.5px solid #d97724;
    border-radius: 0 16px 16px 0;
    padding: 0 24px 0 38px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

#rules .chapter-header h1,
#rules .chapter-header .chapter-title {
    margin: 0;
    color: #ffffff;
    font-family: "Impact", "Arial Black", "Trebuchet MS", "Oswald", sans-serif;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    line-height: 1;
}

/* Subheadings */
#rules h3 {
    color: #1a1e23;
    font-size: 1.12rem;
    font-weight: 800;
    margin: 20px 0 8px 0;
    letter-spacing: 0.2px;
}

/* Orange Underlined Subheadings (Ziel des Spiels & Lebenspunkte) */
#rules h3.orange-underline {
    display: inline-block;
    border-bottom: 3.5px solid #ff7a18;
    padding-bottom: 3px;
    margin-top: 18px;
    margin-bottom: 8px;
}

/* Paragraphs */
#rules p {
    margin: 0 0 12px 0;
    color: #24272c;
    line-height: 1.6;
}

#rules strong {
    font-weight: 750;
    color: #121417;
}

/* Example Callouts */
#rules .example,
#rules p.example {
    font-style: italic;
    color: #2c3138;
    background: rgba(235, 225, 205, 0.4);
    border-left: 3.5px solid #f57c00;
    border-radius: 0 6px 6px 0;
    padding: 10px 16px;
    margin: 12px 0 16px 0;
    line-height: 1.55;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

#rules .example strong,
#rules p.example strong {
    font-style: normal;
    font-weight: 800;
    color: #1a1e23;
}

#rules .example u,
#rules p.example u {
    text-decoration: underline;
    font-weight: 700;
}

/* Lists */
#rules ul,
#rules ol {
    margin: 8px 0 16px 20px;
    padding-left: 12px;
}

#rules li {
    margin-bottom: 8px;
    line-height: 1.55;
    color: #282c32;
}

#rules li::marker {
    color: #e65100;
}

/* Definition Lists (Keywords & Attributes with In-Game Color Scheme) */
#rules dl {
    margin: 14px 0 22px 0;
}

#rules dt {
    font-size: 1.02rem;
    font-weight: 800;
    margin-top: 14px;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 6px;
}

#rules dt.frenzy {
    background: rgba(245, 158, 11, 0.15);
    border: 1.5px solid #f59e0b;
}
#rules dt.frenzy strong {
    color: #d97706;
}

#rules dt.hunter {
    background: rgba(239, 68, 68, 0.15);
    border: 1.5px solid #ef4444;
}
#rules dt.hunter strong {
    color: #dc2626;
}

#rules dt.poisonous {
    background: rgba(34, 197, 94, 0.15);
    border: 1.5px solid #22c55e;
}
#rules dt.poisonous strong {
    color: #16a34a;
}

#rules dt.sneaky {
    background: rgba(168, 85, 247, 0.15);
    border: 1.5px solid #a855f7;
}
#rules dt.sneaky strong {
    color: #9333ea;
}

#rules dt.tough {
    background: rgba(56, 189, 248, 0.15);
    border: 1.5px solid #38bdf8;
}
#rules dt.tough strong {
    color: #0284c7;
}

#rules dd {
    margin-left: 12px;
    margin-bottom: 14px;
    color: #2b2f36;
    line-height: 1.55;
}

/* Store Promo / Download Badges */
#rules .store-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
    margin-bottom: 4px;
}

#rules .store-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background-color: #1a1815;
    color: #ffffff !important;
    border: 1.5px solid #3d342a;
    border-radius: 9px;
    padding: 8px 16px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
    min-width: 155px;
    box-sizing: border-box;
}

#rules .store-button:hover {
    background-color: #27221c;
    border-color: #d97724;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(217, 119, 36, 0.3);
    color: #ffffff !important;
    text-decoration: none !important;
}

#rules .store-button svg {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

#rules .store-button .store-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.15;
}

#rules .store-button .store-sub {
    font-size: 0.65rem;
    color: #a89f91;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#rules .store-button .store-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

