/* ==========================================
   FENCE TRADING SYSTEM STYLES
   FBI Document Aesthetic - Light Paper Style
   ========================================== */

/* Main Container */
.fence-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(58, 50, 56, 0.9);
    backdrop-filter: blur(5px);
    z-index: 25000;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Special Elite', 'Courier New', monospace;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Document Wrapper - Light Paper */
.fence-document {
    background: #f4e4c4;
    border: 2px solid #8E7F7F;
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.1),
        0 4px 30px rgba(0,0,0,0.5),
        inset 0 0 80px rgba(139,109,63,0.15);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 40px 50px;
}

/* Paper texture */
.fence-document::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.08;
    pointer-events: none;
}

/* Scrollbar */
.fence-document::-webkit-scrollbar {
    width: 12px;
}

.fence-document::-webkit-scrollbar-track {
    background: #EBE6D8;
    border-left: 2px solid #8E7F7F;
}

.fence-document::-webkit-scrollbar-thumb {
    background: #8E7F7F;
    border-radius: 6px;
}

.fence-document::-webkit-scrollbar-thumb:hover {
    background: #6E5F5F;
}

/* Header */
.fence-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px double #8E7F7F;
    position: relative;
}

.fence-title {
    color: #3A3238;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 4px;
    margin: 15px 0;
    text-transform: uppercase;
}

.fence-subtitle {
    color: #5A4F56;
    font-size: 11px;
    letter-spacing: 2px;
    font-style: italic;
    text-transform: uppercase;
}

/* FBI Stamp */
.fence-stamp {
    position: absolute;
    color: rgba(139, 47, 71, 0.5);
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 2px;
    border: 3px solid rgba(139, 47, 71, 0.5);
    padding: 8px 15px;
    transform: rotate(-15deg);
    text-transform: uppercase;
}

/* Close Button */
.fence-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: #D4C8BE;
    border: 2px solid #8E7F7F;
    border-radius: 50%;
    color: #3A3238;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 100;
}

.fence-close-btn:hover {
    background: #8E7F7F;
    color: #f4e4c4;
    transform: rotate(90deg);
}

/* Content Area */
.fence-content {
    color: #3A3238;
    font-size: 13px;
    line-height: 1.8;
    position: relative;
    z-index: 1;
}

/* ===================
   INTRO PHASE
   =================== */
.fence-intro {
    text-align: center;
}

.fence-portrait {
    font-size: 80px;
    margin: 20px 0;
}

.fence-name {
    color: #3A3238;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
    margin: 10px 0;
}

.fence-rep {
    margin-top: 10px;
}

.rep-star {
    color: #D4C8BE;
    font-size: 18px;
    margin: 0 2px;
}

.rep-star.filled {
    color: #8b6a2f;
}

.fence-wants-box {
    background: rgba(139, 106, 47, 0.1);
    border: 2px solid rgba(139, 106, 47, 0.3);
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
}

.wants-label {
    color: #5A4F56;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.fence-want-tag {
    display: inline-block;
    background: rgba(139, 106, 47, 0.15);
    border: 1px solid rgba(139, 106, 47, 0.4);
    border-radius: 3px;
    padding: 5px 10px;
    margin: 3px;
    color: #5A4F56;
    font-size: 11px;
}

.fence-intro-text {
    background: rgba(212, 200, 190, 0.3);
    border-left: 4px solid #8E7F7F;
    padding: 15px 20px;
    margin: 20px 0;
    font-style: italic;
    color: #3A3238;
    line-height: 1.6;
    text-align: left;
}

.fence-inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin: 25px 0;
}

