@import url('https://fonts.googleapis.com/css2?family=Anton&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Courier New', Courier, monospace;
}

body {
    background: #141210;
    color: #b8a888;
    overflow: hidden;
    user-select: none;
}

#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

#topbar {
    background: #0a0806;
    border-bottom: 2px solid #3a2a18;
    padding: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    z-index: 50;
    flex-shrink: 0;
}

.title-block {
    display: flex;
    flex-direction: column;
}

.title-main {
    color: #d4a840;
    font-size: 22px;
    letter-spacing: 3px;
    font-weight: bold;
    text-transform: uppercase;
}

.title-sub {
    color: #8a7a5a;
    font-size: 15px;
    letter-spacing: 1px;
    margin-top: 4px;
    font-weight: 800;
}

.stats-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
    background: #12100e;
    padding: 5px 12px;
    border: 1px solid #2a1e10;
    border-radius: 3px;
}

.stat-l {
    color: #8a7a5a;
    font-size: 12px;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.stat-v {
    color: #d4a840;
    font-size: 20px;
    font-weight: bold;
    display: block;
}

.stat-v.red {
    color: #e65555;
}

.stat-v.green {
    color: #55cc55;
}

#main {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: row;
}

#left {
    width: 300px;
    background: #0d0b09;
    border-right: 2px solid #2a1e10;
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 15px;
    flex-shrink: 0;
    overflow-y: auto;
}

#center {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 12px;
    min-width: 0;
    background: #12100e;
}

.ptitle {
    font-size: 15px;
    letter-spacing: 2px;
    color: #9a8a6a;
    border-bottom: 1px solid #3a2e20;
    padding-bottom: 5px;
    margin-bottom: 8px;
    font-weight: bold;
    text-transform: uppercase;
}

#photo-frame {
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
    aspect-ratio: 3/4;
    background: #0a0806;
    border: 3px solid #3a2818;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

#photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 8, 6, 0.85);
    padding: 6px;
    font-size: 15px;
    color: #d4a840;
    text-align: center;
    font-weight: bold;
    letter-spacing: 1px;
}

#scanner {
    background: #050a05;
    border: 1px solid #1a3a1a;
    padding: 12px;
    box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.05);
}

.s-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.s-lbl {
    color: #4a8a4a;
    font-size: 13px;
    width: 70px;
    letter-spacing: 1px;
    font-weight: bold;
}

.s-bar {
    flex: 1;
    height: 8px;
    background: #0a1a0a;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #112211;
}

.s-fill {
    height: 100%;
    background: #3a8a3a;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.s-val {
    color: #5ccc5c;
    font-size: 15px;
    width: 60px;
    text-align: right;
    font-weight: bold;
}

.s-scanning {
    animation: pulse 0.7s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

#intercom {
    background: #0a0a1a;
    border: 1px solid #1a1a3a;
    padding: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #8a8aaa;
    border-left: 4px solid #4a4a9a;
    margin-top: auto;
}

.ic-tag {
    color: #6a6aaa;
    font-size: 12px;
    font-weight: bold;
    display: block;
    margin-bottom: 4px;
}

.ic-msg {
    color: #bbbbdd;
}

#event-flash {
    min-height: 40px;
    padding: 10px 15px;
    font-size: 15px;
    letter-spacing: 1px;
    border-left: 4px solid transparent;
    transition: all 0.3s;
    font-weight: bold;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    background: #1a1612;
}

#event-flash.info {
    background: #1a2a3a;
    border-color: #3a8ada;
    color: #8abada;
}

#event-flash.bribe-flash {
    background: #2a1a05;
    border-color: #c8a040;
    color: #f0d060;
    animation: bribeFlash 1s ease-in-out 3;
}

@keyframes bribeFlash {

    0%,
    100% {
        background: #2a1a05
    }

    50% {
        background: #3a2a08
    }
}

/* BRIBE NOTE */
.bribe-doc {
    width: 250px !important;
}

.bribe-doc:hover::after {
    display: none !important;
    content: none !important;
}


