/* Ausgelagert - DAS Carombrett als .svg! */
/* Version 2.63, 11.11.2026 16:45 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    overflow: hidden;
    height: 100vh;
    user-select: none;
}

#brettContainer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: calc(90vh * 1.777);
    height: auto;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#brettContainer.gui-open-left {
    left: 63%;
    width: 72vw;
    max-width: calc(70vh * 1.777);
}

#brettContainer.gui-open-right {
    left: 42%;
    width: 75vw;
}

#BrettPur {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
}

#Bandenrahmen,
#Bande,
#Brett {
    transition: fill 1.4s ease;
}

.ball {
    cursor: grab;
    transition: filter 0.2s ease;
    touch-action: none;
}

.ball:hover {
    filter: brightness(1.1);
}

.ball.dragging {
    cursor: grabbing;
    filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.6));
}

.ball.active {
    filter: drop-shadow(0 0 8px rgba(78, 204, 163, 0.8));
}

/* Pomeranze draggbar */
.pomeranze {
    cursor: grab;
    transition: filter 0.2s ease;
    touch-action: none;
}

.pomeranze:hover {
    filter: brightness(1.3);
}

.pomeranze.dragging {
    cursor: grabbing;
    filter: drop-shadow(0 0 12px rgba(255, 235, 59, 0.9));
}

#activeBallIndicator {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#activeBallIndicator.visible {
    opacity: 1;
}

<!-- Linie vom Ball1 aus? -->
.indicator-line {
    stroke: rgba(78, 204, 163, 0.6);
    stroke-width: 0.3;
    stroke-dasharray: 1, 2;
}

.indicator-arrow {
    fill: #4ecca3;
}

/* Design GUI rechts */
#designGui {
    position: fixed;
    top: 50%;
    right: -280px;
    transform: translateY(-50%);
    width: 280px;
    background: linear-gradient(180deg, rgba(15, 52, 96, 0.9) 0%, rgba(22, 33, 62, 0.9) 100%);
    backdrop-filter: blur(10px);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    padding: 20px 15px;
    border-radius: 15px 0 0 15px;
    max-height: 80vh;
    overflow-y: auto;
}

#designGui.open {
    right: 0;
}

#designGui h3 {
    font-size: 0.95rem;
    color: #4ecca3;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(78, 204, 163, 0.3);
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.theme-card {
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.theme-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

.theme-card.active {
    border-color: #4ecca3;
    background: rgba(78, 204, 163, 0.15);
}

.theme-colors {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
    justify-content: center;
}

.theme-swatch {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.theme-label {
    font-size: 0.75rem;
    color: #93b5c6;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-row label {
    font-size: 0.85rem;
    color: #93b5c6;
}

.mini-switch {
    position: relative;
    width: 40px;
    height: 20px;
}

.mini-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mini-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: 0.3s;
    border-radius: 20px;
}

.mini-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .mini-slider {
    background-color: #4ecca3;
}

input:checked + .mini-slider:before {
    transform: translateX(20px);
}

.line-styles {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.line-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.line-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.line-option.active {
    border-color: #4ecca3;
    background: rgba(78, 204, 163, 0.1);
}

.line-preview {
    flex: 1;
    height: 2px;
}

.line-preview svg {
    width: 100%;
    height: 12px;
}

.line-name {
    font-size: 0.75rem;
    color: #93b5c6;
    min-width: 70px;
}

#designToggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4ecca3 0%, #3a9d7f 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(78, 204, 163, 0.4);
}

#designToggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(78, 204, 163, 0.6);
}

#designToggle.open {
    right: 300px;
}

#designToggle::before,
#designToggle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: #fff;
    transition: all 0.3s ease;
}

#designToggle::before {
    transform: translateY(-5px);
}

#designToggle::after {
    transform: translateY(5px);
}

#designToggle.open::before {
    transform: rotate(45deg);
}

#designToggle.open::after {
    transform: rotate(-45deg);
}

.gui-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
    border-bottom: 2px solid rgba(78, 204, 163, 0.3);
}

.gui-tab {
    flex: 1;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    color: #93b5c6;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.gui-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #4ecca3;
}

