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

body {
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #0f172a;
    color: #f8fafc;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    padding: 2rem 0;
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.25), transparent 25%),
                radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.25), transparent 25%);
    filter: blur(60px);
    z-index: 0;
    animation: moveBackground 20s ease-in-out infinite alternate;
}

@keyframes moveBackground {
    0% { transform: scale(1); }
    100% { transform: scale(1.2); }
}

.glass-container {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 3rem 4rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 90vw;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #e0e7ff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

h1 span {
    color: #a855f7;
    -webkit-text-fill-color: initial;
    background: linear-gradient(135deg, #c084fc 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: #94a3b8;
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    font-weight: 300;
    text-align: center;
}

.balls-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.balls-group {
    display: flex;
    gap: 1rem;
}

.superzahl-separator {
    font-size: 2rem;
    color: #64748b;
    font-weight: 300;
}

.ball {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: 
        inset 0 4px 6px rgba(255,255,255,0.2),
        inset 0 -4px 6px rgba(0,0,0,0.3),
        0 10px 15px -3px rgba(0,0,0,0.3);
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.5) translateY(20px);
}

.ball.empty {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
    color: rgba(255, 255, 255, 0.2);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    opacity: 1;
    transform: none;
    text-shadow: none;
}

.ball.show {
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.ball.main {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
}

.ball.super-ball {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.5) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.ball.locked {
    animation: lockPulse 0.3s ease-out;
}

@keyframes lockPulse {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.1); filter: brightness(1.3); box-shadow: 0 0 20px rgba(255,255,255,0.8); }
    100% { transform: scale(1); filter: brightness(1); }
}

.generate-btn {
    background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.25rem;
    font-weight: 500;
    border-radius: 9999px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 10px 20px -5px rgba(126, 34, 206, 0.5);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.generate-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255,255,255,0.1);
    transform: rotate(45deg);
    transition: all 0.3s ease;
    opacity: 0;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(126, 34, 206, 0.6);
}

.generate-btn:hover::after {
    opacity: 1; left: 100%;
}

.generate-btn:active {
    transform: translateY(1px);
}

.button-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 0 auto 1rem auto;
}

.quick-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 9999px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.quick-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.quick-btn:active {
    transform: translateY(1px);
}


