/* Enhanced DartScorer.razor.css */
html, body {
    height: 100%;
    margin: 0;
}

/* ========================================
   THEMESTUDIO – CSS-Variablen (Layout & Theme)
   0px = automatisch (responsive Defaults bleiben aktiv)
   ======================================== */
:root {
    /* Farben Score Display */
    --sd-active-color: #4CAF50;
    --sd-inactive-color: #ffffff;
    --sd-checkout-color: #FFD700;

    /* Farben Score Board */
    --sb-background: #2c2c2c;
    --sb-border-color: #444;
    --sb-darts-background: #f0f0f0;
    --sb-darts-text-color: #333;

    /* Keyboard Akzentfarbe */
    --kb-accent-color: #4CAF50;

    /* Hintergründe */
    --bg-scorer-image: none;
    --bg-scorer-opacity: 1;
    --bg-scorer-blur: 0px;
    --bg-mainmenu-image: none;
    --bg-mainmenu-opacity: 1;
    --bg-mainmenu-blur: 0px;
    --bg-start-image: none;
    --bg-start-opacity: 1;
    --bg-start-blur: 0px;
}

.dart-menu-item {
    /* styles for the menu item */
    width: 450px !important;
    min-width: 450px !important;
    float: left !important;
}

/* Radzen specific overrides */
.rz-sidebar {
    width: 450px !important;
    min-width: 450px !important;
}

.rz-panelmenu, .rz-panelmenu-panel {
    width: 100% !important;
    min-width: 450px !important;
}

.rz-panelmenu-header, .rz-panelmenu-content {
    width: 100% !important;
    min-width: 420px !important;
}

/* Prevent collapsed sidebar from intercepting clicks */
.rz-sidebar.rz-sidebar-collapsed {
    width: 0 !important;
    min-width: 0 !important;
    opacity: 0;
    pointer-events: none;
}

    .rz-sidebar.rz-sidebar-collapsed .rz-panelmenu,
    .rz-sidebar.rz-sidebar-collapsed .rz-panelmenu-panel {
        display: none;
    }

.dart-menu-item .rz-navigation-item-text {
    font-size: 22px !important; /* styles for the text within the menu item */
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
    white-space: nowrap !important;
}

.dart-dropdown .rz-inputtext, .rz-dropdown-item, .rz-menuitem, .rz-autocomplete-list-item, .rz-multiselect-item {
    font-size: 24px !important;
    margin-top: 0px;
}

.rz-inputtext,
.rz-dropdown-item,
.rz-menuitem,
.rz-autocomplete-list-item,
.rz-multiselect-item,
.rz-dropdown-items li,
.rz-autocomplete-items li,
.rz-multiselect-items li {
    font-size: 24px; /* Adjust as needed */
    line-height: 1.0; /* Adjust line height for better readability */
    /*  padding-bottom: 10px; */
}

.menu-item-hover:hover {
    background: rgba(255,255,255,0.1) !important;
}

.dart-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--bg-scorer-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: var(--bg-scorer-opacity, 1);
    filter: blur(var(--bg-scorer-blur, 0px));
    /* background: url('/scorer/images/dartscorer.png') center center/cover no-repeat; */
    z-index: -1;
    pointer-events: none;
}

.dart-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95vw;
    max-width: 1200px;
    height: 90vh;
    /* background: url('/scorer/images/dartscorer.png') center center/cover no-repeat; */
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    overflow: hidden;
    z-index: 1000;
}

.dart-header {
    /*background: rgba(0,0,0,0.2);*/
    padding: 1rem;
    text-align: center;
    /*border-bottom: 2px solid rgba(255,255,255,0.1);*/
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
}

    .dart-header h1 {
        color: white;
        margin: 0;
        font-size: 2rem;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
        flex: 1;
    }

/* API Status im Header - standardmäßig ausgeblendet (nur Tablet) */
.header-api-status {
    display: none !important;
}

/* Autodarts Status in Header */
.header-autodarts-status {
    position: absolute;
    right: 4rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0,0,0,0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
}

.autodarts-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

    .autodarts-indicator.connected {
        background: #4CAF50;
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
        animation: connectedPulse 2s infinite;
    }

    .autodarts-indicator.disconnected {
        background: #F44336;
        box-shadow: 0 0 10px rgba(244, 67, 54, 0.6);
        animation: disconnectedBlink 1s infinite;
    }

