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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    body {
        padding: 20px;
    }
}

/* Auth Panel */
.auth-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.auth-container {
    background: white;
    padding: 30px 20px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    animation: fadeInScale 0.6s ease-out;
    max-width: 500px;
    width: 100%;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .auth-container {
        padding: 60px 80px;
    }
}

@keyframes fadeInScale {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.auth-container h1 {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 10px;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .auth-container h1 {
        font-size: 3em;
    }
}

.auth-tagline {
    color: #666;
    font-size: 1em;
    margin-bottom: 30px;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .auth-tagline {
        font-size: 1.2em;
        margin-bottom: 40px;
    }
}

.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: white;
    color: #444;
    border: 2px solid #ddd;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-google:active {
    transform: translateY(0);
}

.auth-info {
    color: #999;
    font-size: 0.9em;
    margin-top: 30px;
    max-width: 350px;
    line-height: 1.5;
}

/* User Info */
.user-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .user-info {
        gap: 15px;
        justify-content: flex-start;
    }
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #667eea;
    object-fit: cover;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .user-avatar {
        width: 50px;
        height: 50px;
    }
}

.user-name {
    color: #333;
    font-weight: 600;
    font-size: 0.95em;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .user-name {
        font-size: 1.1em;
    }
}

.btn-logout {
    background: #ff4757;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #ee5a6f;
    transform: translateY(-2px);
}

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

