@font-face {
    font-family: 'Roboto';
    src: url('../fonts/Roboto/Roboto.woff2') format('woff2'),
         url('../fonts/Roboto/Roboto.woff') format('woff'),
         url('../fonts/Roboto/Roboto.ttf') format('truetype'),
         url('../fonts/Roboto/Roboto.svg#Roboto') format('svg');
    font-weight: normal;
    font-style: normal;
  }
  
  .roboto {
    font-family: 'Roboto';
  }

:root {
    --bg: #f5f9fd;
    --surface: #ffffff;
    --border: #d4e3f0;
    --text: #1a3a5c;
    --text-muted: #5a7a96;
    --accent: #1e5fa3;
    --accent-dark: #154877;
    --accent-light: #e8f1f9;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(30, 95, 163, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.header-logo {
    flex: 1;
    display: flex;
    align-items: center;
}

.header-logo img {
    height: 50px;
    width: auto;
    display: block;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.badges {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.header-title h1 {
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: -0.02em;
}

.header-title span {
    font-size: 1.6rem;
}

@media (max-width: 600px) {
    .header-logo {
        flex: 0 0 auto;
    }
    .header-title {
        flex: 1;
        justify-content: flex-end;
    }
    .badges {
        flex: 0 0 100%;
        justify-content: center;
    }
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.badge-dsgvo {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.badge-oer {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.badge-cc {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    padding: 28px 20px;
    align-items: start;
}

/* Tablet: Rad links, beide Sidebars rechts gestapelt */
@media (min-width: 760px) {
    main {
        grid-template-columns: 1fr 300px;
    }
    .wheel-area {
        grid-column: 1;
        grid-row: 1;
    }
    .sidebar-left {
        grid-column: 2;
        grid-row: 1;
        padding-left: 24px;
    }
    .sidebar-right {
        grid-column: 2;
        grid-row: 2;
        padding-left: 24px;
    }
}

/* Desktop: linke Sidebar | Rad | rechte Sidebar (Vorlagen) */
@media (min-width: 1100px) {
    main {
        grid-template-columns: 280px 1fr 300px;
    }
    .sidebar-left {
        grid-column: 1;
        grid-row: 1;
        padding-left: 0;
        padding-right: 24px;
    }
    .wheel-area {
        grid-column: 2;
        grid-row: 1;
    }
    .sidebar-right {
        grid-column: 3;
        grid-row: 1;
        padding-left: 24px;
    }
}

.wheel-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 60px 20px 30px;
}

.wheel-wrapper {
    position: relative;
    width: 100%;
    max-width: min(800px, calc(100vh - 310px));
}

.wheel-pointer {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 36px solid var(--accent);
    z-index: 10;
}

canvas {
    width: 100%;
    height: auto;
    display: block;
}

.spin-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 16px 48px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 100px;
    cursor: pointer;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 20px rgba(30, 95, 163, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
    overflow: hidden;
}

.spin-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    opacity: 0;
    transition: opacity 0.15s;
}

.spin-btn:hover::after {
    opacity: 1;
}

.spin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(30, 95, 163, 0.45);
}

.spin-btn:active {
    transform: translateY(0);
}

.spin-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.card h2 .icon {
    font-size: 1.1rem;
}

label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

input[type="text"],
textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s;
    resize: vertical;
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: white;
}

.segments-textarea {
    min-height: 200px;
    font-size: 1rem;
    line-height: 1.7;
}

.hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.5;
}

.btn-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.btn-secondary {
    flex: 1;
    padding: 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.btn-apply {
    width: 100%;
    padding: 10px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.15s;
    margin-top: 10px;
}

.btn-apply:hover {
    opacity: 0.88;
}

.preset-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.preset-btn {
    text-align: left;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text);
}

.preset-btn:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

.preset-label {
    font-weight: bold;
    display: block;
}

.preset-sub {
    color: var(--text-muted);
    font-size: 0.76rem;
}

/* ── Color scheme picker ── */
.scheme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.scheme-btn {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 8px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.15s;
}

.scheme-btn:hover {
    border-color: var(--accent);
}

.scheme-btn.active {
    border-color: var(--accent);
    background: var(--accent-light);
}

.scheme-swatches {
    display: flex;
    height: 18px;
    border-radius: 4px;
    overflow: hidden;
}

.scheme-swatches>div {
    flex: 1;
}

.scheme-label {
    font-size: 0.75rem;
    color: var(--text);
    text-align: center;
    font-weight: bold;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text);
    color: white;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: white;
    border-radius: 20px;
    padding: 40px 48px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    transform: scale(0.85);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-emoji {
    font-size: 3rem;
    margin-bottom: 12px;
}

.modal-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.modal-result {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent);
    line-height: 1.3;
    margin-bottom: 24px;
    word-break: break-word;
}

.modal-close {
    padding: 12px 32px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 100px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.15s;
}

.modal-close:hover {
    opacity: 0.85;
}

.modal-remove {
    padding: 12px 24px;
    background: white;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s;
}

.modal-remove:hover {
    border-color: #c0392b;
    color: #c0392b;
    background: #fdf2f0;
}

#confetti-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 499;
}

footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px 24px;
    padding: 20px 24px;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    line-height: 1.9;
}

@media (max-width: 600px) {
    .footer-text {
        flex: 0 0 100%;
    }
    .footer-logo-link {
        flex: 0 0 100%;
        display: flex;
        justify-content: center;
    }
}

.footer-text {
    flex: 1;
    text-align: center;
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.footer-logo-link {
    flex-shrink: 0;
}

.footer-logo {
    max-width: 220px !important;
    display: block;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: filter 0.3s, opacity 0.3s;
}

.footer-logo:hover {
    filter: grayscale(0);
    opacity: 1;
}

.footer-row {
    margin-bottom: 4px;
}

.footer-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 10px auto;
    max-width: 600px;
}

.footer-impressum {
    font-size: 0.72rem;
    color: #aaa;
}

.badge-ai {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 0.68rem;
    font-weight: bold;
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--border);
    letter-spacing: 0.03em;
}

.share-url-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.share-url-row input {
    flex: 1;
    font-size: 0.78rem;
    padding: 7px 10px;
}

.copy-btn {
    padding: 7px 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
    
    font-weight: bold;
}