.fence-inv-item {
    background: rgba(212, 200, 190, 0.3);
    border: 2px solid #D4C8BE;
    border-radius: 4px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.fence-inv-item:hover {
    background: rgba(212, 200, 190, 0.5);
    border-color: #8E7F7F;
}

.fence-inv-item.wanted {
    border-color: rgba(139, 106, 47, 0.6);
    background: rgba(139, 106, 47, 0.1);
}

.inv-item-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.inv-item-name {
    color: #3A3238;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
}

.inv-item-value {
    color: #8b6a2f;
    font-size: 11px;
}

/* ===================
   PREP PHASE
   =================== */
.fence-prep {
    max-width: 700px;
    margin: 0 auto;
}

.fence-portrait-compact {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(212, 200, 190, 0.3);
    border: 2px solid #D4C8BE;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 25px;
}

.portrait-icon {
    font-size: 48px;
}

.portrait-info {
    flex: 1;
}

.portrait-name {
    color: #3A3238;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.mood-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mood-label {
    color: #5A4F56;
    font-size: 10px;
    letter-spacing: 1px;
    white-space: nowrap;
}

.mood-bar {
    flex: 1;
    height: 16px;
    background: #D4C8BE;
    border: 2px solid #8E7F7F;
    border-radius: 3px;
    overflow: hidden;
}

.mood-fill {
    height: 100%;
    transition: width 0.5s ease;
    background: linear-gradient(90deg, #8b6a2f 0%, #ab8a4f 100%);
}

.mood-text {
    color: #5A4F56;
    font-size: 10px;
    white-space: nowrap;
    min-width: 80px;
    text-align: right;
}

.prep-title {
    color: #3A3238;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    letter-spacing: 2px;
    margin: 25px 0;
    padding: 10px;
    border-top: 2px solid #8E7F7F;
    border-bottom: 2px solid #8E7F7F;
}

.prep-options {
    display: grid;
    gap: 15px;
    margin: 25px 0;
}

.prep-card {
    background: rgba(212, 200, 190, 0.3);
    border: 2px solid #D4C8BE;
    border-radius: 4px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.prep-card:hover {
    background: rgba(212, 200, 190, 0.5);
    border-color: #8E7F7F;
    transform: translateX(5px);
}

.prep-icon {
    font-size: 36px;
}

.prep-info {
    flex: 1;
}

.prep-name {
    color: #3A3238;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.prep-desc {
    color: #5A4F56;
    font-size: 11px;
    font-style: italic;
}

.prep-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
    min-width: 100px;
}

.prep-cost {
    color: #8b2f47;
    font-size: 11px;
    font-weight: bold;
}

.prep-effect {
    color: #4a7a4a;
    font-size: 11px;
    font-weight: bold;
}

/* ===================
   SELECT PHASE
   =================== */
.fence-select {
    max-width: 700px;
    margin: 0 auto;
}

.fence-sell-items {
    margin: 20px 0;
}

.fence-sell-item {
    background: rgba(212, 200, 190, 0.3);
    border: 2px solid #D4C8BE;
    border-radius: 4px;
    padding: 15px;
    margin: 12px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.fence-sell-item:hover {
    background: rgba(212, 200, 190, 0.5);
    border-color: #8E7F7F;
    transform: translateX(5px);
}

.fence-sell-item.selected {
    border-color: #4a7a4a;
    background: rgba(74, 122, 74, 0.15);
    box-shadow: 0 0 10px rgba(74, 122, 74, 0.2);
}

.sell-item-icon {
    font-size: 36px;
}

.sell-item-info {
    flex: 1;
}

.sell-item-name {
    color: #3A3238;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 5px;
}

.sell-item-quality {
    color: #5A4F56;
    font-size: 10px;
    font-style: italic;
}

.sell-item-value {
    color: #8b6a2f;
    font-size: 14px;
    font-weight: bold;
    min-width: 80px;
    text-align: right;
}

.select-title {
    color: #3A3238;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    letter-spacing: 2px;
    margin: 25px 0;
    padding: 10px;
    border-top: 2px solid #8E7F7F;
    border-bottom: 2px solid #8E7F7F;
}

/* ===================
   READING PHASE
   =================== */
.fence-reading {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.reading-item-display {
    background: rgba(212, 200, 190, 0.3);
    border: 2px solid #D4C8BE;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.reading-item-icon {
    font-size: 48px;
}

.reading-item-info {
    flex: 1;
    text-align: left;
}

.reading-item-name {
    color: #3A3238;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.reading-item-quality {
    color: #5A4F56;
    font-size: 11px;
    font-style: italic;
    margin-bottom: 8px;
}

.reading-item-value {
    color: #8b6a2f;
    font-size: 12px;
    font-weight: bold;
}

.tells-section {
    margin: 30px 0;
}

.tells-title {
    color: #3A3238;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.tells-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.tell-card {
    background: rgba(212, 200, 190, 0.2);
    border: 2px solid #D4C8BE;
    border-radius: 4px;
    padding: 15px;
    text-align: center;
    opacity: 0.3;
    transition: all 0.5s ease;
}

.tell-card.active {
    opacity: 1;
    border-color: #8E7F7F;
    background: rgba(212, 200, 190, 0.4);
    animation: cardActivate 0.5s ease;
}

@keyframes cardActivate {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.tell-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.tell-label {
    color: #5A4F56;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.tell-desc {
    color: #3A3238;
    font-size: 11px;
    font-style: italic;
}

.reading-question-box {
    background: rgba(212, 200, 190, 0.3);
    border: 2px solid #D4C8BE;
    border-radius: 4px;
    padding: 20px;
    margin: 25px 0;
}

.reading-question {
    color: #3A3238;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.reading-options {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}

.reading-option-btn {
    background: rgba(212, 200, 190, 0.2);
    border: 2px solid #D4C8BE;
    border-radius: 4px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #3A3238;
    font-size: 12px;
    text-align: left;
    font-family: 'Special Elite', 'Courier New', monospace;
}

.reading-option-btn:hover {
    background: rgba(212, 200, 190, 0.4);
    border-color: #8E7F7F;
    transform: translateX(5px);
}

.reading-timer {
    color: #5A4F56;
    font-size: 12px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #8E7F7F;
}

/* ===================
   HAGGLE PHASE
   =================== */
.fence-haggle {
    max-width: 700px;
    margin: 0 auto;
}

.haggle-item-display {
    background: rgba(212, 200, 190, 0.3);
    border: 2px solid #D4C8BE;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.haggle-item-icon {
    font-size: 48px;
}

.haggle-item-info {
    flex: 1;
}

.haggle-item-name {
    color: #3A3238;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
}

.haggle-values {
    display: flex;
    gap: 30px;
}

.haggle-value {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.value-label {
    color: #5A4F56;
    font-size: 10px;
    letter-spacing: 1px;
}

.value-amount {
    color: #3A3238;
    font-size: 18px;
    font-weight: bold;
}

.value-amount.offer {
    color: #8b6a2f;
}

.bonuses-box {
    background: rgba(212, 200, 190, 0.3);
    border: 2px solid #D4C8BE;
    border-radius: 4px;
    padding: 15px 20px;
    margin: 20px 0;
}

.haggle-section {
    margin: 25px 0;
}

.haggle-round {
    color: #5A4F56;
    font-size: 11px;
    letter-spacing: 1px;
    text-align: center;
    margin-bottom: 15px;
}

.haggle-dialogue-box {
    background: rgba(212, 200, 190, 0.3);
    border-left: 4px solid #8E7F7F;
    padding: 15px 20px;
    margin: 20px 0;
    font-style: italic;
    color: #3A3238;
    line-height: 1.6;
    min-height: 60px;
    text-align: left;
}

.haggle-speaker {
    color: #8b6a2f;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 5px;
}

.offer-bar {
    margin: 25px 0;
}

.offer-labels {
    display: flex;
    justify-content: space-between;
    color: #5A4F56;
    font-size: 10px;
    margin-bottom: 8px;
}

.offer-track {
    background: linear-gradient(90deg, #8b2f47 0%, #8b6a2f 50%, #4a7a4a 100%);
    height: 10px;
    border-radius: 5px;
    position: relative;
    border: 2px solid #8E7F7F;
}

.offer-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 20px;
    background: #3A3238;
    border-radius: 2px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    transition: left 0.5s ease;
}

.marker-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: #3A3238;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
}

.haggle-actions {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 25px 0;
}

.haggle-btn {
    background: #D4C8BE;
    border: 2px solid #8E7F7F;
    border-radius: 4px;
    padding: 12px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 11px;
    color: #3A3238;
    font-family: 'Special Elite', 'Courier New', monospace;
    font-weight: bold;
}

.haggle-btn:hover {
    background: #8E7F7F;
    color: #f4e4c4;
    transform: translateY(-2px);
}

.haggle-btn.accept {
    border-color: #4a7a4a;
}

.haggle-btn.accept:hover {
    background: #4a7a4a;
}

.haggle-btn.counter {
    border-color: #8b6a2f;
}

.haggle-btn.counter:hover {
    background: #8b6a2f;
}

.haggle-btn.walk {
    border-color: #8b2f47;
}

.haggle-btn.walk:hover {
    background: #8b2f47;
}

.tactics-section {
    margin: 25px 0;
    padding: 20px;
    background: rgba(212, 200, 190, 0.3);
    border: 2px solid #D4C8BE;
    border-radius: 4px;
}

.tactics-title {
    color: #5A4F56;
    font-size: 11px;
    letter-spacing: 1px;
    margin-bottom: 15px;
    text-align: center;
    text-transform: uppercase;
}

.tactics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.tactic-btn {
    background: #D4C8BE;
    border: 2px solid #8E7F7F;
    border-radius: 4px;
    padding: 15px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 11px;
    color: #3A3238;
    font-family: 'Special Elite', 'Courier New', monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.tactic-btn:hover {
    background: #8E7F7F;
    color: #f4e4c4;
}

.tactic-btn.threaten {
    border-color: #8b2f47;
}

.tactic-btn.flatter {
    border-color: #8b6a2f;
}

.tactic-btn.rival {
    border-color: #4a7a4a;
}

.tactic-btn.used {
    opacity: 0.3;
    cursor: not-allowed;
    text-decoration: line-through;
}

.tactic-btn.used:hover {
    background: #D4C8BE;
    color: #3A3238;
}

.tactic-icon {
    font-size: 24px;
}

.tactic-name {
    font-size: 10px;
    letter-spacing: 0.5px;
}

/* ===================
   BUTTONS
   =================== */
.fence-btn {
    background: #D4C8BE;
    border: 2px solid #8E7F7F;
    border-radius: 4px;
    padding: 12px 20px;
    color: #3A3238;
    font-family: 'Special Elite', 'Courier New', monospace;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    font-weight: bold;
}

.fence-btn:hover {
    background: #8E7F7F;
    color: #f4e4c4;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.fence-btn:active {
    transform: translateY(0);
}

.fence-btn.primary {
    background: #4a7a4a;
    border-color: #4a7a4a;
    color: #f4e4c4;
}

.fence-btn.primary:hover {
    background: #5a9a5a;
    border-color: #5a9a5a;
}

.fence-btn.danger {
    background: #8b2f47;
    border-color: #8b2f47;
    color: #f4e4c4;
}

.fence-btn.danger:hover {
    background: #a03850;
    border-color: #a03850;
}

.fence-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.fence-btn:disabled:hover {
    transform: none;
    background: #D4C8BE;
    color: #3A3238;
}

/* ===================
   STATUS & FOOTER
   =================== */
.fence-status {
    background: rgba(212, 200, 190, 0.3);
    border: 2px solid #D4C8BE;
    border-radius: 4px;
    padding: 12px 15px;
    margin-bottom: 20px;
    font-size: 12px;
    color: #3A3238;
    text-align: center;
    letter-spacing: 1px;
}

.fence-status.success {
    border-color: #4a7a4a;
    background: rgba(74, 122, 74, 0.15);
    color: #2a5a2a;
}

.fence-status.warning {
    border-color: #8b6a2f;
    background: rgba(139, 106, 47, 0.15);
    color: #6b4a1f;
}

.fence-status.danger {
    border-color: #8b2f47;
    background: rgba(139, 47, 71, 0.15);
    color: #6b1f37;
}

.fence-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #8E7F7F;
}

/* ===================
   RESULT OVERLAY
   =================== */
.fence-result-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 26000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease;
}

.fence-result-overlay.show {
    display: flex;
}

.fence-result-content {
    background: #f4e4c4;
    border: 2px solid #8E7F7F;
    border-radius: 4px;
    padding: 40px 50px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    position: relative;
}

.result-stamp {
    position: absolute;
    top: 20px;
    right: 20px;
    color: rgba(139, 47, 71, 0.5);
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
    border: 3px solid rgba(139, 47, 71, 0.5);
    padding: 5px 10px;
    transform: rotate(-15deg);
    text-transform: uppercase;
}

.result-stamp.success {
    color: rgba(74, 122, 74, 0.5);
    border-color: rgba(74, 122, 74, 0.5);
}

.result-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: iconPop 0.5s ease;
}

@keyframes iconPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.result-text {
    color: #3A3238;
    font-size: 14px;
    line-height: 1.8;
    margin: 20px 0;
}

.result-continue-btn {
    background: #D4C8BE;
    border: 2px solid #8E7F7F;
    border-radius: 4px;
    padding: 12px 30px;
    color: #3A3238;
    font-family: 'Special Elite', 'Courier New', monospace;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    margin-top: 20px;
    font-weight: bold;
}

.result-continue-btn:hover {
    background: #8E7F7F;
    color: #f4e4c4;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* ===================
   RESPONSIVE
   =================== */
@media (max-width: 768px) {
    .fence-document {
        width: 95%;
        padding: 20px 25px;
    }

    .tells-grid {
        grid-template-columns: 1fr;
    }

    .haggle-actions {
        grid-template-columns: 1fr;
    }

    .tactics-grid {
        grid-template-columns: 1fr;
    }

    .fence-title {
        font-size: 18px;
    }
}