.bribe-note-inner {
    background: linear-gradient(135deg, #fef9e0 0%, #fdf0c0 60%, #fce8a8 100%);
    border: 1px solid #c8a870;
    padding: 16px 18px 14px;
    font-family: 'Caveat', 'Georgia', cursive;
    color: #2a1a08;
    position: relative;
    box-shadow: 2px 3px 10px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(200, 150, 60, 0.08);
    border-radius: 2px;
}

.bribe-note-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, #c0902060, #a07010a0, #c0902060);
}

.bribe-note-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 22px, rgba(180, 140, 80, 0.12) 22px, rgba(180, 140, 80, 0.12) 23px);
    pointer-events: none;
}

.bribe-body-text {
    font-size: 18px;
    line-height: 1.5;
    color: #3a2010;
    margin-bottom: 12px;
    font-family: "Indie Flower", cursive;
    font-weight: bold;
    font-style: normal;
}

.bribe-offer-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(50, 120, 50, 0.12);
    border: 1px solid rgba(50, 120, 50, 0.3);
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 8px;
}

.bribe-coin-icon {
    font-size: 26px;
}

.bribe-pts-label {
    font-size: 26px;
    font-weight: 700;
    color: #2a6a2a;
}

.bribe-btns {
    display: flex;
    gap: 8px;
}

.bribe-accept {
    flex: 1;
    background: #113a11;
    border: 2px solid #2a8a2a;
    color: #6dff6d;
    padding: 9px 6px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 13px;
    letter-spacing: 1px;
    transition: 0.2s;
    border-radius: 3px;
}

.bribe-accept:hover {
    background: #1a5a1a;
}

.bribe-accept:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.bribe-reject {
    flex: 1;
    background: #3a1111;
    border: 2px solid #8a2a2a;
    color: #ff6d6d;
    padding: 9px 6px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 13px;
    letter-spacing: 1px;
    transition: 0.2s;
    border-radius: 3px;
}

.bribe-reject:hover {
    background: #5a1a1a;
}

.bribe-reject:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* BRIBE SCANDAL BANNER */
.scandal-banner {
    margin-top: 15px;
    padding: 12px 15px;
    border: 2px solid #e65555;
    background: linear-gradient(135deg, #2a0808, #1a0505);
    color: #ff8888;
    border-radius: 4px;
}

.scandal-banner b {
    color: #ff4444;
}


#doc-area {
    flex: 1;
    position: relative;
    background: #2b2e2b;
    background-image: linear-gradient(rgba(0, 0, 0, 0.1) 2px, transparent 2px), linear-gradient(90deg, rgba(0, 0, 0, 0.1) 2px, transparent 2px);
    background-size: 40px 40px;
    border: 4px solid #1a1c1a;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.9);
    border-radius: 6px;
    overflow: hidden;
}

.doc-wrap {
    position: absolute;
    touch-action: none;
    cursor: grab;
    perspective: 1000px;
    filter: drop-shadow(4px 4px 6px rgba(0, 0, 0, 0.5));
}

.doc-wrap:active {
    cursor: grabbing;
}

.paper-sheet {
    background: #e8e0cc;
    border: 1px solid #b8a888;
    padding: 15px;
    color: #2a2218;
    border-radius: 2px;
    box-shadow: inset 0 0 20px rgba(150, 120, 80, 0.1);
    font-family: 'Georgia', serif;
}

.paper-sheet h3 {
    font-family: 'Courier New', monospace;
    text-align: center;
    border-bottom: 2px solid #5a4a3a;
    padding-bottom: 5px;
    margin-bottom: 10px;
    font-size: 16px;
    letter-spacing: 1px;
    color: #1a1208;
}

.rule-doc {
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 15px;
}