@keyframes connectedPulse {
    0% {
        box-shadow: 0 0 5px rgba(76, 175, 80, 0.6);
    }

    50% {
        box-shadow: 0 0 15px rgba(76, 175, 80, 0.8);
    }

    100% {
        box-shadow: 0 0 5px rgba(76, 175, 80, 0.6);
    }
}

@keyframes disconnectedBlink {
    0%, 50% {
        opacity: 1;
    }

    51%, 100% {
        opacity: 0.3;
    }
}

.autodarts-header-text {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    white-space: nowrap;
}

.status-connected {
    color: #4CAF50;
}

.status-disconnected {
    color: #F44336;
}

.status-mode {
    color: #FFD700;
    font-size: 0.8rem;
    opacity: 0.9;
}

.hamburger-menu {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 1001;
}

.hamburger-icon {
    width: 30px;
    height: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger-icon.open .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-icon.open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-icon.open .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.dart-content {
    height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
    overflow-y: auto;
    box-sizing: border-box;
    scrollbar-width: none;
}

    .dart-content::-webkit-scrollbar {
        display: none;
    }

/* Hauptmenü-Hintergrund (ThemeStudio) */
.dart-content.main-menu-active {
    background-image: var(--bg-mainmenu-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: var(--bg-mainmenu-opacity, 1);
    filter: blur(var(--bg-mainmenu-blur, 0px));
}

/* ========================================
   KEYBOARD LAYOUT (Sidepanel Landschaft / unten Hochformat)
   ======================================== */
.keyboard-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
}

.keyboard-layout .scoreboard-area {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Ohne Tastatur (kein Sidepanel) wird das Scoreboard horizontal zentriert statt ganz links */
.keyboard-layout:not(.keyboard-side-panel) .scoreboard-area .dart-scoreboard {
    margin-left: auto;
    margin-right: auto;
}

/* Footer: API-Status mittig (Breite) in der mittleren Spalte zentrieren */
.api-status {
    justify-content: center;
}

.keyboard-layout.keyboard-side-panel {
    flex-direction: row;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0 0.5rem;
    box-sizing: border-box;
}

.keyboard-layout.keyboard-side-panel .scoreboard-area {
    flex: 1 1 auto;
    order: 2;
}

.keyboard-layout.keyboard-side-panel .scoreboard-wrapper .player-card {
    min-width: 0;
    max-width: none;
}

.keyboard-layout.keyboard-side-panel.side-right .keyboard-panel {
    order: 2;
}

.keyboard-layout.keyboard-side-panel.side-left .keyboard-panel {
    order: 1;
}

/* ========================================
   KOMPAKTES LANDSCAPE-SIDEPANEL-LAYOUT
   (kein Scrollen, Scoreboard mittig, Platz für Bestleistungen)
   ======================================== */
.keyboard-layout.keyboard-side-panel {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.keyboard-layout.keyboard-side-panel .scoreboard-area {
    overflow: hidden;
    gap: 0.4rem;
}

/* Kompakte Spieleranzeige (nicht voll gestreckt) */
.keyboard-layout.keyboard-side-panel .scoreboard-wrapper {
    gap: 0.5rem;
    align-items: stretch;
    padding: 0;
}

.keyboard-layout.keyboard-side-panel .scoreboard-wrapper .player-card {
    min-width: 0 !important;
    max-width: min(48%, var(--sd-card-max-width, 48%)) !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: var(--sd-card-padding, 0.4rem 0.7rem);
}

.keyboard-layout.keyboard-side-panel .scoreboard-wrapper .player-card > div[style*="position: absolute"] {
    font-size: var(--sd-name-font-size, 0.9rem) !important;
    top: 5px !important;
}

.keyboard-layout.keyboard-side-panel .scoreboard-wrapper .score-value {
    font-size: var(--sd-score-font-size, clamp(1.8rem, 4.5vw, 2.6rem)) !important;
    margin: 12px 0 4px !important;
}

.keyboard-layout.keyboard-side-panel .scoreboard-wrapper .dart-grid {
    gap: var(--sd-dart-grid-gap, 0.2rem);
    margin: 0.5rem 0;
}

.keyboard-layout.keyboard-side-panel .scoreboard-wrapper .dart-cell {
    min-height: var(--sd-dart-cell-height, 24px);
    padding: 0.2rem 0.3rem;
}

.keyboard-layout.keyboard-side-panel .scoreboard-wrapper .dart-cell > div {
    font-size: var(--sd-dart-value-font-size, 1.05rem) !important;
}

.keyboard-layout.keyboard-side-panel .scoreboard-wrapper .player-stats {
    margin-top: 0.4rem;
    gap: 0.3rem;
}

.keyboard-layout.keyboard-side-panel .scoreboard-wrapper .stat-group {
    gap: 0.75rem;
}

.keyboard-layout.keyboard-side-panel .scoreboard-wrapper .stat-label {
    font-size: var(--sd-stat-font-size, 0.65rem) !important;
}

.keyboard-layout.keyboard-side-panel .scoreboard-wrapper .stat-value {
    font-size: var(--sd-stat-font-size, 0.7rem) !important;
}

.keyboard-layout.keyboard-side-panel .scoreboard-wrapper .team-logo-wrapper {
    width: 40px;
    height: 40px;
    top: 5px;
}

.keyboard-layout.keyboard-side-panel .scoreboard-wrapper .team-logo-wrapper.left {
    left: 5px;
}

.keyboard-layout.keyboard-side-panel .scoreboard-wrapper .team-logo-wrapper.right {
    right: 5px;
}

/* Scoreboard schmaler und zentriert - Platz links/rechts für Bestleistungen */
.keyboard-layout.keyboard-side-panel .dart-scoreboard {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: var(--sb-max-width, auto);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0.4rem;
    box-sizing: border-box;
}

.keyboard-layout.keyboard-side-panel .scoreboard-content {
    flex: 1 1 auto;
    min-height: 0 !important;
    max-height: none !important;
}

.keyboard-layout.keyboard-side-panel .score-row {
    flex: 0 1 auto;
    min-height: var(--sb-row-height, clamp(22px, 4.5vh, 36px));
}

.keyboard-layout.keyboard-side-panel .score-cell,
.keyboard-layout.keyboard-side-panel .remaining-cell,
.keyboard-layout.keyboard-side-panel .darts-cell {
    font-size: var(--sb-font-size, clamp(0.9rem, 1.8vw, 1.3rem));
}

/* ========================================
   FREIE POSITIONIERUNG (ThemeStudio)
   Elemente absolut positionierbar, wenn --fp-mode: absolute gesetzt ist.
   Anker ist das .rz-layout (position: relative).
   ======================================== */
.dart-header,
.scoreboard-wrapper,
.dart-scoreboard,
.keyboard-panel,
.keyboard-bottom {
    position: var(--fp-mode, relative);
    left: 0;
    top: 0;
}

.dart-header {
    left: var(--fp-header-x, 0px);
    top: var(--fp-header-y, 0px);
    width: 100%;
}

.scoreboard-wrapper {
    left: var(--fp-sd-x, 0px);
    top: var(--fp-sd-y, 0px);
}

.dart-scoreboard {
    left: var(--fp-sb-x, 0px);
    top: var(--fp-sb-y, 0px);
}

.keyboard-panel,
.keyboard-bottom {
    left: var(--fp-kb-x, 0px);
    top: var(--fp-kb-y, 0px);
}

/* Zieh-Griff für Positionierung im Editor-Preview */
.rz-resize-handle.rz-resize-move {
    border-radius: 50%;
    background: #ffb300;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.6);
    cursor: move;
}

.rz-resize-handle.rz-resize-move::after {
    content: "+";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #000;
    line-height: 1;
}

.tournament-section {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 1rem;
}

.match-info {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
    color: white;
    text-align: center;
}

.score-display {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}

.player-score {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
    min-height: 320px;
}

    .player-score.active {
        border-color: #4CAF50;
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
    }

    .player-score.winner {
        border-color: #FFD700;
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
        animation: pulse 2s infinite;
    }

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* 4. Größere Score-Anzeige */
.player-name {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.player-current-score {
    color: #4CAF50;
    font-size: 8rem;
    font-weight: bold;
    font-family: Verdana, sans-serif;
    /*text-shadow: 2px 2px 4px rgba(0,0,0,0.5);*/
    margin-bottom: 1rem;
    line-height: 1;
}

/* 5. Große Autodarts Status-Anzeige im Score-Display */
.autodarts-game-status {
    background: rgba(76, 175, 80, 0.2);
    border: 2px solid #4CAF50;
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
    animation: pulse-status 2s infinite;
}

.autodarts-status-text {
    color: #4CAF50;
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

@keyframes pulse-status {
    0% {
        background: rgba(76, 175, 80, 0.2);
        border-color: #4CAF50;
    }

    50% {
        background: rgba(76, 175, 80, 0.4);
        border-color: #66BB6A;
    }

    100% {
        background: rgba(76, 175, 80, 0.2);
        border-color: #4CAF50;
    }
}

.current-darts {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    min-height: 60px;
    align-items: center;
    flex-wrap: wrap;
}

.dart-score {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    padding: 0.8rem 1.2rem;
    min-width: 70px;
    backdrop-filter: blur(5px);
    animation: dartAppear 0.3s ease-out;
}

/* 4. Gesamtsumme der letzten 3 Würfe größer anzeigen */
.dart-total {
    background: rgba(255, 193, 7, 0.3);
    border: 2px solid #FFD700;
    border-radius: 12px;
    color: #FFD700;
    font-size: 2.2rem;
    font-weight: bold;
    text-align: center;
    padding: 0.8rem 1.2rem;
    min-width: 100px;
    backdrop-filter: blur(5px);
    animation: dartTotalAppear 0.5s ease-out;
    margin-left: 1rem;
}

@keyframes dartAppear {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes dartTotalAppear {
    from {
        transform: scale(0.6);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.vs-divider {
    color: white;
    font-size: 4rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* 6. Tonne Animation (ab 100 Punkte) */
.tonne-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    text-align: center;
    animation: tonneShow 2s ease-in-out;
    pointer-events: none;
}

.tonne-text {
    font-size: 4rem;
    font-weight: bold;
    color: #FF9800;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.8);
    margin-bottom: 1rem;
    animation: tonneTextPulse 0.5s ease-in-out infinite alternate;
}

.tonne-score {
    font-size: 6rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 4px 4px 8px rgba(0,0,0,0.8);
    animation: tonneScoreBounce 0.8s ease-in-out infinite alternate;
}

@keyframes tonneShow {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }

    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

@keyframes tonneTextPulse {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.1);
    }
}

@keyframes tonneScoreBounce {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.15);
    }
}

/* 7. One Eighty Animation */
.one-eighty-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: oneEightyShow 3s ease-in-out;
    pointer-events: none;
}

.one-eighty-text {
    font-size: 8rem;
    font-weight: bold;
    background: linear-gradient(45deg, #FFD700, #FF6B35, #F7931E, #FFD700);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    animation: oneEightyTextShine 1s ease-in-out infinite, oneEightyTextBounce 0.6s ease-in-out infinite alternate;
    text-align: center;
    line-height: 1;
}

.one-eighty-fireworks {
    position: relative;
    width: 100%;
    height: 200px;
    margin-top: 2rem;
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: fireworkExplode 1.5s ease-out infinite;
}

    .firework:nth-child(1) {
        left: 20%;
        background: #FF6B35;
        animation-delay: 0s;
    }

    .firework:nth-child(2) {
        left: 50%;
        background: #FFD700;
        animation-delay: 0.3s;
    }

    .firework:nth-child(3) {
        left: 80%;
        background: #4CAF50;
        animation-delay: 0.6s;
    }

@keyframes oneEightyShow {
    0% {
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@keyframes oneEightyTextShine {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes oneEightyTextBounce {
    from {
        transform: scale(1) rotate(-2deg);
    }

    to {
        transform: scale(1.05) rotate(2deg);
    }
}

@keyframes fireworkExplode {
    0% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 currentColor;
    }

    50% {
        transform: scale(20);
        opacity: 0.8;
        box-shadow: 0 0 50px 20px currentColor;
    }

    100% {
        transform: scale(40);
        opacity: 0;
        box-shadow: 0 0 100px 40px transparent;
    }
}

/* 8. Big Fish (170) Animation */
.bigfish-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    text-align: center;
    animation: bigfishShow 3.5s ease-in-out;
    pointer-events: none;
}

.bigfish-text {
    font-size: 5.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ffd700, #ff8c00, #e95420, #ffd700);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 165, 0, 0.6);
    animation: bigfishTextShine 1s ease-in-out infinite, bigfishBounce 0.6s ease-in-out infinite alternate;
    line-height: 1;
}

.bigfish-score {
    font-size: 7rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.9);
    margin-top: 0.5rem;
    animation: bigfishScorePulse 0.7s ease-in-out infinite alternate;
}

.bigfish-sub {
    font-size: 1.4rem;
    font-weight: 600;
    color: #e95420;
    letter-spacing: 0.2em;
    margin-top: 0.75rem;
    text-transform: uppercase;
}

@keyframes bigfishShow {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(-8deg); }
    15% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(2deg); }
    85% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.85) rotate(4deg); }
}

