/* =========================================
   REBUILD DESIGN SYSTEM V6
========================================= */
:root {
    --primary: #68A02F;
    --primary-light: #8CC63F;
    --primary-bg: #F4F9F0;
    --dark: #1E4D24;
    --white: #FFFFFF;
    --glass: rgba(255, 255, 255, 0.9);
    --orange: #FF6633;
    --orange-gradient: linear-gradient(135deg, #FF6633 0%, #FF9933 100%);
    --green-gradient: linear-gradient(135deg, #68A02F 0%, #8CC63F 100%);
    --text-muted: #6B8E70;
    --shadow: 0 10px 30px rgba(30, 77, 36, 0.1);
    --radius: 20px;
    --font-main: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--primary-light);
    color: var(--dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Auth / Login Overlay */
.auth-box {
    position: fixed;
    inset: 0;
    background: var(--primary-light);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.auth-card .main-icon {
    font-size: 3.5rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.auth-card h2 {
    font-weight: 800;
    margin-bottom: 10px;
}

.auth-input {
    width: 100%;
    padding: 16px;
    border: 2px solid #E0EBD5;
    border-radius: 14px;
    font-size: 1rem;
    text-align: center;
    margin: 20px 0 15px 0;
}

.auth-btn {
    width: 100%;
    background: var(--orange);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
}

.error-msg {
    color: #FF5C39;
    font-weight: 700;
    margin-top: 15px;
    display: none;
}

/* App Header */
.app-header {
    background: var(--white);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-inner {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--primary);
}

.logo span { color: var(--dark); }

.team-badge {
    background: var(--orange);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--dark);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.4;
    transition: all 0.2s ease;
    padding: 5px;
}

.logout-btn:hover {
    opacity: 1;
    color: #FF5C39;
    transform: scale(1.1);
}

/* Hero Section */
.hero-section {
    text-align: center;
    color: white;
    padding: 60px 20px 80px 20px;
    position: relative;
    overflow: hidden;
}

.event-subtitle { font-weight: 700; opacity: 0.9; text-transform: uppercase; letter-spacing: 2px; font-size: 0.8rem; margin-bottom: 5px; }
.event-title { font-size: 3.5rem; font-weight: 900; letter-spacing: -2px; margin-bottom: 30px; line-height: 0.9; }

/* Countdown */
.countdown-row {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.time-item {
    background: rgba(30, 77, 36, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    min-width: 75px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
}

.time-item span { font-size: 1.8rem; font-weight: 800; line-height: 1; margin-bottom: 2px; }
.time-item label { font-size: 0.6rem; text-transform: uppercase; font-weight: 700; opacity: 0.7; }

/* Cards */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px 100px 20px;
}

.card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 25px;
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: var(--shadow);
    animation: slideUp 0.6s ease-out backwards;
}

.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: var(--primary);
}

.card-header h2 { font-weight: 800; font-size: 1.2rem; color: var(--dark); }

/* Rules List */
.rules-list {
    list-style: none;
    padding: 0;
}

.rules-list li {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.rules-list li i {
    color: var(--primary);
    font-size: 1.1rem;
    margin-top: 3px;
    min-width: 20px;
}

.rules-list li strong {
    color: var(--primary);
}

.del-btn-small {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 5px;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.del-btn-small:hover {
    opacity: 1;
}

/* Form Elements */
.input-group { margin-bottom: 15px; }
.input-group label { display: block; font-size: 0.85rem; font-weight: 800; margin-bottom: 6px; color: var(--primary); }
input[type="text"], select {
    width: 100%;
    padding: 14px;
    border: 1px solid #D1E0C4;
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 0.95rem;
}

.counter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 15px 0;
}

.counter {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 8px 15px;
    border-radius: 12px;
    border: 1px solid #D1E0C4;
}

.counter button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--green-gradient);
    color: white;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(104, 160, 47, 0.3);
    transition: transform 0.2s ease;
}

.counter button:active { transform: scale(0.9); }

.counter span { font-weight: 800; font-size: 1.2rem; min-width: 20px; text-align: center; }

.submit-btn {
    width: 100%;
    background: var(--orange-gradient);
    color: white;
    border: none;
    padding: 20px;
    border-radius: 16px;
    font-weight: 800;
    font-size: 1.1rem;
    margin-top: 10px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255, 102, 51, 0.3);
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 102, 51, 0.4);
}

/* Chat (Pinnwand) */
.chat-history {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-right: 5px;
}

