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

:root{
    --bg: #050505;
    --bg-soft: #0d0d0f;
    --panel: rgba(10, 10, 14, 0.90);
    --panel-border: rgba(255, 60, 92, 0.18);
    --text: #f5f7fa;
    --muted: #a9a9b3;
    --red: #ff334f;
    --red-strong: #ff1738;
    --red-soft: rgba(255, 51, 79, 0.10);
    --line: rgba(255,255,255,0.08);
    --glow: 0 0 20px rgba(255, 51, 79, 0.30), 0 0 40px rgba(255, 51, 79, 0.12);
    --glow-strong: 0 0 24px rgba(255, 51, 79, 0.55), 0 0 65px rgba(255, 51, 79, 0.22);
    --shadow-soft: 0 8px 24px rgba(0,0,0,0.22);
    --shadow-panel: 0 18px 50px rgba(0,0,0,0.28);
}

*{
    box-sizing: border-box;
}

html{
    scroll-behavior: smooth;
}

body{
    margin: 0;
    color: var(--text);
    font-family: 'Rajdhani', Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255,40,70,0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(255,40,70,0.06), transparent 20%),
        linear-gradient(180deg, #020202 0%, #050505 45%, #080808 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

a{
    color: inherit;
    text-decoration: none;
}

.bg-grid{
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, rgba(255,255,255,0.55), transparent 85%);
    pointer-events: none;
    z-index: 0;
}

.bg-glow{
    position: fixed;
    border-radius: 999px;
    filter: blur(90px);
    opacity: 0.22;
    pointer-events: none;
    z-index: 0;
}

.bg-glow-1{
    width: 340px;
    height: 340px;
    background: var(--red);
    top: 60px;
    left: -80px;
}

.bg-glow-2{
    width: 300px;
    height: 300px;
    background: #ffffff;
    right: -80px;
    top: 160px;
    opacity: 0.06;
}

.hero,
.content,
.footer,
.auth-wrap{
    position: relative;
    z-index: 1;
}

.hero{
    padding: 26px 20px 18px;
}

.hero-inner{
    max-width: 1180px;
    margin: 0 auto;
    text-align: center;
}

.logo-wrap{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 1px solid rgba(255, 51, 79, 0.20);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    box-shadow: var(--glow);
    animation: pulseGlow 3.2s ease-in-out infinite;
}

.logo{
    width: 180px;
    max-width: 100%;
    display: block;
    border-radius: 18px;
    box-shadow:
        0 0 18px rgba(255, 35, 65, 0.25),
        0 0 44px rgba(255, 35, 65, 0.12);
}

h1{
    margin: 16px 0 10px;
    font-size: clamp(42px, 7vw, 84px);
    line-height: 0.95;
    color: var(--red);
    text-shadow:
        0 0 18px rgba(255, 51, 79, 0.24),
        0 0 34px rgba(255, 51, 79, 0.12);
}

.hero-text{
    max-width: 760px;
    margin: 0 auto;
    font-size: clamp(20px, 2.5vw, 28px);
    line-height: 1.35;
    color: #ededf2;
}

.hero-actions{
    margin-top: 24px;
}

.hero-button,
.button{
    display: inline-block;
    padding: 14px 22px;
    border-radius: 14px;
    background: linear-gradient(180deg, #ff445f 0%, #d61534 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 20px;
    font-weight: 700;
    box-shadow: var(--glow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, border-color 0.18s ease;
}

.hero-button:hover,
.button:hover{
    transform: translateY(-2px);
    box-shadow: var(--glow-strong);
    filter: brightness(1.04);
}

.button-secondary{
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: none;
}

.button-secondary:hover{
    border-color: rgba(255, 51, 79, 0.28);
}

.hero-info{
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 260px));
    justify-content: center;
    gap: 14px;
}

.info-card{
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(8px);
}

.info-label{
    display: block;
    font-size: 14px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}

