/**
 * Void Ground - Unit Book (Codex Automata) Stylesheet
 * Left Page: Interactive 3D Unit Viewer (Rotatable Three.js Model)
 * Right Page: Technical Combat Dossier, Stats & Tactical Lore
 */

.unit-book-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #100804 url('assets/wood-table.jpg') center center / cover no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
    padding: 12px 64px;
    box-sizing: border-box;
    perspective: 2000px;
    opacity: 1;
    transition: opacity 0.28s ease;
}

.unit-book-modal-overlay.is-entering {
    opacity: 0;
}

.unit-book-modal-overlay.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Open Two-Page Leather-Bound Parchment Folio */
.unit-book-spread {
    position: relative;
    width: 1292px;
    max-width: 100%;
    height: 910px;
    max-height: 97vh;
    background: transparent;
    border: none;
    border-radius: 14px;
    overflow: visible;
    display: flex;
    padding: 18px;
    box-sizing: border-box;
    font-family: 'Cinzel', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
    color: #2b1d0c;
    transform-style: preserve-3d;
    transition: transform 0.74s cubic-bezier(0.22, 0.86, 0.34, 1);
}

/* Split Leather Backboards (Left half hidden when book is closed) */
.unit-book-backboard {
    position: absolute;
    top: 0;
    height: 100%;
    width: calc(50% + 1px);
    background: #1c1109 url('assets/leather-cover.jpg') repeat;
    background-size: 500px auto;
    border: 3px solid #5a3818;
    box-sizing: border-box;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.92),
        0 8px 24px rgba(0, 0, 0, 0.72),
        inset 0 0 35px rgba(0, 0, 0, 0.85);
    pointer-events: none;
    z-index: 2;
}

.unit-book-backboard-left {
    left: 0;
    border-right: 1px solid #3d2410;
    border-radius: 14px 3px 3px 14px;
    transition: opacity 0.16s ease 0.34s;
}

.unit-book-backboard-right {
    right: 0;
    border-left: 1px solid #3d2410;
    border-radius: 3px 14px 14px 3px;
}

/* =========================================================================
   CINEMATIC CODEX OPENING: CLOSED LEATHER COVER -> HINGE SWING OPEN
   ========================================================================= */
/* Override box-shadow pada .unit-book-spread dari style.css agar tidak ada frame bayangan hantu di kiri saat tertutup/membuka */
.unit-book-spread,
.unit-book-spread.is-codex-closed,
.unit-book-spread.is-codex-opening,
.unit-book-spread.is-codex-open {
    box-shadow: none !important;
}

.unit-book-spread.is-codex-closed {
    transform: translateX(-25%) scale(0.86);
}

.unit-book-spread.is-codex-opening {
    transform: translateX(0) scale(1);
}

