/* ── CC Tournament Public CSS ────────────────────────────────────────────── */

:root {
    --cc-primary:   #9b2335;
    --cc-gold:      #d97706;
    --cc-silver:    #94a3b8;
    --cc-bronze:    #92400e;
    --cc-win:       #16a34a;
    --cc-loss:      #dc2626;
    --cc-gray-50:   #f9fafb;
    --cc-gray-100:  #f3f4f6;
    --cc-gray-200:  #e5e7eb;
    --cc-gray-300:  #d1d5db;
    --cc-gray-400:  #9ca3af;
    --cc-gray-600:  #4b5563;
    --cc-gray-800:  #1f2937;
    --cc-radius:    8px;
}

/* ── Basis-Reset für CC-Elemente ─────────────────────────────────────────── */

.cc-shortcode * { box-sizing: border-box; }
.cc-shortcode {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    color: var(--cc-gray-800);
    line-height: 1.5;
}

/* ── Tabellen ────────────────────────────────────────────────────────────── */

.cc-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--cc-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.cc-table thead th {
    background: var(--cc-primary);
    color: white;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 10px 12px;
    text-align: left;
}

.cc-table tbody tr:nth-child(even) { background: var(--cc-gray-50); }
.cc-table tbody td { padding: 9px 12px; border-bottom: 1px solid var(--cc-gray-100); }
.cc-table tbody tr:last-child td { border-bottom: none; }

/* ── Rangplatz-Badges ────────────────────────────────────────────────────── */

.cc-rang-1 { color: var(--cc-gold);   font-weight: 800; }
.cc-rang-2 { color: var(--cc-silver); font-weight: 700; }
.cc-rang-3 { color: var(--cc-bronze); font-weight: 700; }

/* ── Ergebnis-Chips ──────────────────────────────────────────────────────── */

.cc-score-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-size: 14px;
}

.cc-score-win  { color: var(--cc-win); }
.cc-score-loss { color: var(--cc-loss); }

/* ── Ladeindikator ───────────────────────────────────────────────────────── */

.cc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    color: var(--cc-gray-600);
    font-size: 14px;
}

.cc-spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--cc-gray-200);
    border-top-color: var(--cc-primary);
    border-radius: 50%;
    animation: cc-spin .6s linear infinite;
}

@keyframes cc-spin { to { transform: rotate(360deg); } }

/* ── Anmelde-Formular ────────────────────────────────────────────────────── */

.cc-anmeldung-form {
    background: white;
    border: 1px solid var(--cc-gray-200);
    border-radius: var(--cc-radius);
    padding: 24px;
    max-width: 520px;
}

.cc-field { margin-bottom: 16px; }
.cc-field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.cc-field input,
.cc-field select,
.cc-field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--cc-gray-200);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color .15s;
}
.cc-field input:focus,
.cc-field select:focus { border-color: var(--cc-primary); outline: none; }

.cc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}