@keyframes bigfishTextShine {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes bigfishBounce {
    from { transform: scale(1) rotate(-2deg); }
    to { transform: scale(1.05) rotate(2deg); }
}

@keyframes bigfishScorePulse {
    from { transform: scale(1); }
    to { transform: scale(1.12); }
}

.autodarts-section {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 1rem;
}

.autodarts-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.connection-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #f44336;
    transition: background 0.3s;
}

    .connection-indicator.connected {
        background: #4CAF50;
    }

.input-section {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.current-throw {
    text-align: center;
    margin-bottom: 1rem;
}

.throw-display {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.control-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.control-button {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    color: white;
    font-weight: bold;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
}

    .control-button:hover {
        background: rgba(255,255,255,0.3);
    }

    .control-button.primary {
        background: rgba(76, 175, 80, 0.8);
        border-color: #4CAF50;
    }

    .control-button.danger {
        background: rgba(244, 67, 54, 0.8);
        border-color: #f44336;
    }

    .control-button.warning {
        background: rgba(255, 152, 0, 0.8);
        border-color: #ff9800;
    }

.game-info {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    text-align: center;
}

.checkout-info {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
    color: white;
}

.setup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
}

.setup-content {
    background: #1F1F1F;
    border-radius: 15px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Ensure Radzen dialogs render above custom overlays */
.rz-dialog-wrapper,
.rz-dialog-wrapper .rz-overlay {
    z-index: 2500 !important;
}

.text-white {
    color: white;
}

.text-small {
    font-size: 0.9rem;
    opacity: 0.8;
}

.tournament-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.match-card {
    background: transparent;
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    margin: 4px;
}

    .match-card:hover {
        background: rgba(255,255,255,0.25);
        border-color: #4CAF50;
    }

    .match-card.selected {
        border-color: #FFD700;
        background: rgba(255, 215, 0, 0.2);
    }
/* Gamemode */
.game-mode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.mode-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.mode-badge {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.game-counter {
    background: rgba(255, 215, 0, 0.2);
    color: #FFD700;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.match-score {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.games-won {
    color: #FFD700;
    font-size: 0.8em;
    font-weight: 500;
    margin-left: 0.5rem;
}

.validation-message {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

    .validation-message.error {
        background: rgba(244, 67, 54, 0.9);
        color: white;
        border: 1px solid #f44336;
    }

    .validation-message.success {
        background: rgba(76, 175, 80, 0.9);
        color: white;
        border: 1px solid #4caf50;
    }

.start-hint, .finish-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 193, 7, 0.2);
    border-radius: 6px;
    font-size: 0.85rem;
    color: #ffc107;
}

.hint-icon {
    font-size: 1rem;
}

.game-mode-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(103, 126, 234, 0.1);
    border-radius: 8px;
    border-left: 4px solid #667eea;
    color: white;
}

.winner-section {
    text-align: center;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 193, 7, 0.1));
    border: 2px solid #FFD700;
    border-radius: 12px;
    padding: 2rem;
    margin: 1rem 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sidebar Logo Positioning */
