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

body {
    font-family: 'Courier New', monospace;
    background: #000;
    color: #fff;
    height: 100vh;
    overflow: hidden;
    padding: 10px;
}

.container {
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

h1 {
    color: #fff;
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.citation {
    color: #888;
    text-align: center;
    font-size: 0.75rem;
    font-style: italic;
    margin-bottom: 15px;
}

/* Main Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    flex: 1;
    overflow: hidden;
}

.left-column, .right-column, .rfid-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow: hidden;
}

/* Balance & Shop Card */
.balance-shop-card {
    background: #000;
    border: 2px solid #FF6600;
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

.balance-shop-card h2 {
    color: #FF6600;
    font-size: 1.2rem;
    margin-bottom: 10px;
    border-bottom: 1px solid #FF6600;
    padding-bottom: 5px;
}

.balance-shop-card h3 {
    color: #FF6600;
    font-size: 1rem;
    margin: 15px 0 10px 0;
    border-bottom: 1px solid #FF6600;
    padding-bottom: 5px;
}

.balance-amount {
    color: #FF6600;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 10px 0;
}

.balance-eur {
    color: #FFA500;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.address-qr {
    max-width: 150px;
    border: 2px solid #FF6600;
    padding: 5px;
    background: #fff;
    margin: 10px 0;
}

/* Shop Grid */
.shop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.product-mini {
    background: #111;
    border: 1px solid #FF6600;
    padding: 8px;
    text-align: center;
}

.product-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.product-info strong {
    color: #FFA500;
}

.product-price-mini {
    color: #FF6600;
}

.product-qr-mini {
    max-width: 80px;
    border: 1px solid #FF6600;
    margin: 5px auto;
    display: block;
}

.qr-amount-mini {
    font-size: 0.7rem;
    color: #FF6600;
    margin-top: 5px;
}

/* Balance & Transaction Grid */
.balance-tx-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.balance-section, .transactions-section {
    display: flex;
    flex-direction: column;
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.balance-header h2 {
    margin: 0;
    border: none;
    padding: 0;
}

.balance-header .timer {
    color: #FFA500;
    font-size: 0.85rem;
}

/* Transaction History */
.transactions-section h3 {
    font-size: 1rem;
    color: #FF6600;
    margin: 0 0 10px 0;
    border-bottom: 1px solid #FF6600;
    padding-bottom: 5px;
}

.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.transaction-item {
    background: #1a1a1a;
    border-left: 3px solid #FF6600;
    padding: 6px 10px;
    font-size: 0.75rem;
}

.tx-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.tx-in {
    color: #4CAF50;
    font-weight: bold;
}

.tx-out {
    color: #f44336;
    font-weight: bold;
}

.tx-amount {
    color: #FF6600;
    font-weight: bold;
}

.tx-pending {
    opacity: 0.7;
}

.tx-pending-badge {
    background: #FFA500;
    color: #000;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: bold;
}

.tx-details {
    display: flex;
    justify-content: space-between;
    color: #888;
    font-size: 0.7rem;
}

.tx-time {
    color: #999;
}

.tx-conf {
    color: #4CAF50;
}

.no-transactions {
    color: #666;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* YouTube Card */
.youtube-card {
    background: #2d1b69;
    border: 2px solid #ff69b4;
    padding: 12px;
}

.radio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.youtube-card h2 {
    color: #ff69b4;
    font-size: 1.2rem;
    margin: 0;
}

.radio-toggle {
    background: transparent;
    border: 1px solid #ff69b4;
    color: #ff69b4;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 1rem;
    border-radius: 3px;
    transition: all 0.3s;
}

.radio-toggle:hover {
    background: #ff69b4;
    transform: scale(1.1);
}

.audio-player {
    background: #000;
    padding: 5px;
    border: 1px solid #c471ed;
}

.youtube-controls {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
}

.youtube-controls input {
    flex: 1;
    padding: 6px;
    border: 1px solid #c471ed;
    background: #000;
    color: #e0b3ff;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
}

.load-btn {
    background: #ff69b4;
    color: #000;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: bold;
}

.load-btn:hover {
    background: #c471ed;
}

#youtube-player-container {
    background: #000;
    border: 1px solid #c471ed;
}

#youtube-player-container iframe {
    width: 100%;
    height: 200px;
}

/* Chess Card */
.chess-card {
    background: #001a33;
    border: 2px solid #4169e1;
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.chess-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 1px solid #4169e1;
    padding-bottom: 5px;
}

.chess-card h2 {
    color: #4169e1;
    font-size: 1.2rem;
    margin: 0;
}

.chess-buttons {
    display: flex;
    gap: 5px;
}

.undo-btn, .reset-btn {
    background: transparent;
    border: 1px solid #4169e1;
    color: #4169e1;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 0.9rem;
    border-radius: 3px;
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
}

.undo-btn:hover, .reset-btn:hover {
    background: #4169e1;
    color: #000;
}

.chess-info {
    margin-bottom: 8px;
}

.chess-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.current-player {
    color: #87ceeb;
    font-weight: bold;
    font-size: 0.9rem;
}

.last-move {
    color: #6495ed;
    font-size: 0.8rem;
}

/* Chess Board */
.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0;
    aspect-ratio: 1;
    border: 2px solid #4169e1;
    margin-bottom: 10px;
    max-width: 400px;
}

.chess-square {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 2rem;
    transition: background 0.2s;
}

.chess-square.light {
    background: #f0d9b5;
}

.chess-square.dark {
    background: #b58863;
}

.chess-square:hover {
    opacity: 0.8;
}

.chess-square.selected {
    background: #7fc97f !important;
    box-shadow: inset 0 0 10px rgba(0,255,0,0.5);
}

.chess-piece {
    user-select: none;
    pointer-events: none;
}

.chess-piece.white {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8), 1px 1px 1px rgba(0, 0, 0, 0.5);
}

.chess-piece.black {
    color: #000;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.5), 1px 1px 1px rgba(255, 255, 255, 0.3);
}

/* Move History */
.move-history-section {
    margin-top: 8px;
}

.move-history-section h4 {
    color: #4169e1;
    font-size: 0.9rem;
    margin: 0 0 5px 0;
    border-bottom: 1px solid #4169e1;
    padding-bottom: 3px;
}

.move-history {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 5px;
    overflow-x: auto;
}

.move-item {
    background: #000d1a;
    padding: 3px 8px;
    border-left: 2px solid #4169e1;
    font-size: 0.75rem;
    color: #87ceeb;
    white-space: nowrap;
}

.move-player {
    font-weight: bold;
    margin-right: 8px;
}

.move-player.white {
    color: #fff;
}

.move-player.black {
    color: #666;
}

/* Matrix Card */
.matrix-card {
    background: #000;
    border: 2px solid #00ff00;
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.matrix-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 1px solid #00ff00;
    padding-bottom: 5px;
}

.matrix-card h2 {
    color: #00ff00;
    font-size: 1.2rem;
}

.timer {
    color: #00ff00;
    font-size: 0.9rem;
}

.matrix-text {
    flex: 1;
    overflow-y: auto;
    color: #00ff00;
    font-size: 0.75rem;
    line-height: 1.2;
}

.matrix-text p {
    margin: 0;
    white-space: pre;
}

/* Scrollbars */
.balance-shop-card::-webkit-scrollbar,
.matrix-text::-webkit-scrollbar {
    width: 8px;
}

.balance-shop-card::-webkit-scrollbar-track {
    background: #000;
}

.balance-shop-card::-webkit-scrollbar-thumb {
    background: #FF6600;
}

.matrix-text::-webkit-scrollbar-track {
    background: #000;
}

.matrix-text::-webkit-scrollbar-thumb {
    background: #00ff00;
}

/* RFID/Ledger Card */
.rfid-card {
    background: #1a1a00;
    border: 2px solid #FFD700;
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

.rfid-header {
    border-bottom: 1px solid #FFD700;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.rfid-card h2 {
    color: #FFD700;
    font-size: 1.2rem;
    margin: 0;
}

/* Integrity Indicator */
.rfid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #FFD700;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.integrity-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 4px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid #FFD700;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
}

.integrity-indicator:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.05);
}

