@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Outfit:wght@400;500;600&display=swap');

:root {
    --bg:        #15161a;
    --bg-soft:   #1c1d23;
    --surface:   #23242b;
    --surface-2: #2d2e37;
    --border:    #3a3b45;
    --text:      #f2f3f5;
    --text-dim:  #9499a6;

    --accent:    #e63946;   /* leuchtendes Rot */
    --accent-2:  #b0b3bd;   /* helles Grau als zweite Akzentfarbe */
    --accent-3:  #ff8a80;   /* helles Rot/Korall für Punkte */
    --danger:    #ff5577;
    --success:   #4caf6d;

    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;
    --radius-pill: 999px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(circle at 15% 0%, rgba(230,57,70,.14), transparent 40%),
        radial-gradient(circle at 85% 25%, rgba(255,255,255,.05), transparent 45%);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

a { color: var(--accent-3); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent); }

/* NAV */
nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 2rem; background: rgba(35, 36, 43, .75);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 10;
}
nav .logo {
    font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; font-weight: 700;
    color: var(--text); letter-spacing: .5px; display: flex; align-items: center; gap: .4rem;
}
nav .logo::before {
    content: ''; display: inline-block; width: .6rem; height: .6rem;
    border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}
nav div { display: flex; gap: 1rem; align-items: center; }
nav a:not(.btn) {
    color: var(--text-dim); font-size: .85rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px;
    padding: .5rem .9rem; border-radius: var(--radius-pill);
    border: 1px solid transparent; transition: all .15s ease;
}
nav a:not(.btn):hover {
    color: var(--text); border-color: var(--border); background: var(--surface-2);
    text-decoration: none;
}

/* CONTAINER & GRID */
.container { max-width: 1100px; margin: 2rem auto; padding: 0 1.25rem 3rem; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 700px) { .grid { grid-template-columns: 1fr; } }

/* CARD */
.card {
    background: linear-gradient(160deg, var(--surface), var(--bg-soft));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: 0 10px 30px -15px rgba(0,0,0,.7);
    position: relative;
}
.card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; gap: 1rem; flex-wrap: wrap; }
.card h2 {
    font-family: 'Space Grotesk', sans-serif; font-size: 1.15rem; color: var(--text);
    letter-spacing: .3px;
}

/* AUTH BOX */
.auth-box {
    max-width: 440px; margin: 6rem auto;
    background: linear-gradient(160deg, var(--surface), var(--bg-soft));
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 2.75rem; text-align: center;
    box-shadow: 0 20px 50px -20px rgba(0,0,0,.8);
    position: relative; overflow: hidden;
}
.auth-box::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px;
    background: linear-gradient(90deg, var(--accent), var(--accent-3), var(--accent-2));
}
.auth-box h1 {
    font-family: 'Space Grotesk', sans-serif; font-size: 2.2rem; font-weight: 700;
    background: linear-gradient(90deg, var(--accent), var(--accent-3));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    margin-bottom: .25rem; letter-spacing: 1px;
}
.auth-box h2 { margin-bottom: 1.75rem; color: var(--text); font-family: 'Space Grotesk', sans-serif; font-weight: 700; }
.auth-box form { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.25rem; }
.auth-box > a { display: inline-block; margin-top: .5rem; font-weight: 600; }

/* INPUTS */
input, textarea, select {
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); padding: .85rem 1.1rem; font-size: .95rem; width: 100%;
    font-family: inherit; transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(230,57,70,.18);
}

/* BUTTONS */
.btn {
    background: linear-gradient(135deg, var(--accent), #b3242f);
    color: #fff; border: none; border-radius: var(--radius-pill);
    padding: .8rem 1.6rem; font-size: .9rem; font-weight: 700;
    cursor: pointer; display: inline-block; text-transform: uppercase; letter-spacing: .5px;
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
    box-shadow: 0 6px 18px -8px rgba(230,57,70,.7);
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(0); }

.btn-secondary {
    background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
    box-shadow: none;
}
.btn-secondary:hover { background: var(--border); color: var(--text); }

/* LIST ITEMS */
.list-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: .9rem 1.2rem; border-radius: var(--radius-md); margin-bottom: .6rem;
    background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
    transition: border-color .15s ease, transform .1s ease;
}
.list-item:hover { border-color: var(--accent); transform: translateX(2px); text-decoration: none; }
.list-item span { font-size: .8rem; color: var(--text-dim); }

