* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    touch-action: manipulation;
}

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

.header {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-text {
    font-family: 'Pacifico', cursive;
    font-size: 42px;
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 50%, #ff6b9d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(255, 107, 157, 0.3);
    letter-spacing: 1px;
    margin: 0;
    line-height: 1;
    filter: drop-shadow(0 2px 3px rgba(196, 69, 105, 0.4));
    cursor: pointer;
    transition: transform 0.2s;
}

.logo-text:hover {
    transform: scale(1.05);
}

.logo-text:active {
    transform: scale(0.98);
}

.header-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.role-badge {
    background: #667eea;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 18px;
}

.btn {
    padding: 12px 30px;
    font-size: 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    touch-action: manipulation;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

/* Login Screen */
.login-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    max-width: 500px;
    width: 100%;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 28px;
}

.login-logo {
    font-family: 'Pacifico', cursive;
    font-size: 48px;
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 50%, #ff6b9d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 20px;
    filter: drop-shadow(0 3px 5px rgba(196, 69, 105, 0.4));
    letter-spacing: 1px;
    line-height: 1.2;
    cursor: pointer;
    transition: transform 0.2s;
}

.login-logo:hover {
    transform: scale(1.05);
}

.login-logo:active {
    transform: scale(0.98);
}

.role-select {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.role-btn {
    flex: 1;
    min-width: 140px;
    padding: 20px 10px;
    font-size: 18px;
    border: 3px solid #ddd;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.role-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.keyboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.key {
    padding: 25px;
    font-size: 28px;
    border: none;
    background: #f3f4f6;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.key:active {
    background: #e5e7eb;
    transform: scale(0.95);
}

.password-display {
    background: #f3f4f6;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 32px;
    letter-spacing: 10px;
    margin-bottom: 20px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sizes Grid */
.sizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.size-circle {
    aspect-ratio: 1;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 5px solid transparent;
    position: relative;
}

.size-circle:active:not(.disabled) {
    transform: scale(0.95);
}

.size-circle.green {
    background: #10b981;
    border-color: #059669;
}

.size-circle.yellow {
    background: #fbbf24;
    border-color: #f59e0b;
}

.size-circle.orange {
    background: #fb923c;
    border-color: #f97316;
}

.size-circle.red {
    background: #ef4444;
    border-color: #dc2626;
    opacity: 0.5;
    cursor: not-allowed;
}

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

.size-number {
    font-size: 38px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.size-available {
    font-size: 20px;
    color: white;
    margin-top: 5px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Party indicator on size circles */
.party-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.9);
    color: #ef4444;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* RETUR Mode Toggle */
.mode-toggle {
    background: white;
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.mode-btn {
    flex: 1;
    padding: 15px 20px;
    font-size: 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    background: #f3f4f6;
    color: #666;
}

.mode-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Admin Panel */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 150px;
    padding: 15px;
    font-size: 18px;
    border: none;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

.admin-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stock-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f3f4f6;
    border-radius: 10px;
    margin-bottom: 10px;
}

.stock-item label {
    font-size: 24px;
    font-weight: bold;
    min-width: 140px;
    flex-shrink: 0;
}

.stock-item input {
    flex: 1;
    min-width: 150px;
    padding: 12px;
    font-size: 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-align: center;
}

.stock-item button {
    flex-shrink: 0;
    white-space: nowrap;
}

.password-change {
    background: #f3f4f6;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.password-change h3 {
    margin-bottom: 15px;
}

.password-input-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: stretch;
}

.password-input-wrapper input {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    font-size: 18px;
    border: 2px solid #ddd;
    border-radius: 8px;
}

.password-input-wrapper button {
    flex-shrink: 0;
    white-space: nowrap;
}

.hidden {
    display: none;
}

.message {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
}

.message.error {
    background: #fee2e2;
    color: #dc2626;
}

.message.success {
    background: #d1fae5;
    color: #059669;
}

/* Rankings styles */
.ranking-item {
    transition: transform 0.2s, box-shadow 0.2s;
}

.ranking-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}

/* Party cards */
.party-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.party-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.party-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f3f4f6;
}

.status-badge {
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
}

.party-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.party-info-row {
    padding: 10px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 16px;
}

.party-sizes {
    background: #f0fdf4;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.party-sizes h4 {
    color: #059669;
    margin-bottom: 12px;
}

.size-badge {
    background: white;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #d1fae5;
    font-size: 16px;
}

.party-notes {
    background: #fef3c7;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    color: #92400e;
}

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

.party-actions button {
    flex: 1;
    min-width: 150px;
}

/* Party creation form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 16px;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Size selection for party */
.sizes-selection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.size-selector {
    background: #f3f4f6;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.size-label {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #667eea;
    color: white;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.qty-btn:hover {
    background: #5568d3;
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-display {
    font-size: 24px;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.stock-info {
    font-size: 14px;
    color: #666;
}

/* ========== BILIARD STYLES ========== */
.billiard-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.billiard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-left {
        flex-direction: row;
        justify-content: center;
        text-align: center;
        gap: 10px;
    }
    
    .logo-text {
        font-size: 28px;
    }
    
    .login-logo {
        font-size: 36px;
    }
    
    .header-info {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .header-info button {
        width: 100%;
    }
    
    .mode-toggle {
        flex-direction: column;
    }
    
    .mode-btn {
        font-size: 16px;
        padding: 12px;
    }
    
    .sizes-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 15px;
    }
    
    .size-number {
        font-size: 28px;
    }
    
    .admin-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        font-size: 16px;
        padding: 12px;
        min-width: auto;
    }
    
    /* Rankings responsive */
    .admin-content > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    .stock-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stock-item label {
        min-width: auto;
        font-size: 20px;
    }
    
    .stock-item input {
        width: 100%;
    }
    
    .stock-item button {
        width: 100%;
    }
    
    .password-input-wrapper {
        flex-direction: column;
    }
    
    .password-input-wrapper input {
        width: 100%;
        min-width: auto;
    }
    
    .password-input-wrapper button {
        width: 100%;
    }
    
    /* Login responsive */
    .login-box {
        padding: 20px;
        margin: 10px;
    }
    
    .login-box h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .role-select {
        gap: 8px;
    }
    
    .role-btn {
        min-width: 0;
        padding: 15px 8px;
        font-size: 14px;
    }
    
    .keyboard {
        gap: 8px;
    }
    
    .key {
        padding: 20px;
        font-size: 24px;
    }
    
    .password-display {
        padding: 15px;
        font-size: 28px;
        min-height: 60px;
    }
    
    /* Party responsive */
    .party-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .status-badge {
        align-self: flex-start;
    }
    
    .party-details {
        grid-template-columns: 1fr;
    }
    
    .party-actions {
        flex-direction: column;
    }
    
    .party-actions button {
        width: 100%;
        min-width: auto;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .sizes-selection {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .size-selector {
        padding: 12px;
    }
    
    /* Biliard responsive */
    #billiard-duration-input {
        width: 100px;
    }
    
    .billiard-card {
        padding: 20px !important;
    }
    
    .billiard-card h3 {
        font-size: 22px !important;
    }
    
    .billiard-card [id^="billiard-timer-"] {
        font-size: 48px !important;
    }
}