/* Saat tertutup: HANYA sampul kanan yang terlihat di tengah meja (kiri tersembunyi bersih) */
.unit-book-spread.is-codex-closed .unit-book-backboard-left,
.unit-book-spread.is-codex-closed .unit-book-page-left,
.unit-book-spread.is-codex-closed .unit-book-page-right,
.unit-book-spread.is-codex-closed .unit-book-ribbon,
.unit-book-spread.is-codex-closed .forge-edge-tab {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.unit-book-spread.is-codex-opening .unit-book-backboard-left {
    opacity: 1;
    visibility: visible;
}
.unit-book-spread.is-codex-opening .unit-book-page-left {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.16s ease 0.36s;
}
.unit-book-spread.is-codex-opening .unit-book-page-right {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.16s ease 0.08s;
}
.unit-book-spread.is-codex-opening .unit-book-ribbon,
.unit-book-spread.is-codex-opening .forge-edge-tab {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.unit-book-spread.is-codex-open .unit-book-backboard-left,
.unit-book-spread.is-codex-open .unit-book-page-left,
.unit-book-spread.is-codex-open .unit-book-page-right,
.unit-book-spread.is-codex-open .unit-book-ribbon,
.unit-book-spread.is-codex-open .forge-edge-tab {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease;
}

/* Sampul Depan Kulit Tertutup (Hinged pada Tulang Punggung Tengah 50%) */
/* PENTING: Jangan animasikan opacity pada .unit-book-front-cover agar transform-style: preserve-3d tidak ter-flatten Chromium */
.unit-book-front-cover {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    transform-origin: left center;
    transform-style: preserve-3d;
    transform: translateZ(8px) rotateY(0deg);
    z-index: 45;
    pointer-events: none;
    transition: transform 0.72s cubic-bezier(0.24, 0.88, 0.34, 1);
}

.unit-book-spread.is-codex-opening .unit-book-front-cover {
    transform: translateZ(8px) rotateY(-179deg);
}

.unit-book-spread.is-codex-open .unit-book-front-cover {
    display: none !important;
    visibility: hidden !important;
}

.unit-book-cover-face {
    position: absolute;
    inset: 0;
    border-radius: 6px 12px 12px 6px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    box-sizing: border-box;
    overflow: hidden;
}

.unit-book-cover-front *,
.unit-book-cover-back * {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.unit-book-cover-front {
    transform: rotateY(0deg) translateZ(1px);
    background:
        linear-gradient(90deg, rgba(10, 5, 2, 0.85) 0%, rgba(28, 17, 9, 0.35) 8%, rgba(28, 17, 9, 0.15) 94%, rgba(12, 6, 2, 0.7) 100%),
        #22140a url('assets/leather-cover.jpg') center center / cover no-repeat;
    background-size: 100% 100%, cover;
    border: 3px solid #6b441e;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.85),
        inset 0 0 28px rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 28px;
}

.unit-book-cover-inner-frame {
    width: 100%;
    height: 100%;
    border: 2px solid rgba(212, 175, 55, 0.65);
    box-shadow: inset 0 0 0 1px rgba(166, 124, 56, 0.35);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    position: relative;
    background: radial-gradient(circle at 50% 45%, rgba(166, 124, 56, 0.12) 0%, transparent 70%);
}

.unit-book-cover-emblem {
    width: 112px;
    height: 112px;
    color: #d4af37;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
}

.unit-book-cover-title {
    font-family: 'Cinzel', 'Palatino Linotype', Georgia, serif;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 3.5px;
    color: #e6c675;
    text-align: center;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
    text-transform: uppercase;
}

.unit-book-cover-sub {
    font-family: 'Cinzel', 'Palatino Linotype', Georgia, serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2.6px;
    color: #b89452;
    text-transform: uppercase;
    border-top: 1px solid rgba(212, 175, 55, 0.45);
    padding-top: 10px;
}

/* Brass Latch Clasp on Right Edge of Closed Book */
.unit-book-cover-clasp {
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 68px;
    background: linear-gradient(180deg, #b88c38 0%, #f3d778 48%, #8f6822 100%);
    border: 2px solid #4a3110;
    border-radius: 4px 8px 8px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.unit-book-spread.is-clasp-open .unit-book-cover-clasp {
    transform: translateY(-50%) translateX(10px) scaleX(0.6);
    opacity: 0;
}

/* Sisi Dalam Sampul Depan saat Berbalik */
.unit-book-cover-back {
    transform: rotateY(180deg) translateZ(1px);
    border-radius: 12px 6px 6px 12px;
    background:
        radial-gradient(circle at 50% 50%, rgba(110, 70, 25, 0.12) 0%, rgba(45, 25, 8, 0.35) 100%),
        #ebdcb9 url('assets/deckle-paper.jpg') repeat;
    background-size: auto, cover;
    border: 8px solid #2b180b;
    box-shadow: inset -14px 0 28px rgba(28, 16, 6, 0.5);
}

/* Viewport Sketch-to-3D Paper Margin Overlay & Scan Glint Sweep */
.unit-3d-pencil-margins {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.85s ease;
}

.unit-3d-viewport-box.is-sketch-active:not(.is-sketch-morphing) .unit-3d-pencil-margins {
    opacity: 0.92;
}

.unit-3d-scan-sweep {
    position: absolute;
    left: 0;
    right: 0;
    top: -12%;
    height: 14%;
    pointer-events: none;
    z-index: 6;
    opacity: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(120, 72, 22, 0.08) 30%,
        rgba(245, 196, 86, 0.42) 52%,
        rgba(120, 72, 22, 0.08) 75%,
        transparent 100%
    );
}

.unit-3d-viewport-box.is-sketch-morphing .unit-3d-scan-sweep {
    animation: unitSketchSweep 0.85s ease-out forwards;
}

@keyframes unitSketchSweep {
    0% { top: -14%; opacity: 0; }
    18% { opacity: 0.95; }
    85% { opacity: 0.75; }
    100% { top: 102%; opacity: 0; }
}

/* Archival Bookmark Ribbon */
.unit-book-ribbon {
    position: absolute;
    top: -10px;
    left: 48px;
    width: 24px;
    height: 52px;
    background: #731e1e;
    border: 1px solid #4a1212;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
    z-index: 30;
}
.unit-book-ribbon::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 10px solid #1c1109;
}

/* Two-Page Spread Container */
.unit-book-pages-container {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 16px;
    position: relative;
    z-index: 10;
}

/* Single Parchment Page */
.unit-book-page {
    flex: 1;
    height: 100%;
    background: #f4e8cc url('assets/deckle-paper.jpg') repeat;
    background-size: cover;
    border: 1px solid #7c5828;
    border-radius: 8px;
    box-shadow: 
        inset 0 0 30px rgba(110, 70, 25, 0.35),
        inset 2px 0 8px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    padding: 18px 24px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

/* Spine Crease Shadows */
.unit-book-page-left {
    box-shadow: 
        inset 0 0 30px rgba(110, 70, 25, 0.35),
        inset -10px 0 20px rgba(40, 20, 5, 0.45);
}
.unit-book-page-right {
    box-shadow: 
        inset 0 0 30px rgba(110, 70, 25, 0.35),
        inset 10px 0 20px rgba(40, 20, 5, 0.45);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    padding: 22px 28px 20px 28px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

/* Brass Corner Accents */
.unit-corner {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 2.5px solid #a67c38;
    pointer-events: none;
    z-index: 5;
}
.unit-corner.tl { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.unit-corner.tr { top: 8px; right: 8px; border-left: none; border-bottom: none; }
.unit-corner.bl { bottom: 8px; left: 8px; border-right: none; border-top: none; }
.unit-corner.br { bottom: 8px; right: 8px; border-left: none; border-top: none; }

/* Header Elements */
.unit-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #8c6834;
    padding-bottom: 9px;
    margin-bottom: 12px;
    flex-shrink: 0;
    min-height: 64px;
    box-sizing: border-box;
}

.unit-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.unit-header-icon {
    width: 25px;
    height: 25px;
    color: #633e14;
    flex-shrink: 0;
}

.unit-header-title h3 {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 23px;
    font-weight: 900;
    letter-spacing: 0.6px;
    color: #3b220b;
    text-transform: uppercase;
}

.unit-page-subtitle {
    display: none !important;
}

/* Close Wax Seal Button (Enlarged 2x to 64px) */
.unit-book-close-btn {
    background: #631914;
    border: 2.5px solid #d4af37;
    color: #fce7b2;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s ease, background 0.2s ease;
    line-height: 1;
}

.unit-book-close-btn:hover {
    background: #8b231c;
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(180, 40, 30, 0.6);
}

/* =========================================================================
   HALAMAN KIRI: 3D INTERACTIVE UNIT VIEWER
   ========================================================================= */
.unit-3d-stage-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 8px;
}

/* Unit Selector Toolbar di Halaman Kiri (Simetris 2-Baris +30% Scaling) */
.unit-selector-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    background: #e8d7b8;
    border: 1.5px solid #a88555;
    border-radius: 6px;
    padding: 10px 14px;
    flex-shrink: 0;
    gap: 10px 12px;
    min-height: 46px;
    box-sizing: border-box;
}

.unit-selector-title-group {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
}

.unit-selector-dropdown {
    background: #fbf1dc;
    border: 1.5px solid #9c7a48;
    border-radius: 5px;
    color: #42260c;
    font-family: 'Cinzel', 'Palatino Linotype', Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    padding: 0 12px;
    height: 39px;
    line-height: 37px;
    cursor: pointer;
    outline: none;
    width: 100%;
    max-width: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unit-tier-filter-pills {
    order: 3;
    flex: 0 0 100%;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding-top: 8px;
    border-top: 1px dashed rgba(168, 133, 85, 0.40);
}

.unit-tier-pill {
    background: #f5e8cf;
    border: 1px solid #b59261;
    color: #634321;
    font-size: 17px;
    font-weight: 700;
    border-radius: 5px;
    padding: 0 13px;
    min-width: 40px;
    height: 39px;
    line-height: 37px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.unit-tier-pill:hover {
    background: #e6d3af;
    color: #3b2207;
}

.unit-tier-pill.active {
    background: #5a3814;
    color: #fbf1dc;
    border-color: #3b2207;
    font-weight: 800;
}

.unit-tier-pill.pill-tier-m.active {
    background: #78350f;
    color: #fef3c7;
    border-color: #d97706;
    box-shadow: 0 0 8px rgba(217, 119, 6, 0.55);
}

.unit-tier-pill.pill-tier-x.active {
    background: #4c1d95;
    color: #fef08a;
    border-color: #a855f7;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.55);
}

.unit-tier-pill.pill-tier-s.active {
    background: #7f1d1d;
    color: #fef08a;
    border-color: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.45);
}

.unit-tier-pill.pill-tier-o.active {
    background: #44403c;
    color: #f5f5f4;
    border-color: #78716c;
    box-shadow: 0 0 6px rgba(120, 113, 108, 0.55);
}

.unit-selector-code {
    font-size: 14px;
    font-weight: 800;
    color: #42260c;
    letter-spacing: 1px;
}

.unit-selector-name {
    font-size: 12px;
    color: #634321;
    font-weight: 600;
}

.unit-nav-btn-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
    flex-shrink: 0;
}

.unit-nav-arrow-btn {
    background: #fbf1dc;
    border: 1px solid #9c7a48;
    color: #4d2f0f;
    border-radius: 5px;
    width: 39px;
    height: 39px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease;
    box-sizing: border-box;
    padding: 0;
}

.unit-nav-arrow-btn:hover:not(:disabled) {
    background: #4a2d12;
    color: #fce7b2;
    border-color: #2b1708;
}

.unit-nav-arrow-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.unit-sel-index-indicator {
    font-size: 18px;
    font-weight: 700;
    color: #573a19;
    white-space: nowrap;
    height: 39px;
    line-height: 37px;
    padding: 0 14px;
    background: rgba(168, 133, 85, 0.18);
    border-radius: 5px;
    border: 1px solid rgba(168, 133, 85, 0.38);
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    box-sizing: border-box;
    height: 30px;
    box-sizing: border-box;
}

/* Three.js 3D Viewport Box */
.unit-3d-viewport-box {
    position: relative;
    width: 100%;
    flex: 1;
    background: radial-gradient(circle at 50% 45%, #fbf0c9 0%, #f3df9e 68%, #e4c87b 100%);
    border: 2px solid #73542c;
    border-radius: 6px;
    box-shadow: 
        inset 0 0 28px rgba(120, 82, 34, 0.30),
        0 4px 12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
}

.unit-3d-viewport-box:active {
    cursor: grabbing;
}

.unit-3d-canvas-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    touch-action: none !important;
}

.unit-3d-canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    touch-action: none !important;
}

/* Da Vinci Drafting Grid Overlay */
.unit-3d-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(138, 102, 54, 0.24) 1px, transparent 1px),
        linear-gradient(90deg, rgba(138, 102, 54, 0.24) 1px, transparent 1px);
    background-size: 22px 22px;
}