.integrity-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

.integrity-dot.valid {
    background: #4CAF50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.integrity-dot.invalid {
    background: #f44336;
    box-shadow: 0 0 8px rgba(244, 67, 54, 0.6);
}

.integrity-dot.checking {
    background: #FFA500;
    box-shadow: 0 0 8px rgba(255, 165, 0, 0.6);
}

.integrity-status {
    color: #FFD700;
    font-weight: bold;
    white-space: nowrap;
}

.integrity-status.valid {
    color: #4CAF50;
}

.integrity-status.invalid {
    color: #f44336;
}

.integrity-status.checking {
    color: #FFA500;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.rfid-input-section {
    margin-bottom: 15px;
}

.rfid-input-section label {
    color: #FFD700;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 5px;
}

.input-with-button {
    display: flex;
    gap: 5px;
}

.rfid-input-section input {
    flex: 1;
    padding: 8px;
    background: #000;
    border: 1px solid #FFD700;
    color: #FFD700;
    font-family: 'Courier New', monospace;
}

.lookup-btn {
    background: transparent;
    border: 1px solid #FFD700;
    color: #FFD700;
    padding: 8px 16px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    transition: all 0.3s;
    white-space: nowrap;
}

.add-btn {
    background: transparent;
    border: 1px solid #FFD700;
    color: #FFD700;
    padding: 8px 16px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    width: 100%;
    transition: all 0.3s;
}

.lookup-btn:hover, .add-btn:hover {
    background: #FFD700;
    color: #000;
}

.uuid-welcome {
    background: #2a2a00;
    color: #FFD700;
    padding: 10px;
    margin-bottom: 15px;
    border-left: 3px solid #FFD700;
    font-weight: bold;
}

.uuid-balance-section {
    margin: 15px 0;
}