.chat-bubble {
    background: white;
    padding: 12px 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.chat-bubble .meta { font-size: 0.75rem; font-weight: 800; color: var(--primary); display: flex; justify-content: space-between; margin-bottom: 4px; }
.chat-bubble .text { font-size: 0.9rem; }

.answer-btn {
    border: none;
    background: none;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 5px;
    padding: 0;
}

.delete-chat-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 0.75rem;
    opacity: 0.6;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
}

.delete-chat-btn:hover {
    opacity: 1;
}

.admin-reply {
    margin-top: 10px;
    margin-left: 15px;
    padding: 10px 12px;
    background: #F4F9F0;
    border-left: 3px solid var(--primary);
    border-radius: 8px;
}

.admin-reply .meta {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.admin-reply .text {
    font-size: 0.85rem;
}

.chat-input-row { display: flex; flex-direction: column; gap: 10px; }
.chat-input-row .msg-box { display: flex; gap: 8px; }
.chat-input-row .msg-box input { flex: 1; }
.chat-input-row .msg-box button { width: 50px; border: none; background: var(--orange); color: white; border-radius: 12px; cursor: pointer; }

/* Stats */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 25px;
}

.stat-box {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 15px 10px;
    border-radius: 16px;
}

.stat-box i { font-size: 1.2rem; opacity: 0.7; margin-bottom: 5px; }
.stat-box div { font-size: 1.2rem; font-weight: 800; }
.stat-box label { font-size: 0.65rem; text-transform: uppercase; font-weight: 700; opacity: 0.6; }

/* Participant List (Mockup Match) */
.participant-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.rank-label {
    font-size: 0.95rem;
    font-weight: 900;
    color: var(--dark);
    opacity: 0.8;
    min-width: 32px;
    text-align: center;
}

.team-card {
    background: var(--white);
    flex: 1;
    padding: 15px 20px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    position: relative;
    border-left: 5px solid var(--primary);
}

.team-card h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 4px; }
.team-card .details { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); display: flex; gap: 15px; margin-bottom: 10px; }
.team-card .members { display: flex; flex-wrap: wrap; gap: 6px; }
.team-card .member-pill { background: var(--primary-bg); color: var(--primary); font-size: 0.75rem; font-weight: 700; padding: 4px 12px; border-radius: 20px; }

.del-btn { position: absolute; top: 10px; right: 10px; border: none; background: none; color: #FF5C39; cursor: pointer; font-size: 0.9rem; }

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(30, 77, 36, 0.9);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active { display: flex; }

.modal-body {
    background: var(--white);
    width: 100%;
    max-width: 400px;
    border-radius: 24px;
    padding: 40px 30px;
    text-align: center;
}

.success-icon { width: 70px; height: 70px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 0 auto 20px auto; }
.ticket { background: #fef9e7; border: 2px dashed #f1c40f; border-radius: 16px; margin: 20px 0; padding: 20px; }
.ticket-header { font-size: 0.7rem; font-weight: 800; letter-spacing: 2px; color: #f39c12; margin-bottom: 10px; }
.ticket-team { font-size: 1.3rem; font-weight: 800; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; }

.btn-primary { background: var(--primary); color: white; border: none; padding: 16px; border-radius: 12px; font-weight: 800; cursor: pointer; }
.btn-outline { background: none; border: 2px solid #EEE; padding: 14px; border-radius: 12px; font-weight: 700; cursor: pointer; }

/* Footer */
.app-footer { text-align: center; padding: 40px 20px 100px 20px; }
.footer-msg { font-weight: 700; opacity: 0.5; margin-bottom: 10px; }
.pulse-dot { display: inline-block; width: 8px; height: 8px; background: var(--primary); border-radius: 50%; box-shadow: 0 0 8px var(--primary); margin-right: 6px; animation: pulse 2s infinite; }
.status-indicator { font-size: 0.75rem; font-weight: 600; opacity: 0.7; }

.diag-btn { margin-top: 30px; background: none; border: 1px dashed rgba(0,0,0,0.2); color: rgba(0,0,0,0.4); padding: 8px 15px; border-radius: 8px; font-size: 0.7rem; cursor: pointer; font-weight: 700; }

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    70% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.7; }
}

@media print {
    body * { visibility: hidden; }
    #modal-success, #modal-success * { visibility: visible; }
    #modal-success { position: absolute; left: 0; top: 0; background: white; }
    .btn-primary, .btn-outline { display: none; }
}