.info-value{
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.content,
.auth-wrap{
    max-width: 1320px;
    margin: 0 auto;
    padding: 18px 20px 50px;
}

.panel,
.auth-panel{
    border: 1px solid var(--panel-border);
    border-radius: 26px;
    background: var(--panel);
    box-shadow:
        var(--shadow-panel),
        0 0 0 1px rgba(255,255,255,0.015) inset;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.panel-head,
.auth-panel-head{
    padding: 26px 26px 10px;
}

.panel-head h2,
.auth-panel-head h2{
    margin: 0;
    font-size: clamp(30px, 4vw, 46px);
    color: white;
}

.panel-head p,
.auth-panel-head p{
    margin: 8px 0 0;
    font-size: 21px;
    color: var(--muted);
}

.controls,
.form-grid{
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 16px;
    padding: 18px 26px 24px;
}

.form-grid.admin{
    grid-template-columns: repeat(4, 1fr) auto;
    align-items: end;
}

.input-group{
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label{
    font-size: 15px;
    font-weight: 700;
    color: #d7d7df;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

input,
select{
    width: 100%;
    min-height: 56px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(10,10,12,0.94);
    color: white;
    font-family: inherit;
    font-size: 21px;
    padding: 0 16px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

input::placeholder{
    color: #7f7f89;
}

input:focus,
select:focus{
    border-color: rgba(255, 51, 79, 0.55);
    box-shadow: 0 0 0 4px rgba(255, 51, 79, 0.12), var(--glow);
    transform: translateY(-1px);
}

.table-wrap{
    width: 100%;
    overflow-x: auto;
    padding: 0 0 12px;
}

table{
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 760px;
}

thead th{
    background: linear-gradient(180deg, #ff435d 0%, #e82241 100%);
    color: white;
    padding: 18px 16px;
    text-align: left;
    font-size: 22px;
    white-space: nowrap;
}

tbody td{
    padding: 18px 16px;
    font-size: 22px;
    border-bottom: 1px solid var(--line);
    color: #f6f6f8;
}

tbody tr{
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

tbody tr:hover{
    background: linear-gradient(90deg, rgba(255, 51, 79, 0.13), rgba(255,255,255,0.02));
    box-shadow: inset 4px 0 0 rgba(255, 51, 79, 0.9), 0 0 24px rgba(255, 51, 79, 0.12);
}

.empty-state,
.message{
    margin: 0 26px 26px;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    text-align: center;
    font-size: 22px;
    color: var(--muted);
}

.message.success{
    border-color: rgba(0, 255, 128, 0.25);
    color: #d8ffe9;
}

.message.error{
    border-color: rgba(255, 51, 79, 0.35);
    color: #ffd2d9;
}

.hidden{
    display: none;
}

.admin-topbar{
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 18px 26px 0;
}

.admin-actions{
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

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

.small-btn{
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 18px;
    cursor: pointer;
    color: white;
    background: rgba(255,255,255,0.06);
    transition: background 0.18s ease, transform 0.18s ease;
}

.small-btn:hover{
    transform: translateY(-1px);
    background: rgba(255,255,255,0.10);
}

.small-btn.delete{
    background: rgba(255, 51, 79, 0.18);
}

.small-btn.delete:hover{
    background: rgba(255, 51, 79, 0.28);
}

.footer{
    padding: 12px 20px 26px;
    text-align: center;
    color: #83838f;
    font-size: 18px;
}

.footer-link{
    color: #ff8b9c;
}

.auth-wrap{
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.auth-panel{
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

.auth-form{
    padding: 0 26px 26px;
    display: grid;
    gap: 16px;
}

/* Öffentliche Übersicht – gruppiert nach Regelbruch */

.grouped-list{
    display: grid;
    gap: 18px;
    padding: 0 26px 26px;
}

.rule-group-card{
    border: 1px solid rgba(255, 51, 79, 0.18);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(20,20,24,0.96), rgba(10,10,12,0.96));
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.rule-group-card:hover{
    border-color: rgba(255, 51, 79, 0.30);
    box-shadow: 0 0 24px rgba(255, 51, 79, 0.10), var(--shadow-soft);
    transform: translateY(-1px);
}

.rule-group-head{
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}

.sanction-icon{
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: rgba(255, 51, 79, 0.10);
    border: 1px solid rgba(255, 51, 79, 0.18);
    box-shadow: 0 0 18px rgba(255, 51, 79, 0.10);
    flex-shrink: 0;
}

.rule-group-title{
    font-size: 30px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.rule-group-subtitle{
    font-size: 17px;
    color: #a9a9b3;
    margin-top: 4px;
}

.rule-group-body{
    display: grid;
}

.rule-row{
    display: grid;
    grid-template-columns: 180px 1fr 1fr;
    gap: 14px;
    align-items: stretch;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.rule-row:first-child{
    border-top: none;
}

.rule-row-stage,
.rule-row-min,
.rule-row-max{
    border-radius: 14px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    min-height: 86px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stage-badge{
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 51, 79, 0.12);
    border: 1px solid rgba(255, 51, 79, 0.18);
    color: #ffb5c0;
    font-size: 17px;
    font-weight: 700;
    width: fit-content;
}

.row-label{
    display: block;
    font-size: 13px;
    text-transform: uppercase;
    color: #a9a9b3;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.row-value{
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
}

/* Audit / Historie */

.audit-list{
    padding: 0 26px 26px;
    display: grid;
    gap: 12px;
}

.audit-entry{
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
    padding: 16px;
}

.audit-entry-top{
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.audit-user{
    font-size: 18px;
    font-weight: 700;
    color: #ff92a2;
}

.audit-time{
    font-size: 16px;
    color: #a9a9b3;
}

.audit-action{
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.audit-details{
    font-size: 18px;
    color: #d7d7df;
    line-height: 1.35;
}

@keyframes pulseGlow{
    0%,100%{
        box-shadow: 0 0 18px rgba(255, 51, 79, 0.24), 0 0 34px rgba(255, 51, 79, 0.10);
    }
    50%{
        box-shadow: 0 0 28px rgba(255, 51, 79, 0.48), 0 0 62px rgba(255, 51, 79, 0.18);
    }
}

@media (max-width: 980px){
    .controls,
    .form-grid,
    .form-grid.admin{
        grid-template-columns: 1fr;
    }

    .hero-info{
        grid-template-columns: 1fr;
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }

    .admin-topbar{
        flex-direction: column;
        align-items: stretch;
    }

    .rule-row{
        grid-template-columns: 1fr;
    }
}

.small-btn[disabled]{
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
}

.row-actions{
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

@media (max-width: 640px){
    .hero{
        padding: 24px 14px 12px;
    }

    .content,
    .auth-wrap{
        padding: 10px 12px 32px;
    }

    .logo{
        width: 150px;
    }

    h1{
        font-size: clamp(34px, 10vw, 56px);
    }

    .hero-text{
        font-size: 19px;
    }

    .hero-button,
    .button{
        width: 100%;
    }

    .panel,
    .auth-panel{
        border-radius: 18px;
    }

    .panel-head,
    .auth-panel-head{
        padding: 20px 16px 8px;
    }

    .controls,
    .form-grid,
    .auth-form{
        padding: 14px 16px 18px;
        gap: 12px;
    }

    table{
        min-width: 640px;
    }

    thead th,
    tbody td{
        padding: 15px 12px;
        font-size: 18px;
    }

    .grouped-list,
    .audit-list{
        padding: 0 16px 16px;
    }

    .rule-group-head{
        padding: 16px;
    }

    .rule-group-title{
        font-size: 24px;
    }

    .rule-group-subtitle{
        font-size: 15px;
    }

    .rule-row{
        padding: 14px 16px;
    }

    .row-value{
        font-size: 20px;
    }

    .audit-action{
        font-size: 20px;
    }

    .audit-details{
        font-size: 17px;
    }

    .footer{
        font-size: 16px;
    }
}

.logo-link{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.hero-home{
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.home-button-grid{
    margin-top: 34px;
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 420px));
    gap: 18px;
    justify-content: center;
}

.home-panel-button{
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 26px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(20,20,24,0.96), rgba(10,10,12,0.96));
    border: 1px solid rgba(255, 51, 79, 0.18);
    box-shadow: 0 8px 24px rgba(0,0,0,0.22);
    color: white;
    text-decoration: none;
    text-align: left;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.home-panel-button:hover{
    transform: translateY(-2px);
    border-color: rgba(255, 51, 79, 0.34);
    box-shadow:
        0 0 24px rgba(255, 51, 79, 0.12),
        0 8px 24px rgba(0,0,0,0.22);
}

.home-panel-title{
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}

.home-panel-subtitle{
    font-size: 20px;
    line-height: 1.3;
    color: #b8bcc6;
}

@media (max-width: 760px){
    .home-button-grid{
        grid-template-columns: 1fr;
    }

    .home-panel-title{
        font-size: 28px;
    }

    .home-panel-subtitle{
        font-size: 18px;
    }
}

.page-topbar{
    max-width: 1320px;
    margin: 0 auto;
    padding: 18px 20px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.page-topbar-actions{
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.topbar-logo{
    padding: 8px;
}

.small-logo{
    width: 90px;
}

.home-button-grid{
    margin-top: 34px;
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 420px));
    gap: 18px;
    justify-content: center;
}

.home-panel-button{
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 26px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(20,20,24,0.96), rgba(10,10,12,0.96));
    border: 1px solid rgba(255, 51, 79, 0.18);
    box-shadow: 0 8px 24px rgba(0,0,0,0.22);
    color: white;
    text-decoration: none;
    text-align: left;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.home-panel-button:hover{
    transform: translateY(-2px);
    border-color: rgba(255, 51, 79, 0.34);
    box-shadow:
        0 0 24px rgba(255, 51, 79, 0.12),
        0 8px 24px rgba(0,0,0,0.22);
}

.home-panel-title{
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}

.home-panel-subtitle{
    font-size: 20px;
    line-height: 1.3;
    color: #b8bcc6;
}

@media (max-width: 760px){
    .page-topbar{
        flex-direction: column;
        align-items: stretch;
    }

    .page-topbar-actions{
        justify-content: stretch;
    }

    .page-topbar-actions .button{
        width: 100%;
    }

    .home-button-grid{
        grid-template-columns: 1fr;
    }

    .home-panel-title{
        font-size: 28px;
    }

    .home-panel-subtitle{
        font-size: 18px;
    }
}

.info-strip{
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0 26px 18px;
    color: #d7d7df;
}

.rules-sections{
    display: grid;
    gap: 18px;
    padding: 0 26px 26px;
}

.rule-section-card{
    border: 1px solid rgba(255, 51, 79, 0.18);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(20,20,24,0.96), rgba(10,10,12,0.96));
    box-shadow: 0 8px 24px rgba(0,0,0,0.22);
    overflow: hidden;
}

.rule-section-head{
    padding: 18px 20px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}

.rule-section-head h3{
    margin: 0;
    font-size: 30px;
    color: #fff;
}

.rule-items{
    margin: 0;
    padding: 18px 38px 22px;
    display: grid;
    gap: 12px;
}

.rule-items li{
    color: #d7d7df;
    font-size: 22px;
    line-height: 1.35;
}

@media (max-width: 640px){
    .info-strip{
        padding: 0 16px 16px;
    }

    .rules-sections{
        padding: 0 16px 16px;
    }

    .rule-section-head{
        padding: 16px;
    }

    .rule-section-head h3{
        font-size: 24px;
    }

    .rule-items{
        padding: 16px 20px 20px 34px;
    }

    .rule-items li{
        font-size: 18px;
    }
}

.rules-editor-list{
    display: grid;
    gap: 18px;
    padding: 0 26px 26px;
}

.rule-editor-card{
    border: 1px solid rgba(255, 51, 79, 0.18);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(20,20,24,0.96), rgba(10,10,12,0.96));
    box-shadow: 0 8px 24px rgba(0,0,0,0.22);
    padding: 20px;
    display: grid;
    gap: 14px;
}

.rule-editor-head{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.rule-editor-head h3{
    margin: 0;
    font-size: 28px;
    color: #fff;
}

.rules-textarea{
    width: 100%;
    min-height: 180px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(10,10,12,0.94);
    color: white;
    font-family: inherit;
    font-size: 19px;
    padding: 14px 16px;
    outline: none;
    resize: vertical;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.rules-textarea:focus{
    border-color: rgba(255, 51, 79, 0.55);
    box-shadow: 0 0 0 4px rgba(255, 51, 79, 0.12), var(--glow);
    transform: translateY(-1px);
}

@media (max-width: 640px){
    .rules-editor-list{
        padding: 0 16px 16px;
    }

    .rule-editor-card{
        padding: 16px;
    }

    .rule-editor-head h3{
        font-size: 22px;
    }

    .rules-textarea{
        font-size: 17px;
    }
}