.cc-btn-primary { background: var(--cc-primary); color: white; }
.cc-btn-primary:hover { background: #7a1c29; }
.cc-btn-secondary { background: var(--cc-gray-100); color: var(--cc-gray-800); }
.cc-btn-secondary:hover { background: var(--cc-gray-200); }

/* ── Anmeldungs-Header ───────────────────────────────────────────────────── */

.cc-anm-header {
    background: linear-gradient(135deg, #7a1c29 0%, #9b2335 100%);
    color: white;
    border-radius: var(--cc-radius);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.cc-anm-header-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.cc-anm-icon { font-size: 32px; line-height: 1; }
.cc-anm-title { margin: 0 0 4px; font-size: 22px; font-weight: 900; color: white; }

.cc-anm-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    opacity: .85;
}

.cc-anm-capacity {}

.cc-anm-cap-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 5px;
    opacity: .85;
}

.cc-cap-bar {
    background: rgba(255,255,255,.2);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.cc-cap-fill {
    height: 100%;
    background: white;
    border-radius: 4px;
    transition: width .4s ease;
}

.cc-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
}

.cc-badge-ok      { background: #dcfce7; color: #166534; }
.cc-badge-warn    { background: #fef3c7; color: #92400e; }
.cc-badge-warning { background: #fef9c3; color: #854d0e; }
.cc-badge-err     { background: #fee2e2; color: #991b1b; }
.cc-badge-danger  { background: #fee2e2; color: #991b1b; }
.cc-badge-info    { background: #dbeafe; color: #1e40af; }
.cc-badge-gray    { background: #f3f4f6; color: #6b7280; }

/* ── Turnier-Landing (cc_turnierübersicht) ───────────────────────────────── */

.cc-turnier-landing { padding: 4px 0; }

.cc-landing-section-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--cc-gray-400, #9ca3af);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cc-landing-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}
.cc-landing-section-label--past { margin-top: 28px; }

.cc-turnier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    margin-bottom: 8px;
}

a.cc-turnier-card,
.cc-turnier-card {
    position: relative;
    display: block !important;
    text-decoration: none !important;
    color: inherit !important;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 36px 14px 18px;
    background: #fff;
    transition: box-shadow .15s, border-color .15s;
    border-left: 3px solid #e5e7eb;
}
a.cc-turnier-card:hover,
.cc-turnier-card:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,.08);
    border-color: #d1d5db;
    text-decoration: none !important;
}
a.cc-turnier-card--green,  .cc-turnier-card--green  { border-left-color: #16a34a; }
a.cc-turnier-card--blue,   .cc-turnier-card--blue   { border-left-color: #1e40af; }
a.cc-turnier-card--amber,  .cc-turnier-card--amber  { border-left-color: #d97706; }
a.cc-turnier-card--gray,   .cc-turnier-card--gray   { border-left-color: #9ca3af; }

.cc-turnier-card__name {
    font-weight: 700;
    font-size: 15px;
    color: #111;
    margin-bottom: 3px;
}
.cc-turnier-card__meta {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 10px;
}
.cc-turnier-card__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}
.cc-turnier-card__arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: #9ca3af;
    line-height: 1;
}

/* Vergangene Turniere als Tabelle */
.cc-turnier-past-table { margin-top: 0; }
.cc-turnier-past-name  { font-weight: 600; font-size: 13px; }
.cc-turnier-past-cell  { font-size: 12px; color: #6b7280; }
.cc-turnier-past-row:hover td { background: #f9fafb; }

.cc-empty-msg {
    color: var(--cc-gray-400, #9ca3af);
    padding: 20px 0;
    text-align: center;
}

/* ── Notices ─────────────────────────────────────────────────────────────── */

.cc-notice {
    padding: 12px 16px;
    border-radius: var(--cc-radius);
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.cc-notice-ok   { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.cc-notice-warn { background: #fefce8; border: 1px solid #fef08a; color: #713f12; }
.cc-notice-err  { background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239; }

/* ── Anmelde-Formular ────────────────────────────────────────────────────── */

.cc-anm-form { }

.cc-anm-fieldset {
    border: 1px solid var(--cc-gray-200);
    border-radius: var(--cc-radius);
    padding: 16px 20px;
    margin-bottom: 16px;
    background: white;
}

.cc-anm-legend {
    font-weight: 700;
    font-size: 14px;
    color: var(--cc-gray-800);
    padding: 0 6px;
}

.cc-anm-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.cc-anm-row:last-child { margin-bottom: 0; }

@media (min-width: 540px) {
    .cc-anm-row-2 { flex-direction: row; }
    .cc-anm-row-2 .cc-field { flex: 1; }
}

.cc-field-grow { flex: 1; }

.cc-field { display: flex; flex-direction: column; }
.cc-field label { font-weight: 600; font-size: 13px; margin-bottom: 4px; color: var(--cc-gray-800); }
.cc-field input,
.cc-field select,
.cc-field textarea {
    padding: 9px 12px;
    border: 1px solid var(--cc-gray-200);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
    background: white;
}
.cc-field input:focus,
.cc-field select:focus,
.cc-field textarea:focus {
    border-color: var(--cc-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(155,35,53,.12);
}

.cc-field-check { flex-direction: row; align-items: center; }
.cc-field-check label { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.cc-field-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--cc-primary); }

.cc-req { color: var(--cc-primary); }

.cc-anm-submit-row { margin-top: 20px; }

.cc-btn-lg { padding: 12px 28px; font-size: 16px; }

.cc-anm-legal {
    margin-top: 10px;
    font-size: 11px;
    color: var(--cc-gray-400);
    line-height: 1.5;
}

/* ── Team-Info Karte ─────────────────────────────────────────────────────── */

.cc-ti-tournament {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--cc-primary);
    color: white;
    border-radius: var(--cc-radius);
    padding: 14px 20px;
    margin-bottom: 16px;
}

.cc-ti-tourn-icon { font-size: 28px; }
.cc-ti-tourn-name { font-size: 17px; font-weight: 800; }
.cc-ti-tourn-meta { font-size: 12px; opacity: .8; margin-top: 2px; }

.cc-ti-status-wrap { margin-bottom: 16px; }
.cc-ti-status-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 700;
}

.cc-ti-waitpos { margin-top: 6px; font-size: 13px; color: #7e22ce; }

.cc-ti-card {
    background: white;
    border: 1px solid var(--cc-gray-200);
    border-radius: var(--cc-radius);
    padding: 20px 24px;
    margin-bottom: 16px;
    position: relative;
}

.cc-ti-start-nr {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 36px;
    font-weight: 900;
    color: var(--cc-primary);
    opacity: .15;
    line-height: 1;
}

.cc-ti-team-name { font-size: 20px; font-weight: 800; color: var(--cc-gray-800); }
.cc-ti-sub { color: var(--cc-gray-400); font-size: 14px; margin-top: 2px; }

.cc-ti-meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--cc-gray-100);
}

.cc-ti-meta-item { display: flex; flex-direction: column; gap: 2px; }
.cc-ti-meta-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--cc-gray-400); }
.cc-ti-pin {
    font-family: monospace;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: .25em;
    color: var(--cc-primary);
}

.cc-ti-qr-section { text-align: center; margin-bottom: 16px; }
.cc-ti-qr-hint { font-size: 12px; color: var(--cc-gray-400); margin-bottom: 8px; }
.cc-ti-qr-wrap { display: inline-block; }
.cc-ti-token-small { font-size: 10px; color: var(--cc-gray-400); margin-top: 4px; font-family: monospace; }

.cc-ti-footer { text-align: center; padding-top: 8px; }
.cc-ti-withdraw-link { font-size: 12px; color: var(--cc-gray-400); text-decoration: underline; cursor: pointer; }
.cc-ti-withdraw-link:hover { color: var(--cc-loss); }

/* ── Terminal (Vollbild) ─────────────────────────────────────────────────── */

.cc-terminal-root {
    min-height: 100vh;
    background: #0f172a;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Beamer (Vollbild, TV-Ausgabe) ───────────────────────────────────────── */

.cc-beamer-root {
    min-height: 100vh;
    background: #0f172a;
    color: white;
    padding: 32px;
    font-size: 20px;
}

.cc-beamer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: 28px;
    font-weight: 800;
}

.cc-beamer-logo { color: var(--cc-primary); }


/* ── Teilnehmerliste ─────────────────────────────────────── */
.cc-partlist { margin-top: 28px; }
.cc-partlist-sc { }
.cc-partlist-hdr {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700; color: var(--cc-gray-800);
  margin-bottom: 10px;
}
.cc-partlist-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.cc-partlist-table th {
  text-align: left; padding: 7px 10px; background: #f3f4f6;
  border-bottom: 2px solid #e5e7eb; font-weight: 700; color: var(--cc-gray-700);
}
.cc-partlist-table th.sortable { cursor: pointer; user-select: none; }
.cc-partlist-table th.sortable:hover { background: #e5e7eb; }
.cc-partlist-table td {
  padding: 6px 10px; border-bottom: 1px solid #f3f4f6; color: var(--cc-gray-700);
}
.cc-partlist-table tbody tr:hover { background: #f9fafb; }