/* 3D Viewport HUD Stamp & Telemetry (+40% Scaling) */
.unit-3d-hud-tag {
    display: none !important;
}

/* Viewport Controls Bar di Bawah Canvas - Posisi Tengah (Centered) */
.unit-3d-toolbar {
    position: absolute;
    bottom: 14px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

/* 1. Hilangkan Petunjuk Drag Kursor */
.unit-3d-hint-text {
    display: none !important;
}

/* 3. Button Group 3D Controls (+40% Scaling & Centered) */
.unit-3d-btn-group {
    display: flex;
    gap: 8px;
    pointer-events: all;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.unit-3d-tool-btn {
    background: rgba(28, 20, 12, 0.88);
    border: 1.5px solid #8c6734;
    color: #f7eed8;
    border-radius: 6px;
    padding: 7px 15px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 800;
    letter-spacing: 0.6px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
    transition: all 0.15s ease;
}

.unit-3d-tool-btn:hover {
    background: #4a2d12;
    border-color: #d4af37;
    color: #ffd875;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.65);
}

.unit-3d-tool-btn.active {
    background: #731e1e;
    border-color: #ef4444;
    color: #fff;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.45);
}

.unit-3d-tool-btn.active.gizmo-active {
    background: #0f3d56;
    border-color: #38bdf8;
    color: #e0f2fe;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.55);
}

/* =========================================================================
   HALAMAN KANAN: STATUS TEMPUR, TIER BADGE & CATATAN TAKTIS
   ========================================================================= */
/* =========================================================================
   HALAMAN KANAN: STATUS TEMPUR, TIER BADGE & CATATAN TAKTIS
   ========================================================================= */
.unit-dossier-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 2px 4px 6px 4px;
    min-height: 0;
    scrollbar-gutter: stable;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.unit-dossier-wrap::-webkit-scrollbar {
    width: 6px;
}
.unit-dossier-wrap::-webkit-scrollbar-thumb {
    background: #b59261;
    border-radius: 3px;
}

.unit-dossier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1.5px dashed #b89766;
    padding-bottom: 12px;
    width: 100%;
    box-sizing: border-box;
}

.unit-dossier-name-group h2 {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 33px;
    font-weight: 900;
    letter-spacing: 0.8px;
    color: #2b1605;
}

.unit-dossier-role {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16.5px;
    font-weight: 600;
    color: #5c3b17;
    font-style: normal;
    margin-top: 5px;
    line-height: 1.45;
    letter-spacing: 0.2px;
}

/* Tier Specific Badges (Hidden per User Design) */
.tier-badge {
    display: none !important;
}
.tier-badge-c {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #64748b;
}
.tier-badge-b {
    background: #fef3c7;
    color: #92400e;
    border-color: #d97706;
}
.tier-badge-a {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #0284c7;
}
.tier-badge-s {
    background: #fef08a;
    color: #854d0e;
    border-color: #ca8a04;
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.45);
}
.tier-badge-x {
    background: #4c1d95;
    color: #fef08a;
    border-color: #a855f7;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.45);
}
.tier-badge-m {
    background: #78350f;
    color: #fef3c7;
    border-color: #d97706;
    box-shadow: 0 0 8px rgba(217, 119, 6, 0.45);
}
.tier-badge-o {
    background: #44403c;
    color: #f5f5f4;
    border-color: #78716c;
    box-shadow: 0 0 8px rgba(120, 113, 108, 0.45);
}

