.spieler-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

.tab-nav {
    display: flex;
    gap: 0;
    background: white;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 30px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.tab-btn:hover {
    background: #f8fafc;
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: #f0f7ff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.lineup-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    align-items: start;
}

.player-drawer {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.player-drawer h3 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
    font-size: 16px;
}

.player-drag-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.draggable-player {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px 15px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-dark);
    transition: all 0.1s;
    display: flex;
    align-items: center;
    gap: 8px;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.draggable-player:active {
    transform: scale(0.98);
    opacity: 0.8;
}

.draggable-player.player-placed {
    opacity: 0.5;
    cursor: default;
    background: #e5e7eb;
    pointer-events: none;
}

.draggable-player.player-selected {
    background: #dbeafe;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(109, 74, 255, 0.4);
    transform: scale(1.02);
    transition: all 0.15s ease;
}

.positions-area {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.positions-area h2 {
    margin: 0 0 20px 0;
    color: var(--primary-color);
    font-size: 18px;
}

.court-position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 160px);
    gap: 15px;
    background: #fef3c7;
    padding: 30px 20px 20px 20px;
    border-radius: 8px;
    border: 2px solid #d97706;
    position: relative;
}

.court-position-grid::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    height: 4px;
    background: #333;
    border-radius: 2px;
    z-index: 1;
}

.pos-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pos-label {
    background: #334155;
    color: white;
    font-weight: 700;
    font-size: 20px;
    padding: 5px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    z-index: 10;
}

.drop-zone {
    flex: 1;
    width: 100%;
    background: rgba(255,255,255,0.8);
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    min-height: 80px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
}

.drop-zone:active {
    background: #f0f7ff;
}

.drop-zone.drag-over {
    background: #dbeafe;
    border-color: var(--primary-color);
    border-style: solid;
}

.drop-zone .placed-chip {
    position: relative;
    z-index: 10;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    width: 72px;
    padding: 4px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    text-align: center;
    word-break: break-word;
    touch-action: manipulation;
    pointer-events: auto;
}

.drop-zone .placed-chip:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.drop-zone .placeholder {
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}

.btn-reset {
    background: #fee2e2;
    color: var(--danger-color);
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 15px;
    transition: background 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-reset:hover {
    background: #fecaca;
}

.btn-reset:active {
    opacity: 0.8;
}

.tactics-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.tactics-toolbar {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.toolbar-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.toolbar-group label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
}

#canvasColor {
    width: 50px;
    height: 35px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    background: white;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

#canvasColor::-webkit-color-swatch-wrapper { padding: 2px; }
#canvasColor::-webkit-color-swatch { border: none; border-radius: 2px; }
#canvasColor::-moz-color-swatch { border: none; border-radius: 2px; }

.btn-tool {
    background: #f1f5f9;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-tool:hover {
    background: #e2e8f0;
    border-color: var(--secondary-color);
}

.btn-tool:active {
    transform: scale(0.97);
}

.taktikboard-wrapper-spieltag {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    background: #f97316;
    display: inline-block;
    max-width: 100%;
}

#tacticsCanvas {
    display: block;
    width: 400px;
    max-width: 100%;
    height: auto;
    cursor: crosshair;
    touch-action: none;
}

.chips-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
}

.board-chip {
    position: absolute;
    transform: translate(-50%, -50%);
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    width: 72px;
    padding: 4px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    cursor: grab;
    pointer-events: auto;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    word-break: break-word;
}

.board-chip:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

.board-chip.dragging {
    opacity: 0.75;
    z-index: 1000;
    cursor: grabbing;
}

.board-chip.long-name {
    width: 84px;
    font-size: 11px;
}

.board-chip.very-long-name {
    width: 96px;
    font-size: 10px;
}

.taktikboard-toolbar-spieltag {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    background: #f8fafc;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.taktik-tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: #f1f5f9;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 20px;
    min-width: 55px;
    transition: all 0.15s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.taktik-tool-btn:hover {
    background: #e2e8f0;
    border-color: var(--secondary-color);
}

.taktik-tool-btn:active {
    transform: scale(0.95);
}

.taktik-tool-btn.active {
    background: #dbeafe;
    border-color: var(--primary-color);
}

.taktik-tool-btn span {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 600;
}

.taktik-tool-btn.active span {
    color: var(--primary-color);
}

@media screen and (max-width: 768px) {
    .lineup-container {
        grid-template-columns: 1fr;
    }

    .player-drawer {
        position: static;
        max-height: none;
        order: 2;
    }

    .positions-area {
        order: 1;
    }

    .court-position-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 110px);
        padding: 25px 10px 10px 10px;
        gap: 10px;
    }

    .pos-label {
        font-size: 16px;
        padding: 3px 8px;
    }

    .drop-zone {
        min-height: 60px;
    }

    .drop-zone .placed-chip {
        width: 64px;
        font-size: 11px;
    }

    .drop-zone .placed-chip.long-name {
        width: 74px;
        font-size: 10px;
    }

    .drop-zone .placed-chip.very-long-name {
        width: 84px;
        font-size: 9px;
    }

    #tacticsCanvas {
        width: 100%;
    }

    .taktikboard-toolbar-spieltag {
        justify-content: center;
    }

    .taktik-tool-btn {
        font-size: 18px;
        min-width: 45px;
        padding: 6px 8px;
    }

    .toolbar-group {
        flex-direction: column;
        align-items: stretch;
    }

    .board-chip {
        width: 64px;
        font-size: 11px;
    }

    .board-chip.long-name {
        width: 74px;
        font-size: 10px;
    }

    .board-chip.very-long-name {
        width: 84px;
        font-size: 9px;
    }
}