.uuid-balance-section h3 {
    color: #FFD700;
    font-size: 1rem;
    margin: 0 0 10px 0;
    border-bottom: 1px solid #FFD700;
    padding-bottom: 5px;
}

.uuid-balance-amount {
    font-size: 2rem;
    color: #FFD700;
    font-weight: bold;
    text-align: center;
    padding: 15px;
    background: #000;
    border: 2px solid #FFD700;
    margin-bottom: 15px;
}

.add-balance-section {
    margin-bottom: 15px;
}

.add-balance-section label {
    color: #FFD700;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 5px;
}

.add-balance-section input {
    width: 100%;
    padding: 8px;
    background: #000;
    border: 1px solid #FFD700;
    color: #FFD700;
    font-family: 'Courier New', monospace;
    margin-bottom: 8px;
}

.uuid-transactions-section h4 {
    color: #FFD700;
    font-size: 0.9rem;
    margin: 0 0 10px 0;
    border-bottom: 1px solid #FFD700;
    padding-bottom: 5px;
}

.uuid-transactions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.uuid-tx-item {
    background: #0d0d00;
    border-left: 3px solid #FFD700;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

/* LOV Balance Display */
.lov-balance-display {
    background: #2a2a00;
    color: #FFD700;
    padding: 10px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    border: 2px solid #FFD700;
    margin-bottom: 15px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.quick-btn {
    flex: 1;
    background: transparent;
    border: 1px solid #FFD700;
    color: #FFD700;
    padding: 6px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.quick-btn:hover {
    background: #FFD700;
    color: #000;
}

.give-all-btn {
    flex: 1;
    background: transparent;
    border: 1px solid #FF69B4;
    color: #FF69B4;
    padding: 6px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.give-all-btn:hover {
    background: #FF69B4;
    color: #000;
}

/* Shop Section */
.shop-section {
    margin: 15px 0;
}

.shop-section h4 {
    color: #FFD700;
    font-size: 0.9rem;
    margin: 0 0 8px 0;
    border-bottom: 1px solid #FFD700;
    padding-bottom: 3px;
}

.shop-items {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.shop-item {
    background: #0d0d00;
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 2px solid #FFD700;
}

.shop-item span {
    color: #FFD700;
    font-size: 0.85rem;
}

.add-basket-btn {
    background: transparent;
    border: 1px solid #FFD700;
    color: #FFD700;
    padding: 2px 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.add-basket-btn:hover {
    background: #FFD700;
    color: #000;
}

/* Basket Section */
.basket-section {
    margin: 15px 0;
    border: 1px solid #FFD700;
    padding: 10px;
    background: #0d0d00;
}

.basket-section h4 {
    color: #FFD700;
    font-size: 0.9rem;
    margin: 0 0 8px 0;
    border-bottom: 1px solid #FFD700;
    padding-bottom: 3px;
}

.basket-items {
    min-height: 60px;
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.basket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    color: #FFD700;
    font-size: 0.8rem;
}

.remove-btn {
    background: transparent;
    border: 1px solid #f44336;
    color: #f44336;
    padding: 0px 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    line-height: 1;
    transition: all 0.3s;
}

.remove-btn:hover {
    background: #f44336;
    color: #000;
}

.basket-total-line {
    color: #FFD700;
    text-align: right;
    padding: 8px 0;
    border-top: 1px solid #FFD700;
    margin-bottom: 8px;
}

.basket-actions {
    display: flex;
    gap: 5px;
}

.checkout-btn {
    flex: 2;
    background: transparent;
    border: 1px solid #4CAF50;
    color: #4CAF50;
    padding: 8px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    transition: all 0.3s;
}

.checkout-btn:hover {
    background: #4CAF50;
    color: #000;
}

.clear-btn {
    flex: 1;
    background: transparent;
    border: 1px solid #f44336;
    color: #f44336;
    padding: 8px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    transition: all 0.3s;
}

.clear-btn:hover {
    background: #f44336;
    color: #000;
}

/* Custom Modal */
.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #1a1a1a;
    border: 2px solid #FFD700;
    padding: 25px;
    border-radius: 8px;
    max-width: 400px;
    min-width: 300px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

#modal-message {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.5;
}

#modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-btn {
    background: transparent;
    border: 1px solid #FFD700;
    color: #FFD700;
    padding: 10px 25px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    transition: all 0.3s;
    border-radius: 4px;
}

.modal-btn:hover {
    background: #FFD700;
    color: #000;
    transform: translateY(-2px);
}

.modal-confirm {
    border-color: #4CAF50;
    color: #4CAF50;
}

.modal-confirm:hover {
    background: #4CAF50;
    color: #fff;
}

.modal-cancel {
    border-color: #f44336;
    color: #f44336;
}

.modal-cancel:hover {
    background: #f44336;
    color: #fff;
}

/* Confetti Container */
.confetti-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
}

.confetti-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 9999;
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

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

    .modal-content {
        max-width: 90%;
        min-width: 250px;
    }

    .confetti-message {
        font-size: 1.8rem;
    }
}