/* BADGES */
.badge {
    padding: .3rem .8rem; border-radius: var(--radius-pill); font-size: .7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px; border: 1px solid transparent;
}
.badge.open      { background: rgba(76,175,109,.12); color: var(--success); border-color: rgba(76,175,109,.35); }
.badge.resolved  { background: rgba(176,179,189,.12); color: var(--accent-2); border-color: rgba(176,179,189,.35); }
.badge.cancelled { background: rgba(255,85,119,.12); color: var(--danger); border-color: rgba(255,85,119,.35); }

/* POINTS */
.points-badge {
    background: linear-gradient(135deg, rgba(230,57,70,.18), rgba(255,138,128,.12));
    border: 1px solid rgba(255,138,128,.35);
    padding: .5rem 1.1rem; border-radius: var(--radius-pill);
    font-size: .9rem; font-weight: 700; color: var(--accent-3);
    font-family: 'Space Grotesk', sans-serif;
}

/* INVITE CODE */
.invite-code {
    background: var(--surface-2); border: 1px dashed var(--border);
    padding: .5rem 1rem; border-radius: var(--radius-sm);
    font-family: 'Space Grotesk', monospace; font-size: .95rem; color: var(--accent-3);
    letter-spacing: 2px; font-weight: 700;
}

/* BET STATS */
.bet-stats { display: flex; gap: 1rem; margin-top: 1.25rem; }
.stat {
    flex: 1; padding: .9rem 1.1rem; border-radius: var(--radius-md); font-size: .9rem;
    font-weight: 600; border: 1px solid transparent;
}
.stat.for     { background: rgba(76,175,109,.1);  color: var(--success); border-color: rgba(76,175,109,.3); }
.stat.against { background: rgba(255,85,119,.1);  color: var(--danger);  border-color: rgba(255,85,119,.3); }

/* PREDICTION BUTTONS */
.prediction-buttons { display: flex; gap: 1rem; margin-bottom: .75rem; }
.prediction-buttons label {
    flex: 1; display: flex; align-items: center; gap: .5rem;
    padding: 1rem; background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: var(--radius-md); cursor: pointer; font-weight: 600;
    transition: all .15s ease;
}
.prediction-buttons label:hover { border-color: var(--accent); background: var(--surface-2); }
.prediction-buttons input[type="radio"] { width: auto; accent-color: var(--accent); }

/* BETS LIST */
.bet-item {
    padding: 1.1rem 1.25rem; border-radius: var(--radius-md); margin-bottom: .75rem;
    border: 1px solid var(--border); border-left: 4px solid;
    background: var(--bg-soft);
}
.bet-item.for     { border-left-color: var(--success); }
.bet-item.against { border-left-color: var(--danger); }
.bet-header { display: flex; justify-content: space-between; margin-bottom: .5rem; font-size: .9rem; gap: .75rem; }

/* LEADERBOARD */
.leaderboard { list-style: none; }
.leaderboard li {
    display: flex; justify-content: space-between; align-items: center;
    padding: .7rem .85rem; border-radius: var(--radius-sm); margin-bottom: .4rem;
    background: var(--bg-soft); border: 1px solid var(--border);
}
.leaderboard li.me {
    color: var(--accent-3); font-weight: 700;
    border-color: rgba(255,138,128,.4); background: rgba(230,57,70,.08);
}
.diff-pos { color: var(--success); font-weight: 700; }
.diff-neg { color: var(--danger); font-weight: 700; }

/* MÜNZWURF */
.flip-result {
    padding: 1rem 1.2rem; border-radius: var(--radius-md); margin-bottom: 1rem;
    border: 1px solid var(--border);
}
.flip-result.win  { background: rgba(76,175,109,.1);  border-color: rgba(76,175,109,.3); }
.flip-result.lose { background: rgba(255,85,119,.1);  border-color: rgba(255,85,119,.3); }
.flip-result .meta { margin-top: .5rem; margin-bottom: 0; }