.gui-tab.active {
    background: rgba(78, 204, 163, 0.15);
    color: #4ecca3;
    border-bottom-color: #4ecca3;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.shot-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.shot-point {
    cursor: move;
    transition: filter 0.2s ease;
    touch-action: none;
}

.shot-point:hover {
    filter: brightness(1.3);
}

.shot-point.dragging {
    cursor: grabbing;
    filter: drop-shadow(0 0 8px rgba(78, 204, 163, 0.8));
}

#queueTip {
    touch-action: none;
}

.control-group {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 12px;
    border-radius: 8px;
}

.control-group label {
    display: block;
    font-size: 0.75rem;
    color: #93b5c6;
    margin-bottom: 6px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #4ecca3;
    padding: 6px 10px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.control-input:focus {
    outline: none;
    border-color: #4ecca3;
}

.mini-btn {
    padding: 6px 12px;
    background: rgba(78, 204, 163, 0.15);
    border: 1px solid rgba(78, 204, 163, 0.3);
    color: #4ecca3;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.mini-btn:hover {
    background: rgba(78, 204, 163, 0.25);
}

.mini-btn.active {
    background: rgba(78, 204, 163, 0.3);
    border-color: #4ecca3;
}

#ballGui {
    position: fixed;
    left: -500px;
    top: 50%;
    transform: translateY(-50%);
    width: 520px;
    max-width: 90vw;
    background: linear-gradient(180deg, rgba(15, 52, 96, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    backdrop-filter: blur(10px);
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.5);
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    padding: 12px 16px;
    border-radius: 0 12px 12px 0;
}

#ballGui.open {
    left: 0;
}

#ballGui.collision-hide {
    left: -500px !important;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.6, 1);
}

#ballGuiTab {
    position: absolute;
    top: 50%;
    right: -30px;
    transform: translateY(-50%);
    width: 30px;
    height: 120px;
    background: linear-gradient(180deg, rgba(15, 52, 96, 0.9) 0%, rgba(22, 33, 62, 0.9) 100%);
    backdrop-filter: blur(10px);
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

#ballGuiTab:hover {
    background: linear-gradient(180deg, rgba(20, 60, 110, 0.95) 0%, rgba(25, 40, 70, 0.95) 100%);
}

#ballGuiTab::before {
    content: '▶';
    transition: transform 0.3s ease;
}

#ballGui.open #ballGuiTab::before {
    transform: rotate(180deg);
}

#pinButton {
    position: absolute;
    top: 10px;
    right: -30px;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

#pinButton:hover {
    background: rgba(255, 255, 255, 0.2);
}

#pinButton.pinned {
    background: rgba(78, 204, 163, 0.3);
    border-color: #4ecca3;
}

.active-slider {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    display: flex;
    gap: 12px;
}

.slider-dual {
    flex: 1;
    display: flex;
    gap: 12px;
}

.slider-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.slider-head {
    font-size: 0.75rem;
    color: #93b5c6;
    display: flex;
    justify-content: space-between;
}

.slider-val {
    font-family: 'Courier New', monospace;
    color: #4ecca3;
    font-weight: bold;
}

.range-input {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.range-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.range-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.range-input::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.pos-table {
    width: auto;
    border-collapse: collapse;
    margin-bottom: 8px;
    margin-right: auto;
}

.pos-table th {
    font-size: 0.7rem;
    color: #93b5c6;
    font-weight: 600;
    padding: 3px 5px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pos-table td {
    padding: 4px 5px;
    text-align: center;
    font-family: 'Courier New', monospace;
    color: #fff;
    font-size: 0.8rem;
}

.pos-table tr {
    transition: background 0.2s ease;
}

.pos-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.pos-table tr.active-row {
    background: rgba(78, 204, 163, 0.08);
}

.ball-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cm-col {
    transition: opacity 0.3s ease;
}

.cm-col.hidden {
    display: none;
}

.actions-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.action-btn {
    width: 36px;
    height: 36px;
    background: rgba(78, 204, 163, 0.15);
    border: 1px solid rgba(78, 204, 163, 0.3);
    color: #4ecca3;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-btn:hover {
    background: rgba(78, 204, 163, 0.25);
    transform: translateY(-2px);
}

.action-btn.toggle {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: #93b5c6;
    font-size: 0.75rem;
    font-weight: bold;
    width: 44px;
}

.action-btn.toggle.active {
    background: rgba(78, 204, 163, 0.2);
    border-color: #4ecca3;
    color: #4ecca3;
}

/* Ziellinie Toggle - gelb wenn aktiv */
#toggleAimLine.active {
    background: rgba(255, 235, 59, 0.3);
    border-color: #ffeb3b;
    color: #ffeb3b;
}

/* Stoßstärke-Schieber */
.strength-control {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.strength-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.strength-icon {
    font-size: 1.2rem;
}

.strength-value {
    margin-left: auto;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    min-width: 50px;
    text-align: right;
}

.strength-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #4ade80 0%, #4ade80 40%, #facc15 40%, #facc15 75%, #dc2626 75%, #7f1d1d 100%);
    cursor: pointer;
}

.strength-slider::-webkit-slider-track {
    width: 100%;
    height: 8px;
    border-radius: 4px;
}

.strength-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: grab;
    border: 3px solid #4ecca3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.strength-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
}