.rule-doc ul {
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.rule-doc li {
    margin-bottom: 8px;
}

.rule-doc li b {
    color: #5a1a1a;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.region-doc {
    width: 340px;
}

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

.region-item {
    background: #f4ecdc;
    border: 1px solid #d0c8b0;
    padding: 8px;
    text-align: center;
    border-radius: 4px;
}

.region-item .r-name {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 5px;
    font-family: 'Courier New', monospace;
}

.region-item .r-code {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.doc-wrap.passport {
    width: 360px;
    height: 300px;
}

.doc-wrap.permit {
    width: 320px;
    height: 180px;
}

.flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
    border-radius: 4px;
}

.doc-wrap.flippable.flipped .flipper {
    transform: rotateY(180deg);
}

.front,
.back {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 4px;
    overflow: hidden;
}

.front {
    background: #f2ead8;
    border: 1px solid #8a7a5a;
    padding: 12px;
    display: flex;
    flex-direction: column;
    transform: rotateY(0deg);
}

.back {
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 26px;
}

/* --- PASAPORTE (Reverso) --- */
.passport-back {
    background-color: #1a1e29;
    background-image:
        radial-gradient(circle at center, transparent 0%, #080a0f 120%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.015) 0px, rgba(255, 255, 255, 0.015) 2px, transparent 2px, transparent 4px);
    border: 2px solid #0f1218;
    color: #d4af37;
    font-family: 'Times New Roman', serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
}

.passport-back .emblem {
    font-size: 3.5rem;
    margin-bottom: 15px;
    color: #d4af37;
    opacity: 0.8;
}

.passport-back .title {
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 3px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(212, 175, 55, 0.4);
    padding-bottom: 8px;
    margin-bottom: 8px;
    width: 80%;
}

.passport-back .subtitle {
    font-size: 0.65rem;
    letter-spacing: 1px;
    opacity: 0.6;
    text-transform: uppercase;
}

/* --- PERMISO DE ACCESO (Reverso) --- */
.permit-back {
    background-color: #2a2a2a;
    background-image:
        repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1) 1px, transparent 1px, transparent 8px),
        linear-gradient(to bottom, #2a2a2a, #1a1a1a);
    border: 2px solid #111;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #a08030;
    font-family: 'Courier New', Courier, monospace;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.permit-back .watermark-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    font-size: 5rem;
    color: rgba(0, 0, 0, 0.15);
    z-index: 0;
    pointer-events: none;
}

.permit-back .legal-text {
    font-size: 0.45rem;
    text-align: justify;
    line-height: 1.4;
    color: #666;
    z-index: 1;
}

.permit-back .barcode-container {
    z-index: 1;
    border-top: 1px dashed #444;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.permit-back .css-barcode {
    width: 90%;
    height: 25px;
    background: repeating-linear-gradient(to right,
            #a08030 0, #a08030 2px, transparent 2px, transparent 4px,
            #a08030 4px, #a08030 5px, transparent 5px, transparent 7px,
            #a08030 7px, #a08030 10px, transparent 10px, transparent 11px);
    opacity: 0.6;
    margin-bottom: 5px;
}

.permit-back .permit-code {
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 4px;
}

.doc-hdr {
    padding: 6px 10px;
    margin: -12px -12px 12px;
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #fff;
    text-align: center;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.doc-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex: 1;
}

.doc-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.doc-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 5px;
    width: 100%;
    border-bottom: 1px dotted #c0b8a0;
    padding-bottom: 2px;
}

.doc-lbl {
    color: #6a5a40;
    font-size: 12px;
    white-space: nowrap;
    font-weight: bold;
}

.doc-val {
    color: #1a0e00;
    font-size: 14px;
    font-weight: bold;
    text-align: right;
    text-transform: uppercase;
}

.doc-photo {
    width: 80px;
    height: 105px;
    background: #ccc;
    border: 2px solid #8a7a5a;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.doc-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(0.3) contrast(1.1) grayscale(0.2);
    pointer-events: none;
}

.mrz {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #1a1000;
    background: #dfd5ba;
    padding: 8px;
    margin-top: auto;
    letter-spacing: 1.5px;
    line-height: 1.4;
    border: 1px solid #b0a890;
    word-break: break-all;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05);
}

.doc-seal {
    position: absolute;
    bottom: 55px;
    right: 15px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    opacity: 0.7;
    transform: rotate(-15deg);
    pointer-events: none;
}

.doc-seal.preview {
    position: relative;
    bottom: auto;
    right: auto;
    width: 40px;
    height: 40px;
    font-size: 12px;
    border-width: 2px;
    margin: 0 auto;
    transform: none;
    opacity: 1;
}

#verdict-row {
    display: flex;
    gap: 15px;
    flex-shrink: 0;
}

.btn-ap,
.btn-rj {
    flex: 1;
    padding: 18px;
    font-family: inherit;
    font-size: 18px;
    letter-spacing: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    text-align: center;
    border-radius: 4px;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.5);
}