/* MÜNZWURF ANIMATION */
.coin-flip-anim {
    display: flex; justify-content: center; align-items: center;
    padding: 1.5rem 0; perspective: 600px;
}
.coin {
    width: 90px; height: 90px; border-radius: 50%; position: relative;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.1rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
    color: #fff; box-shadow: 0 10px 30px -10px rgba(230,57,70,.6);
    animation: coinFlip 1.1s ease-out;
    transform-style: preserve-3d;
}
.coin-face { position: absolute; }
.coin-kopf .coin-back, .coin-zahl .coin-front { display: none; }
@keyframes coinFlip {
    0%   { transform: rotateY(0deg) translateY(-40px); }
    60%  { transform: rotateY(1080deg) translateY(0); }
    100% { transform: rotateY(1440deg) translateY(0); }
}
.flip-result-text {
    text-align: center; padding: 1rem 1.2rem; border-radius: var(--radius-md);
    margin-bottom: .75rem; border: 1px solid var(--border);
    animation: fadeIn .6s ease-out .9s both;
    opacity: 0;
}
.flip-result-text.win  { background: rgba(76,175,109,.1);  border-color: rgba(76,175,109,.3); color: var(--success); font-weight: 700; }
.flip-result-text.lose { background: rgba(255,85,119,.1); border-color: rgba(255,85,119,.3); color: var(--danger);  font-weight: 700; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* INFO ICON / TOOLTIP */
.info-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.2rem; height: 1.2rem; border-radius: 50%;
    background: var(--accent); color: #fff;
    font-size: .7rem; font-weight: 700; font-style: italic;
    font-family: 'Space Grotesk', sans-serif;
    cursor: help; position: relative; vertical-align: middle;
    margin-left: .4rem;
}
.info-tooltip {
    display: none; position: absolute; top: 140%; left: 0; z-index: 20;
    width: 260px; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: .75rem 1rem;
    font-size: .8rem; font-weight: 400; font-style: normal; text-transform: none;
    letter-spacing: normal; color: var(--text-dim);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,.7);
}
.info-icon:hover .info-tooltip,
.info-icon:focus .info-tooltip { display: block; }

/* MISC */
.error {
    color: var(--danger); background: rgba(255,85,119,.1);
    border: 1px solid rgba(255,85,119,.3);
    padding: .85rem 1rem; border-radius: var(--radius-md); margin-bottom: 1rem; font-size: .9rem;
}
.empty { color: var(--text-dim); font-size: .9rem; padding: .5rem 0; }
.meta  { color: var(--text-dim); font-size: .85rem; margin-bottom: .5rem; }
blockquote {
    border-left: 3px solid var(--accent); padding: .5rem 0 .5rem 1rem;
    color: var(--text-dim); margin-top: .5rem; font-style: italic;
}
h1 {
    font-family: 'Space Grotesk', sans-serif; font-size: 1.8rem; font-weight: 700;
    color: var(--text); margin-bottom: 1rem; letter-spacing: .3px;
}
.my-bet { border-color: var(--accent); }

/* CHAT */
.chat-box {
    max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem;
    margin-bottom: 1rem; padding-right: .25rem;
}
.chat-message {
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: .65rem .9rem; max-width: 80%;
}
.chat-message.me {
    align-self: flex-end; border-color: rgba(230,57,70,.4); background: rgba(230,57,70,.08);
}
.chat-meta {
    display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .25rem;
    font-size: .75rem; color: var(--text-dim);
}
.chat-meta strong { color: var(--text); }
.chat-message p { font-size: .9rem; word-break: break-word; }
.chat-form { display: flex; gap: .75rem; }
.chat-form input[type="text"] { flex: 1; }
label { color: var(--text-dim); font-size: .85rem; font-weight: 600; display: block; margin-bottom: .35rem; margin-top: .5rem; text-transform: uppercase; letter-spacing: .5px; }

/* MOBILE */
@media (max-width: 700px) {
    nav {
        flex-direction: column; align-items: flex-start;
        gap: .6rem; padding: .75rem 1rem;
    }
    nav div { flex-wrap: wrap; gap: .4rem; }
    nav a:not(.btn) { font-size: .78rem; padding: .4rem .6rem; }
    .points-badge { font-size: .8rem; padding: .4rem .8rem; }

    .container { padding: 0 .75rem 2rem; margin-top: 1rem; }
    h1 { font-size: 1.4rem; }

    .card { padding: 1.25rem; border-radius: 18px; }
    .card h2 { font-size: 1rem; }

    .bet-stats { flex-direction: column; gap: .5rem; }
    .prediction-buttons { flex-direction: column; }

    .auth-box { margin: 2rem auto; padding: 1.75rem 1.25rem; border-radius: 18px; }

    .chat-form { flex-direction: column; }
    .chat-form input[type="text"] { width: 100%; }
    .chat-message { max-width: 95%; }

    .card-header { flex-direction: column; align-items: flex-start; gap: .5rem; }
    .card-header > div { display: flex; flex-wrap: wrap; gap: .4rem; }

    .list-item { flex-direction: column; align-items: flex-start; gap: .25rem; }
    .list-item span { font-size: .85rem; }

    .invite-code { font-size: .8rem; letter-spacing: 1px; }
}