/* Header */
.header {
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: center;
    margin-bottom: 20px;
    animation: slideDown 0.5s ease-out;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .header {
        padding: 20px 30px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        margin-bottom: 30px;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.logo h1 {
    color: #667eea;
    font-size: 1.8em;
    margin-bottom: 5px;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .logo h1 {
        font-size: 2.5em;
    }
}

.tagline {
    color: #666;
    font-size: 0.85em;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .tagline {
        font-size: 0.9em;
    }
}

.player-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .player-stats {
        gap: 30px;
        justify-content: flex-start;
    }
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.stat-value {
    color: #333;
    font-size: 1.5em;
    font-weight: bold;
}

/* Main Content */
.main-content {
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.action-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .action-panel {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
        margin-bottom: 25px;
    }
}

.btn {
    padding: 12px 20px;
    font-size: 0.95em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .btn {
        padding: 12px 25px;
        font-size: 1em;
    }
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #333;
}

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

/* Sections */
.listings-section, .inventory-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.listings-section h2, .inventory-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

/* Grid układy */
.listings-grid, .inventory-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

/* Tablet */
@media (min-width: 600px) {
    .listings-grid, .inventory-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .listings-grid, .inventory-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large desktop */
@media (min-width: 1400px) {
    .listings-grid, .inventory-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Karty ogłoszeń */
.listing-card {
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    animation: cardAppear 0.5s ease-out;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.listing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

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

.listing-emoji {
    font-size: 3em;
}

.listing-price {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
}

.listing-title {
    color: #333;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 10px;
}

.listing-description {
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
    margin-bottom: 15px;
}

.listing-seller {
    color: #999;
    font-size: 0.85em;
    margin-bottom: 8px;
}

.listing-market-value {
    color: #667eea;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 15px;
    padding: 8px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    text-align: center;
}

.listing-actions {
    display: flex;
    gap: 10px;
}

.listing-actions .btn {
    flex: 1;
    padding: 10px;
    font-size: 0.9em;
}

/* Karty ekwipunku */
.inventory-card {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.inventory-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

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

.inventory-emoji {
    font-size: 3em;
}

.inventory-bought-price {
    font-size: 1em;
    color: #666;
}

.inventory-title {
    color: #333;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
}

.inventory-actions {
    display: flex;
    gap: 10px;
}

.inventory-actions .btn {
    flex: 1;
    padding: 10px;
    font-size: 0.9em;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: white;
    margin: 2vh auto;
    padding: 15px;
    border-radius: 15px;
    width: 95%;
    max-width: 500px;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
    animation: modalSlide 0.3s ease-out;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .modal-content {
        padding: 25px;
        max-width: 900px;
    }
}

@keyframes modalSlide {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #000;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5em;
}

#modal-body, #sell-modal-body {
    margin-top: 15px;
}

.negotiation-info {
    margin-bottom: 15px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
}

.negotiation-item {
    font-size: 1.05em;
    margin-bottom: 8px;
}

.negotiation-message {
    background: #fff3cd;
    padding: 12px;
    border-radius: 8px;
    margin: 12px 0;
    border-left: 4px solid #ffc107;
}

.offer-input {
    width: 100%;
    padding: 10px;
    font-size: 1.05em;
    border: 2px solid #667eea;
    border-radius: 8px;
    margin: 12px 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions .btn {
    flex: 1;
}

/* Komunikaty */
.message {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 600;
}

.message-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.message-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-emoji {
    font-size: 4em;
    margin-bottom: 20px;
}

/* Leaderboard */
.leaderboard-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
    animation: fadeIn 0.5s ease-out;
}

.leaderboard-container {
    margin-top: 20px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    flex-wrap: wrap;
    gap: 10px;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .leaderboard-item {
        padding: 20px;
        margin-bottom: 15px;
        flex-wrap: nowrap;
    }
}

.leaderboard-item:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Desktop */
@media (min-width: 768px) {
    .leaderboard-item:hover {
        transform: translateX(10px);
    }
}

.leaderboard-item.current-user {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border: 3px solid #f39c12;
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.3);
}

.leaderboard-rank {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
    min-width: 40px;
    text-align: center;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .leaderboard-rank {
        font-size: 2em;
        min-width: 60px;
    }
}

.leaderboard-rank.rank-1 {
    color: #f1c40f;
    font-size: 2em;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .leaderboard-rank.rank-1 {
        font-size: 2.5em;
    }
}

.leaderboard-rank.rank-2 {
    color: #95a5a6;
    font-size: 1.8em;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .leaderboard-rank.rank-2 {
        font-size: 2.2em;
    }
}

.leaderboard-rank.rank-3 {
    color: #cd7f32;
    font-size: 1.6em;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .leaderboard-rank.rank-3 {
        font-size: 2em;
    }
}

.leaderboard-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 0 10px;
    border: 3px solid #667eea;
    object-fit: cover;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .leaderboard-avatar {
        width: 50px;
        height: 50px;
        margin: 0 20px;
    }
}

.leaderboard-info {
    flex: 1;
    min-width: 0;
}

.leaderboard-name {
    font-size: 1em;
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 5px;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .leaderboard-name {
        font-size: 1.2em;
    }
}

.leaderboard-stats {
    color: #636e72;
    font-size: 0.8em;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .leaderboard-stats {
        font-size: 0.9em;
    }
}

.leaderboard-money {
    font-size: 1.2em;
    font-weight: bold;
    color: #27ae60;
    min-width: 100px;
    text-align: right;
}

/* Tablet i desktop */
@media (min-width: 768px) {
    .leaderboard-money {
        font-size: 1.5em;
        min-width: 150px;
    }
}

.leaderboard-loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.2em;
}

.leaderboard-empty {
    text-align: center;
    padding: 60px;
    color: #999;
}

.leaderboard-empty p {
    font-size: 1.2em;
    margin-bottom: 10px;
}

/* Zaawansowane negocjacje */
.negotiation-options {
    margin: 20px 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.negotiation-option-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.negotiation-option-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.negotiation-option-btn:active {
    transform: translateY(0);
}

.negotiation-option-btn small {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    font-weight: 400;
    opacity: 0.9;
    font-style: italic;
}

.negotiation-history {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.message-player,
.message-seller {
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
    line-height: 1.6;
}

.message-player {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.message-seller {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
}

/* Mobile: 1 kolumna, Tablet+: 2 kolumny */
.negotiation-options {
    grid-template-columns: 1fr;
}

@media (min-width: 600px) {
    .negotiation-options {
        grid-template-columns: repeat(2, 1fr);
    }
}