.btn-ap {
    background: #113a11;
    border: 2px solid #2a8a2a;
    color: #6dff6d;
}

.btn-ap:hover:not(:disabled) {
    background: #1a5a1a;
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

.btn-ap:active:not(:disabled) {
    transform: translateY(4px);
    box-shadow: none;
}

.btn-rj {
    background: #3a1111;
    border: 2px solid #8a2a2a;
    color: #ff6d6d;
}

.btn-rj:hover:not(:disabled) {
    background: #5a1a1a;
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

.btn-rj:active:not(:disabled) {
    transform: translateY(4px);
    box-shadow: none;
}

.btn-ap:disabled,
.btn-rj:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
    transform: translateY(4px);
    box-shadow: none;
}

.overlay-wrap {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background 0.1s;
}

.overlay-wrap.show {
    display: flex;
}

.overlay-wrap.peek {
    background: rgba(0, 0, 0, 0) !important;
}

.overlay-wrap.peek .overlay-box {
    opacity: 0 !important;
}

.overlay-box {
    background: #110f0d;
    border: 2px solid #5a4828;
    padding: 30px;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
    transition: opacity 0.2s;
    max-height: 90vh;
    overflow-y: auto;
}

.rb-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
    letter-spacing: 2px;
    text-align: center;
}

.rb-title.ok {
    color: #55cc55;
}

.rb-title.bad {
    color: #e65555;
}

.rb-violations {
    margin: 15px 0;
    font-size: 16px;
    line-height: 1.8;
    color: #a89878;
    background: #181512;
    padding: 15px;
    border: 1px solid #3a2e20;
}

.rb-violations .viol {
    color: #e66666;
    font-weight: bold;
}

.rb-violations .viol::before {
    content: "► ";
    color: #e64040;
}

.rb-violations .fine {
    color: #5bcc5b;
    text-align: center;
    font-style: italic;
}

.rb-score {
    font-size: 16px;
    color: #c8b080;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #3a2e1a;
    text-align: center;
    font-weight: bold;
}

.btn-action {
    background: #1a140a;
    border: 2px solid #5a4828;
    color: #d4a840;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 16px;
    letter-spacing: 2px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    transition: all 0.2s;
    text-transform: uppercase;
    margin-top: 10px;
}

.btn-action:hover:not(:disabled) {
    background: #2a2010;
    border-color: #7a6030;
    color: #ffe080;
}

.btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#hint-bar {
    background: #0a0806;
    border-top: 1px solid #2a1e10;
    padding: 8px 20px;
    font-size: 14px;
    color: #6a5a40;
    letter-spacing: 2px;
    text-align: center;
    z-index: 50;
    flex-shrink: 0;
}

.deny-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    background: #181512;
    padding: 12px 15px;
    border: 1px solid #3a2e20;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.deny-option:hover {
    background: #221c16;
    border-color: #5a4828;
}

.deny-option:has(input[type="radio"]:checked) {
    background: #1f180d;
    border-color: #d4a840;
    box-shadow: inset 0 0 8px rgba(212, 168, 64, 0.1);
}

.deny-option input[type="radio"] {
    accent-color: #d4a840;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.deny-option span {
    color: #c8b080;
    font-size: 16px;
    font-weight: bold;
    transition: color 0.2s;
}

.deny-option:has(input[type="radio"]:checked) span {
    color: #d4a840;
}

/* Estilos Tienda/Inventario */
.shop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 15px 0;
}

.shop-item {
    background: #1a1612;
    border: 2px solid #3a2e20;
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
    border-radius: 4px;
}

.shop-item.unlocked {
    border-color: #d4a840;
    color: #d4a840;
    background: #1a1a0f;
}

.shop-icon {
    font-size: 36px;
    margin-bottom: 10px;
    color: inherit;
}

.btn-buy {
    background: #113a11;
    border: 1px solid #2a8a2a;
    color: #6dff6d;
    padding: 8px 10px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
}

.btn-buy:disabled {
    background: #222;
    border-color: #444;
    color: #666;
    cursor: not-allowed;
}

.btn-buy:hover:not(:disabled) {
    background: #1a5a1a;
}