.strength-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #4ade80 0%, #4ade80 40%, #facc15 40%, #facc15 75%, #dc2626 75%, #7f1d1d 100%);
}

.strength-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: grab;
    border: 3px solid #4ecca3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.strength-slider::-moz-range-thumb:active {
    cursor: grabbing;
}


#Bandenrahmen {
    stroke: rgb(0, 0, 0);
    stroke-linejoin: round;
    transition: fill 0.6s ease;
}

#Bande {
    stroke: none;
    transition: fill 0.6s ease;
}

#Brett {
    stroke: none;
    transition: fill 0.6s ease;
}

#BrettPur [id^="Dia"],
#BrettPur use[href^="#Dia"],
#BrettPur [id="LineVert"],
#BrettPur use[href="#LineVert"],
#BrettPur line:not([id]) {
    transition: opacity 0.4s ease;
}

#BrettPur.theme-blue #Bandenrahmen { fill: rgb(85, 40, 0); }
#BrettPur.theme-blue #Bande { fill: rgb(22, 3, 77); }
#BrettPur.theme-blue #Brett { fill: rgb(22, 63, 190); }

#BrettPur.theme-greenLight #Bandenrahmen { fill: rgb(60, 40, 20); }
#BrettPur.theme-greenLight #Bande { fill: rgb(66, 65, 65); }
#BrettPur.theme-greenLight #Brett { fill: rgb(95, 95, 95); }

#BrettPur.theme-greenDark #Bandenrahmen { fill: rgb(60, 40, 20); }
#BrettPur.theme-greenDark #Bande { fill: rgb(20, 60, 30); }
#BrettPur.theme-greenDark #Brett { fill: rgb(34, 139, 34); }

#BrettPur.theme-red #Bandenrahmen { fill: rgb(40, 20, 0); }
#BrettPur.theme-red #Bande { fill: rgb(90, 0, 0); }
#BrettPur.theme-red #Brett { fill: rgb(120, 0, 0); }

#BrettPur.theme-purple #Bandenrahmen { fill: rgb(60, 40, 60); }
#BrettPur.theme-purple #Bande { fill: rgb(40, 20, 60); }
#BrettPur.theme-purple #Brett { fill: rgb(138, 43, 226); }

#BrettPur.hide-diamonds [id^="Dia"],
#BrettPur.hide-diamonds use[href^="#Dia"] {
    display: none;
}

#BrettPur.hide-lines [id="LineVert"],
#BrettPur.hide-lines use[href="#LineVert"],
#BrettPur.hide-lines line:not([id]) {
    opacity: 0;
}

#BrettPur.lines-thin line {
    stroke: rgba(255, 255, 255, 0.5);
    stroke-width: 0.4;
    stroke-dasharray: 1, 2;
}

#BrettPur.lines-dashed line {
    stroke: rgba(255, 255, 255, 0.6);
    stroke-width: 0.5;
    stroke-dasharray: 2, 2;
}

#BrettPur.lines-dotted line {
    stroke: rgba(255, 255, 255, 0.6);
    stroke-width: 0.6;
    stroke-dasharray: 0.3, 1.5;
}

#BrettPur.lines-solid line {
    stroke: rgba(255, 255, 255, 0.4);
    stroke-width: 0.4;
    stroke-dasharray: none;
}