/* -- Sidebar & Menü -- */
.top-bar {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 100;
    transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hamburger-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.8rem;
    border-radius: 12px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -350px;
    width: 320px;
    height: 100vh;
    z-index: 95;
    border-radius: 0;
    border-left: none;
    border-top: none;
    border-bottom: none;
    padding: 4rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar.open {
    left: 0;
}

.sidebar-title {
    font-size: 2rem;
    margin-bottom: 2.5rem;
    color: #f8fafc;
    background: linear-gradient(135deg, #e0e7ff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-menu li button {
    width: 100%;
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-menu li button:hover {
    background: rgba(168, 85, 247, 0.2);
    color: #fff;
    border-color: rgba(168, 85, 247, 0.5);
    transform: translateX(8px);
}

/* -- SPA Views -- */
.app-content {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 1rem;
    transition: padding-left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.page-view {
    display: none;
    width: 100%;
    animation: fadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.page-view.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.content-view {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.content-view h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: #f8fafc;
    text-align: center;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close-btn:hover {
    color: white;
}

/* History & Archive List Styling */
.history-list, .archive-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem 1.5rem;
    border-radius: 12px;
}

.archive-item {
    display: grid;
    grid-template-columns: 260px 320px 1fr;
    align-items: center;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem 1.5rem;
    border-radius: 12px;
}

.archive-sum-col {
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    white-space: nowrap;
}

.archive-balls-col {
    display: flex;
    justify-content: flex-start;
    flex-wrap: nowrap !important;
    gap: 0.5rem;
}

.history-date, .archive-timestamp {
    font-size: 1rem;
    color: #94a3b8;
    text-align: left;
    white-space: nowrap;
}

.history-balls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mini-ball {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.1), inset 0 -2px 4px rgba(0,0,0,0.2);
}

.mini-ball.main { background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%); }
.mini-ball.super-ball { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.mini-ball.frequent-ball { background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(34, 197, 94, 0.4); color: #86efac; }
.mini-ball.excluded-ball { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.4); color: #fca5a5; }

.archive-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* Sidebar Open States */
body.sidebar-open .sidebar {
    left: 0;
}

body.sidebar-open .app-content {
    padding-left: 320px;
}

body.sidebar-open .top-bar {
    left: 340px;
}

.hit-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #a7f3d0;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.modal-header-controls {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

#deleteArchiveIconBtn:hover {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

#exportExcelIconBtn:hover {
    color: #86efac;
    border-color: rgba(16, 185, 129, 0.3);
}

/* -- Lottoschein & Summen-Anzeige -- */
#ticketWrapper {
    margin-top: 2.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    width: 100%;
}

.sum-indicator {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    animation: popIn 0.5s ease-out forwards;
}

.sum-indicator.ok {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.sum-indicator.bad {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.sum-label {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-right: 0.5rem;
}

.sum-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.sum-indicator.ok .sum-value { color: #34d399; }
.sum-indicator.bad .sum-value { color: #f87171; }

.sum-message {
    margin-top: 0.8rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.sum-indicator.ok .sum-message { color: #a7f3d0; }
.sum-indicator.bad .sum-message { color: #fca5a5; }

.ticket-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
}

.ticket-title {
    font-size: 1rem;
    color: #94a3b8;
    margin-bottom: 1rem;
    font-weight: 500;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.ticket-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.4rem;
    margin: 0 auto;
    max-width: 300px;
}

.ticket-super-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
    margin: 0 auto;
    max-width: 210px;
}

.ticket-cell {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #cbd5e1;
    position: relative;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ticket-cell.marked.main {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
    transform: scale(1.1);
    z-index: 2;
}

.ticket-cell.marked.super {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4);
    transform: scale(1.1);
    z-index: 2;
}

.ticket-cell.marked.main::before, .ticket-cell.marked.super::before {
    content: '✖';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

/* Rules Styling */
.rule-group h3 {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 1rem;
    font-weight: 400;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.badge {
    font-size: 0.8rem;
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.badge.bad-badge {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Toggle Switch Styling */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #94a3b8;
  transition: .4s;
}
input:checked + .slider {
  background-color: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.5);
}
input:checked + .slider:before {
  transform: translateX(24px);
  background-color: #34d399;
}
.slider.round {
  border-radius: 34px;
}
.slider.round:before {
  border-radius: 50%;
}

/* Info Section Styling */
.info-content p {
    color: #94a3b8;
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 1.1rem;
    text-align: left;
}
.info-content p strong {
    color: #fff;
}

/* Toast Styling */
.toast-container {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 90%;
    max-width: 600px;
}

.toast {
    background: rgba(16, 185, 129, 0.2);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #a7f3d0;
    padding: 1.2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    animation: slideDown 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), fadeOut 0.5s 6.5s forwards;
    text-align: center;
    line-height: 1.4;
}

.toast strong { color: #fff; }

@keyframes slideDown { 0% { transform: translateY(-50px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes fadeOut { 0% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

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

.close-modal-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-modal-btn:hover {
    background: rgba(239, 68, 68, 0.4);
    transform: rotate(90deg);
}

/* === Draw Machine Modal Styling === */
.draw-machine-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.open .draw-machine-container {
    transform: scale(1);
}

.machine-title {
    margin-top: 0;
    margin-bottom: 2rem;
    color: #fff;
    font-size: 1.8rem;
    font-weight: 300;
}

/* The Glass Drum */
.machine-drum {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.02) 60%, rgba(0,0,0,0.3) 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        inset 0 0 20px rgba(255,255,255,0.1),
        0 10px 30px rgba(0,0,0,0.5),
        0 0 30px rgba(99, 102, 241, 0.2); /* faint blue glow */
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Inner highlight for glass sphere */
.machine-drum::before {
    content: '';
    position: absolute;
    top: 5%;
    left: 10%;
    width: 40%;
    height: 20%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
    border-radius: 50%;
    transform: rotate(-30deg);
    pointer-events: none;
    z-index: 10;
}

/* Tumbling balls inside the drum */
.tumbling-ball {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff, #e2e8f0 40%, #94a3b8);
    color: #1e293b;
    font-weight: bold;
    font-size: 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.5s ease-in-out, top 2s ease-in-out, left 2s ease-in-out;
}

.tumbling-ball.super {
    background: radial-gradient(circle at 30% 30%, #fff, #fcd34d 40%, #d97706);
    color: #451a03;
}

.tumbling-ball.highlight-target {
    background: radial-gradient(circle at 30% 30%, #fff, #34d399 40%, #059669);
    color: #fff;
    transform: scale(1.2) !important;
    z-index: 5;
    box-shadow: 0 0 15px #34d399;
}

/* Extraction Tube */
.machine-tube-container {
    width: 60px;
    height: 80px;
    position: relative;
    margin-top: -10px;
    z-index: 2;
}

.machine-tube {
    width: 40px;
    height: 100%;
    margin: 0 auto;
    background: linear-gradient(to right, rgba(255,255,255,0.05), rgba(255,255,255,0.2) 20%, rgba(255,255,255,0.05) 80%, rgba(255,255,255,0.1));
    border-left: 2px solid rgba(255,255,255,0.3);
    border-right: 2px solid rgba(255,255,255,0.3);
    position: relative;
    overflow: hidden;
}

.tube-ball {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff, #e2e8f0 40%, #94a3b8);
    color: #1e293b;
    font-weight: bold;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -40px; /* hidden initially */
}
.tube-ball.super {
    background: radial-gradient(circle at 30% 30%, #fff, #fcd34d 40%, #d97706);
    color: #451a03;
}

@keyframes dropInTube {
    0% { top: -40px; }
    50% { top: 20px; }
    100% { top: 90px; }
}

.tube-ball.dropping {
    animation: dropInTube 0.8s ease-in forwards;
}

/* Rack for drawn balls */
.drawn-rack {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(0,0,0,0.3);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.05);
}

.rack-slot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 2px dashed rgba(255,255,255,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.1rem;
    color: #1e293b;
    position: relative;
}

.rack-slot.super-slot {
    border-color: rgba(245, 158, 11, 0.4);
    margin-left: 0.5rem;
}

.rack-slot .filled-ball {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff, #e2e8f0 40%, #94a3b8);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    animation: popInSlot 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.rack-slot.super-slot .filled-ball {
    background: radial-gradient(circle at 30% 30%, #fff, #fcd34d 40%, #d97706);
    color: #451a03;
}

@keyframes popInSlot {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.skip-btn {
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #94a3b8;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.skip-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* === Mobile Responsiveness === */
@media (max-width: 768px) {
    body {
        padding: 4.5rem 0 2rem 0; /* More top padding for hamburger */
    }

    .top-bar {
        top: 1rem;
        left: 1rem;
    }

    .glass-container { 
        padding: 2rem 1.5rem; 
        max-width: 95vw;
        border-radius: 16px;
    }

    .content-view {
        padding: 1.5rem 1rem;
    }
    
    .content-view h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    h1 {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .balls-container { 
        gap: 0.8rem; 
    }

    .balls-group {
        gap: 0.5rem;
    }

    .ball { 
        width: 45px; 
        height: 45px; 
        font-size: 1.1rem; 
    }

    .superzahl-separator { 
        font-size: 1.5rem;
        margin: 0 0.2rem;
    }

    .generate-btn {
        padding: 0.8rem 2rem;
        font-size: 1.1rem;
    }

    .sum-indicator {
        padding: 1rem;
    }

    .sum-value {
        font-size: 1.3rem;
    }

    .ticket-container {
        padding: 1rem;
    }

    .ticket-cell {
        font-size: 0.85rem;
    }

    .ticket-cell.marked.main::before, .ticket-cell.marked.super::before {
        font-size: 1.4rem;
    }

    .history-item { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 1rem; 
        padding: 1rem;
    }

    .archive-item {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .archive-sum-col {
        justify-content: flex-start;
        text-align: left;
    }

    .archive-balls-col {
        justify-content: flex-start;
    }

    .sidebar { 
        width: 280px; 
        left: -300px; 
        padding: 4rem 1.5rem;
    }

    body.sidebar-open .app-content {
        padding-left: 0;
    }

    body.sidebar-open .top-bar {
        left: 1rem;
    }

    .sidebar-overlay {
        display: block;
        opacity: 0;
        pointer-events: none;
    }

    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .modal-header-controls {
        justify-content: space-between;
    }

    .rule-group h3 {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
