* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #E8E0D0;
    min-height: 100vh;
    padding: 40px 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    color: #1A1A1A;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #FAF9F6;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.stat-card h2 {
    font-size: 1rem;
    color: #4A4A4A;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #1A1A1A;
    margin-bottom: 10px;
}

.stat-value.primary {
    color: #C5A55E;
}

.stat-label {
    font-size: 0.9rem;
    color: #6B6B6B;
}

.series-section {
    background: #FAF9F6;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    margin-bottom: 40px;
}

.series-section h2 {
    font-size: 1.5rem;
    color: #1A1A1A;
    margin-bottom: 20px;
}

.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.series-item {
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.series-code {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.series-info {
    font-size: 0.9rem;
    opacity: 0.9;
}

.breakdown-section {
    background: #FAF9F6;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.breakdown-section h2 {
    font-size: 1.5rem;
    color: #1A1A1A;
    margin-bottom: 20px;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.breakdown-item {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.breakdown-item.active {
    background: #2F5233;
    color: white;
}

.breakdown-item.inactive {
    background: #B8860B;
    color: white;
}

.breakdown-item.destroyed {
    background: #8B1A1A;
    color: white;
}

.breakdown-item.lost {
    background: #6B7280;
    color: white;
}

.breakdown-count {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.breakdown-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.verification-section {
    background: #FAF9F6;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    margin-bottom: 40px;
}

.verification-section h2 {
    font-size: 1.5rem;
    color: #1A1A1A;
    margin-bottom: 20px;
}

.verification-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.9rem;
    color: #4A4A4A;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    padding: 12px;
    border: 2px solid #E8E4DC;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #C5A55E;
}

.verify-button {
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: auto;
}

.verify-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(197, 165, 94, 0.4);
}

.verify-button:active {
    transform: translateY(0);
}

.verification-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
    display: none;
}

.verification-result.success {
    background: #E8F5E9;
    border: 2px solid #4A7C4E;
}

.verification-result.error {
    background: #FFEBEE;
    border: 2px solid #A52A2A;
}

.verification-result.not-found {
    background: #FFFBF0;
    border: 2px solid #B8860B;
}

.result-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.result-title.success {
    color: #2F5233;
}

.result-title.error {
    color: #8B1A1A;
}

.result-title.warning {
    color: #B8860B;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.result-item {
    background: #FFFFFF;
    padding: 15px;
    border-radius: 6px;
}

.result-item-label {
    font-size: 0.85rem;
    color: #4A4A4A;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.result-item-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1A1A1A;
    word-break: break-all;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-badge.active {
    background: #4A7C4E;
    color: white;
}

.status-badge.inactive {
    background: #A52A2A;
    color: white;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.signature-highlight {
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    border: 3px solid #C5A55E;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 8px 16px rgba(197, 165, 94, 0.3);
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0%, 100% {
        box-shadow: 0 8px 16px rgba(197, 165, 94, 0.3);
    }
    50% {
        box-shadow: 0 8px 16px rgba(197, 165, 94, 0.6), 0 0 30px rgba(197, 165, 94, 0.4);
    }
}

.signature-highlight .result-item-label {
    color: #FFF8DC;
    font-size: 1rem;
    font-weight: bold;
}

.signature-highlight .result-item-value {
    color: white;
    font-size: 1.3rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
    letter-spacing: 1px;
}

.exchange-section {
    background: #FAF9F6;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    margin-bottom: 40px;
}

.exchange-section h2 {
    font-size: 1.5rem;
    color: #1A1A1A;
    margin-bottom: 20px;
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    padding: 2px 0 10px 0;
    margin: -2px 0 -10px 0;
}

.scroll-hint {
    display: none;
    text-align: center;
    color: #C5A55E;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(197, 165, 94, 0.1);
    border-radius: 6px;
}

.exchange-table {
    width: 100%;
    border-collapse: collapse;
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.exchange-table thead tr:first-child th:first-child {
    border-top-left-radius: 8px;
}

.exchange-table thead tr:first-child th:last-child {
    border-top-right-radius: 8px;
}

.exchange-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.exchange-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

.exchange-table thead {
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    color: white;
}

.exchange-table th {
    padding: 12px 20px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exchange-table td {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #E8E4DC;
    font-size: 1.1rem;
    color: #1A1A1A;
}

.exchange-table tbody tr {
    transition: background-color 0.2s ease;
}

.exchange-table tbody tr:hover {
    background-color: #f8fafc;
}

.exchange-table tbody tr:last-child td {
    border-bottom: none;
}

.exchange-resource {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 600;
}

.exchange-resource-icon {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
}

.exchange-rate-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

.exchange-rate-icon {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
}

.exchange-arrow {
    color: #C5A55E;
    font-weight: bold;
    margin: 0 4px;
}

/* Orders Section */
.orders-section {
    background: #FAF9F6;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    margin-bottom: 40px;
}

.orders-section h2 {
    font-size: 1.5rem;
    color: #1A1A1A;
    margin-bottom: 20px;
}

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.order-card {
    background: linear-gradient(135deg, #FDFCFA 0%, #F5F3F0 100%);
    border: 2px solid #E8E4DC;
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.order-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(197, 165, 94, 0.2);
    border-color: #C5A55E;
}

.order-card.order-completed {
    background: linear-gradient(135deg, rgba(232, 245, 233, 0.85) 0%, rgba(200, 230, 201, 0.85) 100%);
    border-color: #4A7C4E;
    filter: saturate(0.8) brightness(0.98);
}

.order-card.order-from-bank {
    background: linear-gradient(135deg, #FFF8DC 0%, #F5DEB3 100%);
    border-color: #C5A55E;
}

/* .order-card.order-from-town - Background and border colors are set dynamically via inline styles */

.order-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #E8E4DC;
}

.minecraft-avatar {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    image-rendering: pixelated;
    border: 2px solid #C5A55E;
    box-shadow: 0 2px 8px rgba(197, 165, 94, 0.3);
}

.order-emoji-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.minecraft-username {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1A1A1A;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1A1A1A;
    line-height: 1.2;
    letter-spacing: 0.3px;
}

.order-subtitle {
    font-size: 0.85rem;
    font-weight: 500;
    color: #4A4A4A;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.order-subtitle-avatar {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    image-rendering: pixelated;
    border: 1px solid #E8E4DC;
    flex-shrink: 0;
}

.order-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-status-badge.completed {
    background: #4A7C4E;
    color: white;
}

.order-status-badge.bank {
    background: #C5A55E;
    color: white;
}

.order-status-badge.town {
    color: white;
    /* Background color will be set inline from town.color */
}

.minecraft-avatar.town-avatar {
    /* Border color and box-shadow will be set inline from town.color */
    border-width: 3px;
}

.order-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.order-resource {
    display: flex;
    align-items: center;
    gap: 12px;
}

.resource-icon {
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
}

.resource-details {
    flex: 1;
}

.resource-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 4px;
}

.resource-amount {
    font-size: 0.9rem;
    color: #4A4A4A;
}

.order-payment {
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.payment-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.payment-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
}

.footer {
    text-align: center;
    color: #1A1A1A;
    margin-top: 40px;
    padding: 20px;
    opacity: 0.8;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .header p {
        font-size: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .series-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .breakdown-grid {
        grid-template-columns: 1fr;
    }

    .verification-form {
        grid-template-columns: 1fr;
    }

    /* Make exchange table responsive */
    .exchange-section {
        padding: 20px 15px;
    }

    .scroll-hint {
        display: block;
    }

    .table-wrapper {
        margin: 0 -15px;
        padding: 0 15px;
    }

    .exchange-table {
        min-width: 600px;
        font-size: 0.9rem;
    }

    .exchange-table th {
        padding: 10px 8px;
        font-size: 0.8rem;
    }

    .exchange-table td {
        padding: 12px 8px;
        font-size: 0.95rem;
    }

    .exchange-resource {
        gap: 8px;
        font-size: 0.9rem;
    }

    .exchange-resource-icon {
        width: 36px;
        height: 36px;
    }

    .exchange-rate-cell {
        gap: 4px;
        font-size: 0.9rem;
    }

    .exchange-rate-icon {
        width: 20px;
        height: 20px;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    /* Orders section responsive */
    .orders-section {
        padding: 20px 15px;
    }

    .orders-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 15px;
    }
}

@media screen and (max-width: 480px) {
    body {
        padding: 20px 10px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 2rem;
    }

    .series-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .series-code {
        font-size: 1.5rem;
    }

    .exchange-section {
        padding: 15px 10px;
    }

    .table-wrapper {
        margin: 0 -10px;
        padding: 0 10px;
    }

    .exchange-table {
        min-width: 500px;
    }

    .exchange-resource {
        flex-direction: column;
        gap: 4px;
        font-size: 0.85rem;
    }

    .exchange-resource-icon {
        width: 32px;
        height: 32px;
    }

    .exchange-rate-cell {
        flex-wrap: wrap;
        font-size: 0.85rem;
    }

    /* Orders section responsive */
    .orders-section {
        padding: 15px 10px;
    }

    .orders-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .order-card {
        padding: 15px;
    }

    .minecraft-avatar {
        width: 40px;
        height: 40px;
    }

    .minecraft-username {
        font-size: 1rem;
    }

    .resource-icon {
        width: 32px;
        height: 32px;
    }
}