.sidebar-logo {
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    z-index: 10 !important;
}

.sidebar-container {
    position: relative !important;
    height: 100% !important;
}


/* Background image for main layout */
.rz-layout {
    /* background: url('/scorer/images/dartscorer.png') center center/cover no-repeat fixed !important; */
}

/* Begegnung über Scoreboard */
.match-header {
    width: 100%;
    text-align: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.match-header-text {
    font-size: 1.4rem;
    color: white;
    font-weight: bold;
}


/* Board Info im Header zentriert */
.header-board-info {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #5a5a5a, #777);
    border-radius: 999px;
    padding: 0.45rem 2.4rem;
    border: 2px solid #999;
    color: #FFD700;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    max-width: 20%;
}

/* Spielerwechsel Button rechts im Header */
.player-swap-button {
    position: absolute;
    right: 1rem;
    width: 50px;
    height: 50px;
    background: rgba(76, 175, 80, 0.8);
    border: 2px solid #4CAF50;
    border-radius: 8px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

    .player-swap-button:hover {
        background: rgba(76, 175, 80, 1);
        transform: scale(1.05);
    }

    .player-swap-button:active {
        transform: scale(0.95);
    }


/* ========================================
   RESPONSIVE DESIGN - TABLET PORTRAIT
   ======================================== */

/* Tablets im Hochformat (768px - 1024px Breite) */
@media screen and (max-width: 1080px) and (orientation: portrait) {

    /* Match Header über Scoreboard */
    .match-header-text {
        font-size: 1rem !important;
    }

    /* Game Mode Footer unter Scoreboard */
    .game-mode-footer-text {
        font-size: var(--hd-mode-font-size, 0.9rem) !important;
    }

    /* Board Info im Header kompakter */
    .header-board-info {
        font-size: 1rem !important;
        padding: 0.3rem 1.5rem !important;
    }

    /* Spielerwechsel Button kleiner im Tablet */
    .player-swap-button {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.2rem !important;
        right: 0.5rem !important;
    }

    /* Vollbild-Layout für Tablets */
    .dart-window {
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
    }

    /* Header anpassen */
    .dart-header {
        height: 60px;
        padding: 0.5rem;
        gap: 0.75rem;
        position: relative;
    }

        .dart-header h1 {
            font-size: 1.5rem !important;
        }

        /* Logo Abstand */
        .dart-header .rz-stack {
            gap: 0.75rem !important;
        }

    /* API Status im Header - nur im Tablet-Modus sichtbar */
    .header-api-status {
        display: flex !important;
        align-items: center !important;
        position: absolute !important;
        top: 0.5rem !important;
        right: 0.5rem !important;
        background: rgba(0,0,0,0.3) !important;
        padding: 0.25rem 0.5rem !important;
        border-radius: 12px !important;
        border: 1px solid rgba(255,255,255,0.2) !important;
        backdrop-filter: blur(5px) !important;
        font-size: 0.65rem !important;
        z-index: 100 !important;
    }

        .header-api-status .connection-indicator {
            width: 6px !important;
            height: 6px !important;
        }

        .header-api-status span {
            font-size: 0.65rem !important;
        }

    /* Verstecke API Status im Footer */
    .rz-footer > div:nth-child(2) {
        display: none !important;
    }

    /* Tournament/League Info im Header - kompakter und rechts */
    .dart-header > div {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }

    /* Spielpaarung rechts ausrichten und verkleinern */
    .dart-header div[style*="absolute"] {
        position: relative !important;
        left: auto !important;
        transform: none !important;
        margin-left: auto !important;
        font-size: 0.7rem !important;
        white-space: nowrap !important;
        text-align: right !important;
    }

    /* Turnier-Info kompakter */
    .dart-header div[style*="flex-direction: column"] {
        position: relative !important;
        margin-left: auto !important;
        text-align: right !important;
    }

        .dart-header div[style*="flex-direction: column"] div {
            font-size: 0.65rem !important;
            white-space: nowrap !important;
        }

    /* Sidebar breiter für bessere Touch-Bedienung */
    .rz-sidebar {
        width: 300px !important;
        min-width: 300px !important;
    }

    /* Menu Items größer für Touch */
    .rz-navigation-item {
        font-size: 1.1rem !important;
        padding: 0.75rem 1rem !important;
        min-height: 48px;
    }

    /* Buttons größer für Touch */
    .control-button {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 0.75rem 1.25rem !important;
        font-size: 1rem !important;
    }

    /* Content-Bereich anpassen */
    .dart-content {
        padding: 0.75rem !important;
        min-height: calc(100% - 110px) !important;
        height: calc(100% - 110px) !important;
        overflow-y: auto !important;
    }

    /* Scoreboard kompakter */
    .score-display {
        font-size: 1.75rem !important;
    }

    .player-card {
        padding: var(--sd-card-padding, 1rem) !important;
    }

    /* Eingabefelder größer */
    input[type="text"],
    input[type="number"],
    .rz-textbox,
    .rz-numeric {
        min-height: 44px !important;
        font-size: 1rem !important;
    }

    /* Dialog größer */
    .rz-dialog {
        width: 90vw !important;
        max-width: 600px !important;
    }

    /* Footer kompakter im Tablet-Modus - EINZEILIG ohne API Status */
    .rz-footer {
        height: 50px !important;
        padding: 0 0.5rem !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0.75rem !important;
    }

        /* Copyright - links */
        .rz-footer > div:nth-child(1) {
            flex: 0 0 auto !important;
            font-size: 0.75rem !important;
            padding: 0 !important;
            white-space: nowrap !important;
        }

        /* API Status - VERSTECKT (wird im Header angezeigt) */
        .rz-footer > div:nth-child(2) {
            display: none !important;
        }

        /* Spielmodus - nach Copyright */
        .rz-footer > div:nth-child(3) {
            flex: 0 0 auto !important;
            font-size: 0.75rem !important;
            padding: 0 !important;
            white-space: nowrap !important;
        }

        /* Language Selector - ganz rechts mit genug Platz */
        .rz-footer > div:nth-child(5) {
            flex: 0 0 auto !important;
            margin-left: 0 !important;
        }

    /* API Status kompakter - für Header */
    .connection-indicator {
        width: 8px !important;
        height: 8px !important;
    }

    .api-status {
        gap: 0.3rem !important;
        display: flex !important;
        align-items: center !important;
    }

        .api-status span {
            font-size: 0.7rem !important;
            line-height: 1.2 !important;
        }
}

/* Kleinere Tablets und große Smartphones im Hochformat */
@media screen and (max-width: 768px) and (orientation: portrait) {

    .dart-header h1 {
        font-size: 1.25rem !important;
    }

    .rz-sidebar {
        width: 280px !important;
        min-width: 280px !important;
    }

    .control-button {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
    }

    .score-display {
        font-size: 1.5rem !important;
    }
}

/* Querformat-Optimierung für Tablets */
@media screen and (max-width: 1920px) and (orientation: landscape) {

    .dart-content {
        min-height: calc(100vh - 100px) !important;
        height: calc(100vh - 100px) !important;
        overflow-y: auto !important;
    }

    .dart-header {
        height: 50px;
    }
}

@media (max-width: 768px) {
    .mode-info {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .game-mode-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Layout-Editor: Ein-/Ausklapp-Toggler der Abschnitte gut sichtbar machen */
.rz-fieldset-toggleable .rz-fieldset-toggler {
    width: 1.4rem;
    height: 1.4rem;
    line-height: 1.4rem;
    font-size: 1.25rem;
    color: var(--rz-text-primary-color);
}

/* Layout-Editor: Button-Texte nicht abschneiden (kleinere Schrift + Umbruch statt nowrap-Clipping) */
.layout-editor .rz-button {
    font-size: 12px !important;
    padding: 0.45rem 0.4rem !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    height: auto !important;
    min-height: 2.4rem !important;
}

.layout-editor .rz-button .rz-button-text {
    white-space: normal !important;
    line-height: 1.15 !important;
}

/* Preset-/Layout-Auswahl (RadzenSelectBar): volle Breite, gleichmäßig verteilt, Text umbrechbar */
.layout-editor .rz-selectbutton {
    width: 100% !important;
}

.layout-editor .rz-selectbutton .rz-button {
    flex: 1 1 auto !important;
    justify-content: center !important;
    text-align: center !important;
}

/* ========================================
   THEME-EDITOR: Drag-Resize-Handles (Phase 2)
   ======================================== */
.rz-resize-handle {
    position: fixed;
    box-sizing: border-box;
    border: 2px solid #FFD700;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.28);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.65);
    pointer-events: auto;
    touch-action: none;
    z-index: 1100;
    transition: background-color 0.12s ease, transform 0.12s ease;
}

.rz-resize-handle:hover {
    background: rgba(255, 215, 0, 0.6);
    transform: scale(1.2);
}

body.rz-resizing-horizontal,
body.rz-resizing-horizontal * {
    cursor: ew-resize !important;
    user-select: none !important;
}

body.rz-resizing-vertical,
body.rz-resizing-vertical * {
    cursor: ns-resize !important;
    user-select: none !important;
}

body.rz-resizing-move,
body.rz-resizing-move * {
    cursor: move !important;
    user-select: none !important;
}

/* ========================================
   LAYOUT-EDITOR-PANEL: einklappbar + verschiebbar
   Radzen Side-Dialog rendert als <aside class="rz-dialog-side layout-editor-dialog">
   mit .rz-dialog-side-titlebar (kein .rz-dialog-wrapper / .rz-dialog-titlebar).
   ======================================== */
.layout-editor-dialog .rz-dialog-titlebar,
.layout-editor-dialog .rz-dialog-side-titlebar {
    cursor: move !important;
    user-select: none;
}

.rz-dialog-side.layout-editor-collapsed,
.rz-dialog-wrapper.layout-editor-collapsed {
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

.rz-dialog-side.layout-editor-collapsed .rz-dialog-side-content,
.rz-dialog-side.layout-editor-collapsed .rz-dialog-side-titlebar,
.rz-dialog-side.layout-editor-collapsed .rz-dialog-resize-bar,
.rz-dialog-wrapper.layout-editor-collapsed .rz-dialog,
.rz-dialog-wrapper.layout-editor-collapsed .rz-dialog-content {
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    visibility: hidden;
}

.layout-editor-reopen {
    position: fixed;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: rgba(40, 40, 40, 0.92);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2200;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.layout-editor-reopen:hover {
    background: rgba(60, 60, 60, 0.95);
}

/* ========================================
   ONLINE-FREE-SPIEL: Matchcode-Bildschirmtastatur
   ======================================== */
.matchcode-keyboard {
    background-color: #2c2c2c;
    border: 3px solid #444;
    border-radius: 12px;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.matchcode-keyboard-row {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 0.2rem;
}

.matchcode-key {
    width: 100%;
    min-width: 0 !important;
    padding: 0.2rem 0 !important;
    font-size: 0.9rem !important;
    font-weight: bold !important;
    height: 2rem !important;
    overflow: hidden;
}

.matchcode-key-back,
.matchcode-key-clear {
    font-size: 0.8rem !important;
}


@media (max-width: 768px) {
    .matchcode-keyboard-row {
        grid-template-columns: repeat(10, 1fr);
    }
}

/* ========================================
   MEGADARTS-BUTTONFARBEN (globaler Theme-Override)
   Abbrechen=#E95420 · Erstellen/OK/Speichern=#009B51
   Loeschen=#B90D41 · Warnung/Bearbeiten=#C2840D · Standard=#12A4F5
   ======================================== */
:root {
    --rz-primary: #12A4F5;
    --rz-primary-light: #3eb7f7;
    --rz-primary-lighter: rgba(18, 164, 245, 0.16);
    --rz-primary-dark: #0e83c4;
    --rz-primary-darker: #0c6da3;

    --rz-secondary: #E95420;
    --rz-secondary-light: #ed7449;
    --rz-secondary-lighter: rgba(233, 84, 32, 0.2);
    --rz-secondary-dark: #c74418;
    --rz-secondary-darker: #a83a14;

    --rz-info: #12A4F5;
    --rz-info-light: #3eb7f7;
    --rz-info-lighter: rgba(18, 164, 245, 0.2);
    --rz-info-dark: #0e83c4;
    --rz-info-darker: #0c6da3;

    --rz-success: #009B51;
    --rz-success-light: #14b564;
    --rz-success-lighter: rgba(0, 155, 81, 0.16);
    --rz-success-dark: #007a40;
    --rz-success-darker: #006535;

    --rz-warning: #C2840D;
    --rz-warning-light: #d99a24;
    --rz-warning-lighter: rgba(194, 132, 13, 0.2);
    --rz-warning-dark: #a06c0a;
    --rz-warning-darker: #855a08;

    --rz-danger: #B90D41;
    --rz-danger-light: #d11f53;
    --rz-danger-lighter: rgba(185, 13, 65, 0.2);
    --rz-danger-dark: #9a0b36;
    --rz-danger-darker: #80092d;
}