/* Combat Stats Meters - Simetris Grid 2-Kolom Seimbang */
.unit-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
    width: 100%;
    box-sizing: border-box;
}

.unit-stat-meter-box {
    background: rgba(234, 222, 202, 0.85);
    border: 1.5px solid #b89b6c;
    border-radius: 6px;
    padding: 10px 14px;
    box-sizing: border-box;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.unit-stat-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: #3b220b;
    margin-bottom: 7px;
    letter-spacing: 0.4px;
}

.unit-stat-val {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 900;
    font-size: 17.5px;
    color: #6e2010;
    letter-spacing: 0.4px;
}

.unit-meter-track {
    width: 100%;
    height: 11px;
    background: #d4bf9c;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid #ab926e;
    box-sizing: border-box;
}

.unit-meter-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.35s ease;
}

.fill-hp { background: linear-gradient(90deg, #991b1b, #ef4444); }
.fill-atk { background: linear-gradient(90deg, #b45309, #f59e0b); }
.fill-def { background: linear-gradient(90deg, #1e3a8a, #3b82f6); }
.fill-spd { background: linear-gradient(90deg, #065f46, #10b981); }

/* Technical Details & Lore - Tulisan Murni Tanpa Frame Kotak (+25% Font Scaling) */
.unit-details-section {
    border-top: 1.5px solid #ab8a5b;
    padding-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.unit-detail-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}

.unit-detail-label {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 900;
    color: #361e08;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.unit-detail-label::before {
    content: '◆';
    font-size: 13px;
    color: #9c6c2e;
}

.unit-detail-text {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 2px 0 4px 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 20px;
    font-weight: 500;
    color: #1c0e02;
    line-height: 1.62;
    text-align: left;
    box-shadow: none;
    width: 100%;
}

.unit-detail-text strong {
    font-weight: 800;
    font-size: 21px;
    color: #0a0401;
}

.unit-weapon-name {
    font-weight: 500;
    font-size: 18px;
    color: #2b1708;
}
