* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
    padding: 2vh;
}

.editor-container {
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2vh 3vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 3vh;
}

.header-buttons {
    display: flex;
    gap: 1vw;
}

.btn {
    padding: 1vh 2vw;
    font-size: 1.8vh;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: white;
    color: #667eea;
    font-weight: bold;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: #2ecc71;
    color: white;
}

.btn-primary:hover {
    background: #27ae60;
}

.editor-content {
    display: flex;
    padding: 3vh 2vw;
    gap: 3vw;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.tools-panel {
    width: 300px;
    flex-shrink: 0;
}

.tools-panel h3 {
    color: #667eea;
    margin-bottom: 1.5vh;
    font-size: 2vh;
}

.tool-buttons {
    display: flex;
    flex-direction: column;
    gap: 1vh;
    margin-bottom: 3vh;
}

.tool-btn {
    padding: 1.5vh 2vw;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1vw;
    font-size: 1.8vh;
    transition: all 0.3s;
}

.tool-btn:hover {
    border-color: #667eea;
    transform: translateX(5px);
}

.tool-btn.active {
    border-color: #667eea;
    background: #f0f4ff;
    font-weight: bold;
}

.tool-preview {
    width: 3vh;
    height: 3vh;
    border-radius: 4px;
    border: 1px solid #333;
}

.tool-preview.sand {
    background-color: #f4d03f;
}

.tool-preview.longjump {
    background-color: #f39c12;
    position: relative;
    overflow: hidden;
}

.tool-preview.longjump::after {
    content: '👟';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2em;
}

.tool-preview.water {
    background-color: #4a90e2;
}

.tool-preview.start {
    background-color: #e74c3c;
}

.tool-preview.goal {
    background-color: #2ecc71;
}

.info-panel {
    background: #f8f9fa;
    padding: 2vh;
    border-radius: 8px;
    margin-bottom: 3vh;
}

.info-panel ul {
    list-style: none;
    padding-left: 0;
}

.info-panel li {
    padding: 0.5vh 0;
    font-size: 1.6vh;
    color: #555;
}

.info-panel li:before {
    content: "→ ";
    color: #667eea;
    font-weight: bold;
}

.level-code {
    background: #f8f9fa;
    padding: 2vh;
    border-radius: 8px;
}

#codeDisplay {
    background: white;
    padding: 1.5vh;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 2vh;
    font-weight: bold;
    color: #667eea;
    text-align: center;
    margin-top: 1vh;
}

.grid-container {
    flex: 1;
    display: flex;
    min-height: 0;
    min-width: 0;
    align-items: flex-start;
}

.editor-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(12, 1fr);
    height: 100%;
    width: auto;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    gap: 2px;
    background-color: #333;
    border: 3px solid #333;
}

.editor-cell {
    background-color: #4a90e2;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.editor-cell:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
    z-index: 10;
}

.editor-cell.sand {
    background-color: #f4d03f;
}

.editor-cell.water {
    background-color: #4a90e2;
}

.editor-cell.longjump {
    background-color: #f39c12;
    position: relative;
}

.editor-cell.longjump::after {
    content: '👟';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5vh;
    pointer-events: none;
}

.editor-cell.start {
    background-color: #e74c3c;
}

.editor-cell.goal {
    background-color: #2ecc71;
}

.editor-cell.border-cell {
    background-color: #ddd;
    cursor: not-allowed;
    position: relative;
    opacity: 0.5;
}

.editor-cell.border-cell::before,
.editor-cell.border-cell::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 2px;
    background-color: #e74c3c;
    transform-origin: center;
}

.editor-cell.border-cell::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.editor-cell.border-cell::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.editor-cell.border-cell:hover {
    filter: none;
    transform: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 4vh 4vw;
    border-radius: 15px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    color: #2ecc71;
    font-size: 3vh;
    margin-bottom: 2vh;
}

.modal-content p {
    font-size: 2vh;
    margin-bottom: 1vh;
    color: #555;
}

.saved-code {
    background: #f8f9fa;
    padding: 2vh;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 3vh;
    font-weight: bold;
    color: #667eea;
    margin: 2vh 0;
    letter-spacing: 2px;
}

.info-text {
    font-size: 1.6vh;
    color: #888;
    font-style: italic;
}

#closeModalBtn {
    margin-top: 2vh;
}
/* User-ID-Anzeige */
.user-id-display {
    position: fixed;
    bottom: 1vh;
    right: 1vw;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5vh 1vw;
    border-radius: 5px;
    font-size: 1.2vh;
    color: #666;
    font-family: 'Courier New', monospace;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    cursor: help;
}

/* Rechtliche Links */
.legal-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 5px 0;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    z-index: 10000;
}
.legal-footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    margin: 0 12px;
}
.legal-footer a:hover {
    text-decoration: underline;
}