.btn-random {
    background: #3a1a6a;
    border: 2px solid #6a3aaa;
    color: #d4a8ff;
    padding: 12px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    margin-bottom: 10px;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: 0.2s;
}

.btn-random:hover:not(:disabled) {
    background: #5a2a9a;
    border-color: #8a5aca;
}

.btn-random:disabled {
    background: #1a1a2a;
    border-color: #3a3a4a;
    color: #5a5a6a;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .shop-grid {
        grid-template-columns: 1fr;
    }
}

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

::-webkit-scrollbar-track {
    background: #12100e;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #5a4828;
}

/* FIX RESPONSIVE FLIPPER */
.flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.flipper .front,
.flipper .back {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.flipper .back {
    transform: rotateY(180deg);
}

.flippable.flipped .flipper {
    transform: rotateY(180deg);
}

/* ESTILOS DEL CAJÓN */
#drawer-panel {
    position: fixed;
    bottom: -110px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 800px;
    height: 110px;
    background: #3e2723;
    border: 4px solid #5d4037;
    border-bottom: none;
    border-radius: 15px 15px 0 0;
    display: flex;
    align-items: center;
    padding: 10px;
    gap: 15px;
    z-index: 9999999;
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
}

#drawer-panel.open {
    bottom: 0;
}

.drawer-tab {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #3e2723;
    color: #d7ccc8;
    font-size: 16px;
    padding: 5px 30px;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    font-weight: bold;
    font-family: Arial, sans-serif;
    border: 4px solid #5d4037;
    border-bottom: none;
    width: 250px;
    text-align: center;
    opacity: 0.1;
    transition: opacity 0.3s;
}

.drawer-tab:hover,
#drawer-panel.open .drawer-tab {
    opacity: 1;
}

.drawer-slot {
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed #8d6e63;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 5px;
    overflow: hidden;
    transition: background 0.2s, border-color 0.2s;
}

.drawer-slot:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #d7ccc8;
}

.drawer-slot .doc-wrap {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    margin: 0 !important;
    transform: translate(-50%, -50%) scale(0.2) !important;
    pointer-events: none !important;
    z-index: 1 !important;
    transition: none !important;
}

/* ESTILOS DEL LOADER Y SELLOS */
#global-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 15, 0.9);
    z-index: 99999999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'Anton', Impact, sans-serif;
    text-transform: uppercase;
    backdrop-filter: blur(5px);
}

.loader-spinner {
    border: 8px solid rgba(255, 255, 255, 0.1);
    border-top: 8px solid #5bcc5b;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    animation: spin 1s linear infinite;
}

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

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

.global-stamp-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    font-size: clamp(60px, 10vw, 150px);
    font-family: 'Anton', Impact, sans-serif;
    padding: 0.2em 0.5em;
    letter-spacing: 5px;
    text-transform: uppercase;
    border: 0.1em solid;
    border-radius: 15px;
    font-weight: 900;
    z-index: 999999999999999;
    backdrop-filter: blur(2px);
    pointer-events: none;
    filter: contrast(130%) saturate(120%);
    opacity: 0;
    transform: translate(-50%, -50%) scale(3) rotate(-8deg);
}

.global-stamp-aprobado {
    color: #1f7a3f;
    border-color: #1f7a3f;
    box-shadow: 0 0 0 8px rgba(31, 122, 63, 0.2), inset 0 0 20px rgba(31, 122, 63, 0.5);
}

.global-stamp-rechazado {
    color: #a12b2b;
    border-color: #a12b2b;
    box-shadow: 0 0 0 8px rgba(161, 43, 43, 0.2), inset 0 0 20px rgba(161, 43, 43, 0.5);
}

.global-stamp-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.06) 3px, transparent 3px, transparent 8px);
    mix-blend-mode: multiply;
    pointer-events: none;
}

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

    60% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.9) rotate(-8deg);
    }

    80% {
        transform: translate(-50%, -50%) scale(1.05) rotate(-8deg);
    }

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

@keyframes globalStampFadeOut {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(-8deg);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.2) rotate(-8deg);
    }
}

.global-stamp-show {
    animation: globalStampImpact 0.4s ease-out forwards;
}

.global-stamp-hide {
    animation: globalStampFadeOut 0.4s ease-out forwards;
}