:root {
  --header-height: 64px;
}

body {
  font-family: 'Space Grotesk', 'Inter', 'Segoe UI', system-ui, sans-serif;
  text-align: center;
  background-color: #070b14;
  background-size: 400% 400%;
  color: white;
  min-height: 100vh;
  margin: 0;
  padding: var(--header-height) 0 0;
  position: relative;
  overflow-x: hidden;
}

body.legal-page-body {
  background: #0b1118;
}

#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(11, 16, 32, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1002;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-back-btn {
  width: 32px;
  height: 32px;
  color: rgba(248,250,252,0.65);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
  padding: 0;
  transition: color 0.18s, background 0.18s;
}

.header-back-btn:hover {
  color: #f8fafc;
  background: rgba(255,255,255,0.10);
}

.header-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.88em;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(248,250,252,0.55);
  white-space: nowrap;
  pointer-events: none;
}

@media (max-width: 520px) {
  .header-brand { display: none; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-menu-btn {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  color: rgba(248,250,252,0.65);
  cursor: pointer;
  font-size: 1em;
  align-items: center;
  justify-content: center;
  transition: color 0.18s, background 0.18s;
}

.header-menu-btn:hover {
  color: #f8fafc;
  background: rgba(255,255,255,0.10);
}

.header-menu-btn:focus,
.header-menu-btn:active,
.header-menu-btn:focus-visible {
  outline: none;
}

.header-menu-panel {
  position: fixed;
  top: calc(var(--header-height) + 8px);
  right: 12px;
  background: rgba(11, 16, 32, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1003;
  min-width: 175px;
}

.header-menu-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(248,250,252,0.75);
  border-radius: 9px;
  padding: 0.5em 0.85em;
  text-align: left;
  cursor: pointer;
  font-size: 0.9em;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.header-menu-item:hover {
  background: rgba(255,255,255,0.09);
  color: #f8fafc;
}

.header-menu-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.4em 0.6em;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.header-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.82em;
  padding: 0.38em 0.85em;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(248,250,252,0.65);
  cursor: pointer;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
  white-space: nowrap;
  font-family: inherit;
}

.header-button:hover {
  color: #f8fafc;
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.2);
}

.header-button:focus,
.header-button:active,
.header-button:focus-visible {
  outline: none;
}


.header-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.38em 0.75em 0.38em 0.38em;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  cursor: pointer;
  font-size: 0.82em;
  transition: background 0.18s, border-color 0.18s;
}
.header-profile:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.2);
}

.header-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.header-username {
  font-size: 1em;
  color: #e2e8f0;
}

.header-home-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0.38em 0.85em;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  color: rgba(248,250,252,0.65);
  font-size: 0.82em;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
  white-space: nowrap;
}
.header-home-link:hover {
  color: #f8fafc;
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.2);
}

/*
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(79, 140, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(28, 181, 224, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}*/

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    scrollbar-color: #0f1419 linear-gradient(135deg, #0f1419 0%, #1a2332 25%, #2d4a66 50%, #1a2332 75%, #0f1419 100%);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.95) 100%);
    padding: 20px;
    border-radius: 10px;
    min-width: 300px;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    color: #0C1016;
}

#highscore-modal .modal-content {
    width: min(720px, 92vw);
    color: #e5eef9;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.96));
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#highscore-modal .highscore-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 1em;
}

#highscore-modal .highscore-modal-header h2 {
    margin: 0;
    color: #f8fafc;
}

#event-modal .event-modal-content {
    width: min(460px, 92vw);
    text-align: center;
    color: #e5eef9;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.96));
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#event-modal .event-modal-kicker {
    display: inline-block;
    margin-bottom: 0.9rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.16);
    border: 1px solid rgba(96, 165, 250, 0.28);
    color: #bfdbfe;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#event-modal h2 {
    margin: 0 0 0.7rem;
    color: #f8fafc;
}

#event-modal p {
    margin: 0 0 1.4rem;
    color: #cbd5e1;
    line-height: 1.6;
}

.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 1em;
}

.settings-modal-header h2 {
    margin: 0;
}

#highscore-modal #highscore-list {
    color: #e5eef9;
}

#highscore-modal #highscore-list span {
    color: #e5eef9 !important;
}

#highscore-modal .highscore-loading {
    color: #94a3b8;
}

#profile-modal .modal-content label,
#profile-modal .modal-content h2 {
    color: #111;
}

/* Tooltips und Modals */
#field-tooltip {
    display: none;
    position: fixed;
    z-index: 9999;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: none;
    padding: 0.8em 1.2em;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 0 0 1px rgba(255,255,255,0.1);
    font-size: 0.95em;
    pointer-events: none;
    backdrop-filter: blur(10px);
    color: #333;
    font-weight: 500;
}

#name-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
}

#name-modal .modal-content {
    background: #24354B;
    padding: 2.5em 3em;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3), 
                0 0 0 1px rgba(255,255,255,0.1);
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
}

#name-input {
    font-size: 1.2em;
    padding: 0.8em 1.2em;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

#name-input:focus {
    border-color: #4f8cff;
    background: rgba(255,255,255,0.15);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79,140,255,0.2);
}

#name-confirm-btn {
    font-size: 1.1em;
    padding: 0.8em 2.5em;
    border-radius: 12px;
    background: linear-gradient(135deg, #4f8cff 0%, #1cb5e0 100%);
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1em;
}

#name-confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79,140,255,0.3);
}

#name-error {
    color: #ff6b6b;
    margin-top: 0.8em;
    display: none;
    font-weight: 500;
}

/* Login Options Styling */
.login-options {
    margin: 2em 0;
}

.login-option {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.5em;
    margin: 1em 0;
    text-align: center;
    transition: all 0.3s ease;
}

.login-option:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.1) 100%);
    transform: translateY(-2px);
}

.discord-option {
    border-color: rgba(88, 101, 242, 0.4);
}

.discord-option:hover {
    border-color: rgba(88, 101, 242, 0.6);
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.1) 0%, rgba(88, 101, 242, 0.05) 100%);
}

.guest-option {
    border-color: rgba(156, 163, 175, 0.4);
}

.guest-option:hover {
    border-color: rgba(156, 163, 175, 0.6);
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.1) 0%, rgba(156, 163, 175, 0.05) 100%);
}

.login-option h3 {
    margin: 0 0 0.5em 0;
    font-size: 1.2em;
    color: white;
}

.login-option p {
    margin: 0 0 1em 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95em;
}

.login-divider {
    text-align: center;
    margin: 1.5em 0;
    position: relative;
    display: flex;
    align-items: center;
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%);
}

.login-divider span {
    background: #24354B;
    padding: 0 1em;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
    position: relative;
    z-index: 1;
    margin: 0 auto;
}

.guest-btn {
    background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1em 2em;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.guest-btn:hover {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.3);
}

#name-input-section {
    margin-top: 2em;
    padding-top: 2em;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

#name-section-title {
    color: white;
    margin-bottom: 1em;
    font-size: 1.1em;
}

/* Discord Info Banner */
#discord-info-banner {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #5865F2 0%, #4752C4 100%);
    color: white;
    padding: 0.8em 1em;
    text-align: center;
    font-size: 0.9em;
    font-weight: 500;
    z-index: 1001;
    box-shadow: 0 2px 10px rgba(88, 101, 242, 0.3);
    display: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

#discord-info-banner:hover {
    background: linear-gradient(135deg, #4752C4 0%, #5865F2 100%);
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.4);
}

#discord-info-banner .banner-icon {
    margin-right: 0.5em;
    font-size: 1.1em;
}

#discord-info-banner .banner-text {
    display: inline;
}

#discord-info-banner .banner-action {
    margin-left: 0.5em;
    font-weight: 600;
    text-decoration: underline;
}

/* Anpassung für Body wenn Banner sichtbar ist */
body.discord-banner-visible {
    padding-top: calc(var(--header-height) + 3.2em);
}

body.discord-banner-visible #lobby {
    margin-top: 20px;
}

#settings-btn {
    font-size: 0.82em;
    padding: 0.38em 0.85em;
}

/* Settings Modal */
#settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

#settings-modal .modal-content {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(17, 24, 39, 0.98) 100%);
    padding: 2.5em;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(2, 6, 23, 0.45), 
                0 0 0 1px rgba(255,255,255,0.04);
    border: 1px solid rgba(148, 163, 184, 0.16);
    max-width: 500px;
    width: 90%;
}

#settings-modal h2 {
    margin-top: 0;
    color: #f8fafc;
}

.settings-groups {
    display: grid;
    gap: 1em;
    margin-top: 1.25em;
}

.settings-group {
    padding: 1.15em;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.92) 100%);
    border: 1px solid rgba(148, 163, 184, 0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.settings-group-header {
    margin-bottom: 0.9em;
}

.settings-group-header h3 {
    margin: 0.12em 0 0 0;
    color: #f8fafc;
    font-size: 1.15rem;
}

.settings-group-kicker {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-group-body {
    display: grid;
    gap: 0.85em;
}

.settings-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1em;
    align-items: center;
    padding: 0.95em 1em;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.58);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.settings-item-copy {
    min-width: 0;
}

.settings-item-label {
    display: block;
    margin: 0;
    font-weight: 700;
    color: #f8fafc;
    font-size: 1rem;
    text-shadow: none;
}

.settings-item-help {
    margin: 0.28em 0 0 0;
    color: #94a3b8;
    font-size: 0.92rem;
    line-height: 1.45;
}

.settings-item-control {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Name Input Container */
.name-input-container {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

#settings-name-input {
    flex: 1;
    padding: 0.8em 1em;
    border: 2px solid rgba(96, 165, 250, 0.2);
    border-radius: 1em;
    font-size: 1em;
    background: rgba(30, 41, 59, 0.92);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    color: #e2e8f0;
}

#settings-name-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
    background: rgba(30, 41, 59, 1);
    transform: translateY(-1px);
}

#settings-name-confirm-btn {
    display: none;
    padding: 0.5em 0.8em;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 0.3em;
    cursor: pointer;
    white-space: nowrap;
}

#settings-name-error {
    display: none;
    color: #fca5a5;
    margin-top: 0.5em;
    font-size: 0.9em;
}

/* Discord Button */
#discord-connect-btn {
    padding: 0.4em 0.8em;
    background: #5865F2;
    color: white;
    border: none;
    border-radius: 0.3em;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.discord-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5em;
}

#discord-status {
    color: #94a3b8;
    font-weight: normal;
    font-size: 0.8rem;
    line-height: 1.2;
    display: none;
}

.coming-soon {
    color: #666;
    font-weight: normal;
}

/* Close Button Container */
.settings-close-container {
    text-align: center;
    margin-top: 2em;
}

#settings-close-btn, #highscore-close-btn {
    padding: 0.5em 1em;
    background: rgba(71, 85, 105, 0.95);
    color: white;
    border: none;
    border-radius: 0.3em;
    cursor: pointer;
}

/* Discord Login Modal */
#discord-login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.discord-modal {
    max-width: 500px;
    width: 90%;
    background: white;
    border-radius: 1em;
    padding: 2em;
    text-align: center;
}

.discord-modal h2 {
    color: #5865F2;
    margin-bottom: 1.5em;
}

.discord-info {
    text-align: left;
    margin-bottom: 2em;
    padding: 1em;
    background: #f8f9fa;
    border-radius: 0.5em;
    border-left: 4px solid #5865F2;
}

.discord-info p {
    margin: 0 0 1em 0;
    color: #333;
    font-weight: bold;
}

.discord-info ul {
    margin: 0;
    padding-left: 1.5em;
    color: #555;
}

.discord-info li {
    margin: 0.5em 0;
}

.discord-login-buttons {
    display: flex;
    gap: 1em;
    justify-content: center;
    flex-wrap: wrap;
}

.discord-primary-btn {
    background: #5865F2;
    color: white;
    border: none;
    border-radius: 0.5em;
    padding: 1em 2em;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    transition: all 0.2s ease;
    margin: 0 auto;
}

.discord-primary-btn:hover {
    background: #4752C4;
    transform: translateY(-2px);
}

.discord-secondary-btn {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 0.5em;
    padding: 1em 2em;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.discord-secondary-btn:hover {
    background: #545b62;
    transform: translateY(-2px);
}

/* Discord Verification Section */
.verification-info {
    text-align: left;
    margin-bottom: 1.5em;
    padding: 1em;
    background: #f8f9fa;
    border-radius: 0.5em;
    border-left: 4px solid #28a745;
}

.verification-info p {
    margin: 0 0 0.5em 0;
    color: #333;
    font-weight: bold;
}

.verification-info ol {
    margin: 0.5em 0 0 0;
    padding-left: 1.5em;
    color: #555;
}

.verification-info li {
    margin: 0.3em 0;
}

.verification-info code {
    background: #e9ecef;
    padding: 0.2em 0.4em;
    border-radius: 0.3em;
    font-family: monospace;
    color: #d63384;
    font-weight: bold;
}

.verification-input {
    margin-bottom: 1.5em;
}

.verification-input label {
    display: block;
    margin-bottom: 0.5em;
    color: #333;
    font-weight: bold;
}

#verification-code-input {
    width: 100%;
    padding: 0.8em;
    border: 2px solid #ced4da;
    border-radius: 0.5em;
    font-size: 1.1em;
    text-align: center;
    font-family: monospace;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

#verification-code-input:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
    outline: none;
}

.verification-buttons {
    display: flex;
    gap: 1em;
    justify-content: center;
    flex-wrap: wrap;
}

#verification-error {
    color: #dc3545;
    font-size: 0.9em;
    margin-top: 0.5em;
    text-align: center;
    font-weight: bold;
}

.error-message {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 0.5em;
    padding: 0.5em;
    margin-top: 0.5em;
}

.success-message {
    color: #28a745 !important;
    background: #d4edda !important;
    border: 1px solid #c3e6cb !important;
    border-radius: 0.5em;
    padding: 0.5em;
    margin-top: 0.5em;
}

/* Bestenliste - unter dem Spiel Container */
#highscore-section {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 2em auto 0 auto;
    padding: 0 1em;
    z-index: 1000;
}

.highscore-container {
    background: transparent;
    color: #e5e7eb;
    padding: 2em 1.5em;
    border-radius: 20px;
    border: none;
    box-shadow: none;
}

.highscore-title {
    margin: 0 0 1.5em 0;
    text-align: center;
    font-size: 1.4em;
    font-weight: 700;
    color: #f3f4f6;
}

.highscore-discord-notice {
    text-align: center;
    color: #5865F2;
    font-size: 0.85em;
    margin-bottom: 1.2em;
    padding: 0.8em 1em;
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.1) 0%, rgba(88, 101, 242, 0.05) 100%);
    border-radius: 12px;
    border: 1px solid rgba(88, 101, 242, 0.2);
    transition: all 0.3s ease;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.highscore-discord-notice:hover {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.15) 0%, rgba(88, 101, 242, 0.1) 100%);
    border: 1px solid rgba(88, 101, 242, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(88, 101, 242, 0.15);
}

#highscore-list {
    font-size: 0.95em;
    color: #d1d5db;
}

.highscore-loading {
    text-align: center;
    color: #9ca3af;
    padding: 0.8em;
}

/* Game Area */
#game-area {
    display: none;
}


/* Game Over Overlay */
#game-over-overlay {
    display: none;
}

.game-over-buttons {
    display: flex;
    gap: 1em;
    justify-content: center;
    margin-top: 1.5em;
}

/* Scorecard Container */
#scorecard-container h2 {
    margin: 0 0 10px 0;
}

/* Roll Button */
#roll {
    margin-top: 10px;
}

.lobby-code {
    filter: blur(4px);
    transition: filter 0.3s ease;
    cursor: pointer;
}

.lobby-code:hover {
    filter: blur(0px);
}

#waiting {
  width: min(720px, calc(100vw - 32px));
  margin: 92px auto 24px auto;
  padding: 1.8em;
  box-sizing: border-box;
  border-radius: 28px;
  color: #e5eef9;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.45);
  text-align: left;
}

#waiting h2 {
  margin: 0 0 1em 0;
  color: #f8fafc;
}

.waiting-code-wrap {
  margin-bottom: 0;
  transition: margin-bottom 0.3s ease;
}

.waiting-code-label {
  margin: 0 0 0.35em 0;
  color: #94a3b8;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.waiting-code-value {
  padding: 0.55em 1em;
  background: rgba(37, 99, 235, 0.14);
  border: 2px solid rgba(96, 165, 250, 0.75);
  border-radius: 14px;
  display: inline-block;
  font-size: 1.2em;
  transition: all 0.3s ease;
  user-select: all;
  color: #f8fafc;
}

.waiting-copy-success {
  color: #4ade80;
  font-weight: 700;
  margin: 0;
  opacity: 0;
  height: 0;
  transition: all 0.3s ease;
  overflow: hidden;
}

.waiting-room-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85em;
  margin-top: 1.4em;
}

.waiting-summary-card {
  display: grid;
  gap: 0.2em;
  padding: 0.95em 1em;
  border-radius: 18px;
  background: rgba(30, 41, 59, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.waiting-summary-card strong {
  color: #f8fafc;
  font-size: 1.1rem;
}

.waiting-summary-label {
  color: #94a3b8;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.waiting-players-section {
  margin-top: 1.3em;
  padding: 1em;
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.waiting-players-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  margin-bottom: 0.9em;
  color: #cbd5e1;
  font-weight: 700;
}

.waiting-player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75em;
}

.waiting-player-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.7em 0.9em;
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.22);
}

.waiting-player-main {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
}

.waiting-player-chip-host {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(120, 53, 15, 0.38);
}

.waiting-player-chip-self {
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(30, 64, 175, 0.28);
}

.waiting-player-name {
  color: #f8fafc;
  font-weight: 700;
}

.waiting-player-role {
  padding: 0.2em 0.55em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 700;
}

.waiting-kick-btn {
  margin: 0 0 0 auto;
  padding: 0.45em 0.8em;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.18);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.3);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: none;
}

.waiting-kick-btn:hover,
.waiting-kick-btn:focus {
  background: rgba(220, 38, 38, 0.32);
  color: #fff;
  transform: translateY(-1px);
}

.waiting-player-empty {
  width: 100%;
  padding: 0.9em 1em;
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.72);
  color: #94a3b8;
  text-align: center;
}

.waiting-actions {
  margin-top: 1.2em;
}

.waiting-start-btn {
  font-size: 1.05em;
  padding: 0.75em 1.3em;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  color: #fff;
  cursor: pointer;
}

.waiting-start-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.waiting-host-note {
  margin: 0;
  color: #cbd5e1;
  font-weight: 600;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 30px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background-color: #007bff;
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(30px);
}


/* Discord Avatar Styling */
.discord-avatar {
    transition: transform 0.2s ease;
}

.discord-avatar:hover {
    transform: scale(1.1);
}

/* Eingabefelder sollen weiterhin markierbar bleiben */
input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Textarea Styling */
textarea {
    padding: 0.8em 1.2em;
    border: 2px solid rgba(79, 140, 255, 0.3);
    border-radius: 1.5em;
    font-size: 1.1em;
    margin: 0.3em 0.2em;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(79, 140, 255, 0.1);
    color: #234;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}

textarea:focus {
    border: 2px solid #1cb5e0;
    box-shadow: 0 0 0 3px rgba(28, 181, 224, 0.2), 0 8px 25px rgba(79, 140, 255, 0.15);
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

/* Würfelanimationen */
@keyframes diceRoll {
    0% { 
        transform: rotate(0deg) scale(1); 
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    25% { 
        transform: rotate(90deg) scale(1.05) translateY(-3px); 
        background: #f5f5f5;
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
    50% { 
        transform: rotate(180deg) scale(1.1) translateY(-5px); 
        background: #e8e8e8;
        box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    }
    75% { 
        transform: rotate(270deg) scale(1.05) translateY(-3px); 
        background: #f0f0f0;
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
    100% { 
        transform: rotate(360deg) scale(1) translateY(0px); 
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
}

@keyframes diceShake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    10% { transform: translateX(-2px) rotate(-1deg); }
    20% { transform: translateX(2px) rotate(1deg); }
    30% { transform: translateX(-2px) rotate(-0.5deg); }
    40% { transform: translateX(2px) rotate(0.5deg); }
    50% { transform: translateX(-1px) rotate(-0.5deg); }
    60% { transform: translateX(1px) rotate(0.5deg); }
    70% { transform: translateX(-1px) rotate(-0.5deg); }
    80% { transform: translateX(1px) rotate(0.5deg); }
    90% { transform: translateX(-0.5px) rotate(0deg); }
}

.die.rolling {
    animation: diceRoll 0.6s ease-out;
    transform-origin: center;
    z-index: 10;
    position: relative;
}

.die.shaking {
    animation: diceShake 0.4s ease-in-out;
}

/* Startseiten-Container */
#lobby {
  max-width: 480px;
  margin: 80px auto 0 auto;
  background: rgba(255,255,255,0.042);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  padding: 3em 2.5em 2.5em 2.5em;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.075);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

#lobby::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79,142,247,0.6), rgba(155,110,243,0.6), transparent);
}

#lobby h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2.5em;
  margin-bottom: 1.5em;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-shadow: none;
  background: linear-gradient(140deg, #dde3f5 25%, #7c9ef5 65%, #9b6ef3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#lobby button {
  display: block;
  width: 100%;
  margin: 1em auto;
  font-size: 1em;
  padding: 0.9em 0;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.07);
  color: rgba(221,227,245,0.85);
  font-weight: 600;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

#lobby button::before { display: none; }

#lobby button:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

.home-page #lobby {
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
  margin-top: 72px;
  padding: 3.2em 3em 2.8em 3em;
  box-sizing: border-box;
  background: rgba(255,255,255,0.042);
}

.home-page #lobby::after { display: none; }

.home-page #lobby h1 {
  margin: 0.25em 0 0.45em 0;
  font-size: clamp(2.6rem, 5vw, 4.3rem);
  line-height: 0.97;
}

.home-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  background: rgba(61,220,132,0.07);
  border: 1px solid rgba(61,220,132,0.18);
  color: rgba(61,220,132,0.82);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-online-badge {
  color: rgba(61,220,132,0.95);
  font-weight: 700;
}

.home-hero-copy {
  max-width: 560px;
  margin: 0 auto 1.35em auto;
  color: #58698e;
  font-size: 1rem;
  line-height: 1.65;
}

.home-feature-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6em;
  margin-bottom: 1.8em;
}

.home-feature-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35em 0.85em;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  color: rgba(221,227,245,0.65);
  font-size: 0.84rem;
  font-weight: 500;
}

.home-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  justify-items: center;
  gap: 1em;
  max-width: 520px;
  margin: 0 auto;
}

.home-page #lobby .home-action-grid button {
  margin: 0;
}

.home-page #lobby #event-btn {
  grid-column: 1 / -1;
  width: min(240px, 100%);
}

.home-whats-new-section {
  width: min(760px, calc(100vw - 32px));
  margin: 20px auto 0 auto;
  box-sizing: border-box;
}

.home-whats-new {
  margin: 0 auto;
  padding: 1.25em;
  text-align: left;
  border-radius: 20px;
  background: rgba(255,255,255,0.042);
  border: 1px solid rgba(255,255,255,0.075);
  box-shadow: 0 18px 40px rgba(0,0,0,0.3);
}

.home-whats-new-label {
  margin-bottom: 0.85em;
  color: rgba(221,227,245,0.45);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-whats-new-list {
  display: grid;
  gap: 0.6em;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-whats-new-item {
  display: grid;
  gap: 0.2em;
  padding: 0.85em 1em;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
}

.home-whats-new-item strong {
  color: #dde3f5;
  font-size: 0.9rem;
}

.home-whats-new-item span {
  color: #58698e;
  font-size: 0.84rem;
  line-height: 1.5;
}

.site-footer {
  width: 100%;
  margin-top: 72px;
  padding: 36px 24px 34px 24px;
  box-sizing: border-box;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 32%),
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(7, 11, 18, 0.98), rgba(10, 14, 22, 1));
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 -12px 36px rgba(2, 6, 23, 0.28);
}

.site-footer-inner {
  width: min(1200px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) auto;
  align-items: end;
  gap: 2em;
  padding: 0;
  color: #cbd5e1;
  box-sizing: border-box;
}

.site-footer-brand {
  text-align: left;
}

.site-footer-kicker {
  display: inline-flex;
  align-items: center;
  padding: 0.35em 0.8em;
  margin-bottom: 0.9em;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: #93c5fd;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-footer-brand strong {
  display: block;
  margin-bottom: 0.55em;
  color: #f8fafc;
  font-size: 1.18rem;
  letter-spacing: 0.03em;
}

.site-footer-copy {
  margin: 0;
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 520px;
}

.site-footer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1em;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
}

.site-footer-links a {
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 700;
  opacity: 0.9;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.site-footer-links a:hover {
  color: #93c5fd;
  opacity: 1;
}

.site-footer-socials {
  display: flex;
  justify-content: flex-end;
  gap: 0.75em;
}

.site-footer-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.76);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.site-footer-socials a:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(96, 165, 250, 0.4);
  transform: translateY(-2px);
}

.legal-page {
  width: min(860px, calc(100vw - 32px));
  margin: 84px auto 32px auto;
}

.legal-card {
  padding: 2em;
  text-align: left;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,250,252,0.97));
  color: #0f172a;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

.legal-card h1 {
  margin-top: 0;
  margin-bottom: 0.8em;
}

.legal-card h2 {
  margin-top: 1.5em;
  margin-bottom: 0.45em;
  color: #1e293b;
}

.legal-card p {
  color: #334155;
  line-height: 1.65;
}

.legal-back-link {
  display: inline-block;
  margin-bottom: 1em;
  color: #2563eb;
  text-decoration: none;
  font-weight: 700;
}

.legal-back-link:hover {
  text-decoration: underline;
}

.home-secondary-section {
  margin-top: 36px;
}

.home-howto-section {
  width: min(760px, calc(100vw - 32px));
  margin: 18px auto 0 auto;
  box-sizing: border-box;
}

.home-howto {
  padding: 1.25em;
  text-align: left;
  border-radius: 20px;
  background: rgba(255,255,255,0.042);
  border: 1px solid rgba(255,255,255,0.075);
  box-shadow: 0 18px 40px rgba(0,0,0,0.3);
}

.home-howto-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6em;
}

.home-howto-step {
  display: grid;
  gap: 0.35em;
  padding: 1em;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
}

.home-howto-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(79,142,247,0.15);
  border: 1px solid rgba(79,142,247,0.3);
  color: #7ab0fa;
  font-size: 0.82rem;
  font-weight: 700;
}

.home-howto-step strong {
  color: #dde3f5;
  font-size: 0.9rem;
}

.home-howto-step span:last-child {
  color: #58698e;
  font-size: 0.84rem;
  line-height: 1.5;
}

.multiplayer-page {
  max-width: 720px !important;
}

.multiplayer-intro {
  margin: -0.75em 0 1.75em 0;
  color: #4a5568;
  font-size: 1rem;
}

.lobby-section {
  margin-top: 1.5em;
  text-align: left;
}

.lobby-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1em;
  margin-top: 1.5em;
}

.lobby-actions-row button {
  margin: 0 !important;
}

.create-room-options {
  display: grid;
  gap: 0.9em;
}

.create-room-modal-content {
  max-width: 460px;
}

#create-room-modal {
  background:
    radial-gradient(circle at top, rgba(99, 102, 241, 0.18), transparent 35%),
    rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(14px);
}

#create-room-modal .create-room-modal-content {
  width: min(92vw, 460px);
  padding: 1.8em;
  border-radius: 24px;
  color: #e5eef9;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#create-room-modal .create-room-modal-content h2 {
  margin: 0 0 0.25em 0;
  color: #f8fafc;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

#create-room-modal .create-room-options::before {
  content: 'Lege fest, ob die Lobby oeffentlich oder privat mit Passwort sein soll.';
  display: block;
  margin-bottom: 0.15em;
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.45;
}

#private-join-modal {
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.18), transparent 35%),
    rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(12px);
}

#join-room-modal {
  background:
    radial-gradient(circle at top, rgba(16, 185, 129, 0.16), transparent 35%),
    rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(12px);
}

#private-join-modal .private-join-modal-content {
  width: min(90vw, 380px);
  padding: 1.55em;
  border-radius: 22px;
  color: #e5eef9;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

#join-room-modal .private-join-modal-content {
  width: min(90vw, 380px);
  padding: 1.55em;
  border-radius: 22px;
  color: #e5eef9;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

#private-join-modal h2 {
  margin: 0 0 0.25em 0;
  color: #f8fafc;
}

#join-room-modal h2 {
  margin: 0 0 0.25em 0;
  color: #f8fafc;
}

.private-join-room-label {
  margin: 0 0 1em 0;
  color: #94a3b8;
}

.create-room-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75em;
  margin-top: 0.4em;
}

.private-room-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  width: 100%;
  padding: 1em 1.1em;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(30, 41, 59, 0.72);
  color: #e2e8f0;
  font-weight: 600;
  box-sizing: border-box;
}

.private-room-toggle input {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 54px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.95);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.private-room-toggle input::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f8fafc, #cbd5e1);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.35);
  transition: transform 0.2s ease;
}

.private-room-toggle input:checked {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  border-color: rgba(129, 140, 248, 0.65);
}

.private-room-toggle input:checked::before {
  transform: translateX(23px);
}

.private-room-password-wrap {
  display: block;
}

#create-room-modal input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  padding: 0.95em 1em;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#private-join-modal input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  padding: 0.95em 1em;
  margin-bottom: 1em;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
}

#join-room-modal .join-modal-input {
  display: block;
  width: 100%;
  height: 54px;
  box-sizing: border-box;
  padding: 0 1em;
  margin-bottom: 1em;
  font-size: 1rem;
  line-height: 54px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  font-family: inherit;
}

#create-room-modal input[type="password"]::placeholder {
  color: #64748b;
}

#private-join-modal input[type="password"]::placeholder {
  color: #64748b;
}

#join-room-modal .join-modal-input::placeholder {
  color: #64748b;
}

#join-room-modal .join-modal-input::-ms-reveal,
#join-room-modal .join-modal-input::-ms-clear {
  display: none;
}

#create-room-modal #create-room-confirm-btn {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
}

#join-room-modal #join-room-confirm-btn {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
}

.join-options-static {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 0.75em;
}

.multiplayer-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  margin-bottom: 0.75em;
}

.multiplayer-list-header h2 {
  margin: 0;
  color: #234;
  font-size: 1.2rem;
}

#lobby .secondary-lobby-btn {
  width: auto;
  margin: 0;
  padding: 0.85em 1.2em;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
  box-shadow: 0 8px 24px rgba(45, 55, 72, 0.18);
}

#create-room-modal .secondary-lobby-btn {
  width: 100%;
  margin: 0;
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(30, 41, 59, 0.84);
  box-shadow: none;
}

#join-room-modal .secondary-lobby-btn {
  width: 100%;
  margin: 0;
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(30, 41, 59, 0.84);
  box-shadow: none;
}

.open-room-status {
  margin: 0 0 1em 0;
  color: #4a5568;
}

.open-room-list {
  display: grid;
  gap: 1em;
}

.open-room-card {
  padding: 1.1em;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(102, 126, 234, 0.15);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.open-room-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1em;
  margin-bottom: 0.6em;
}

.open-room-card-title-group {
  min-width: 0;
}

.open-room-title {
  color: #000;
  font-size: 1.05rem;
  font-weight: 800;
}

.open-room-card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35em;
  flex-shrink: 0;
}

.open-room-meta {
  color: #4a5568;
  font-size: 0.95rem;
  line-height: 1.45;
}

.open-room-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.2em 0.55em;
  border-radius: 999px;
  background: rgba(72, 187, 120, 0.12);
  color: #2f855a;
  font-size: 0.8rem;
  font-weight: 700;
}

.private-room-badge {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
}

.open-room-players {
  font-weight: 700;
  color: #667eea;
}

#lobby .join-open-room-btn {
  margin: 1em 0 0 0;
}

#lobby button:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(102,126,234,0.35);
}

#lobby label, #lobby input, #lobby select {
  font-size: 1.1em;
  margin-top: 0.8em;
  color: #374151;
  font-weight: 500;
}

/* Bestenliste für alle Bildschirmgrößen - unter dem Spiel */
#highscore-section {
  position: relative !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  right: auto !important;
  max-width: 600px !important;
  min-width: 320px !important;
  width: 95% !important;
  margin: 8em auto 3em auto !important;
  padding: 0 1.5em !important;
  z-index: 500 !important;
}

#highscore-section > div {
  max-width: 500px !important;
  margin: 0 auto !important;
  border-radius: 20px !important;
  background: linear-gradient(135deg, rgba(45, 55, 72, 0.95) 0%, rgba(55, 65, 81, 0.95) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(79, 140, 255, 0.3);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3), 
              0 8px 32px rgba(0,0,0,0.2);
  overflow: hidden;
  position: relative;
}

#highscore-section > div::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

@media (max-width: 768px) {
  /* Mobile Layout */
  :root {
    --header-height: 56px;
  }

  body {
    padding: var(--header-height) 0 0;
    margin: 0;
  }

  #site-header {
    padding: 0 14px;
  }

  .header-back-btn {
    width: 32px;
    height: 32px;
    margin-right: 6px;
  }

  .header-brand {
    font-size: 0.85em;
  }

  .header-username {
    display: none;
  }

  .header-actions {
    display: none;
  }

  .header-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Discord Banner Mobile Anpassung */
  #discord-info-banner {
    font-size: 0.8em;
    padding: 0.6em 0.8em;
  }

  body.discord-banner-visible {
    padding-top: calc(var(--header-height) + 2.8em);
  }

  body.discord-banner-visible #lobby {
    margin-top: 20px;
  }

  /* Lobby - über die ganze Breite */
  #lobby {
    max-width: 100vw !important;
    margin: 80px 0 0 0 !important;
    padding: 1.5em 1em !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: rgba(255,255,255,0.042) !important;
    min-height: auto !important;
  }

  #lobby h1 {
    font-size: 1.8em !important;
    margin-bottom: 1em !important;
  }

  #lobby button {
    width: 100% !important;
    font-size: 1.1em !important;
    padding: 1em 0 !important;
    margin: 0.5em 0 !important;
    border-radius: 0.5em !important;
  }

  .home-page #lobby {
    padding: 1.6em 1.1em !important;
    border-radius: 20px !important;
    border: 1px solid rgba(255,255,255,0.075) !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4) !important;
    margin: 80px 10px 0 10px !important;
    max-width: calc(100vw - 20px) !important;
    font-size: 1em !important;
  }

  .home-action-grid {
    grid-template-columns: 1fr;
    gap: 0.6em;
  }

  .home-page #lobby .home-action-grid button {
    background: rgba(255,255,255,0.10) !important;
    border-color: rgba(255,255,255,0.18) !important;
    color: rgba(221,227,245,0.95) !important;
  }

  .home-hero-badge {
    font-size: 9.5px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3em;
  }

  .home-feature-row {
    gap: 0.5em;
    margin-bottom: 1.25em;
  }

  .home-whats-new-section {
    width: calc(100vw - 20px);
    margin-top: 12px;
  }

  .home-whats-new {
    padding: 1em !important;
  }

  .home-whats-new-list {
    grid-template-columns: 1fr;
  }

  .home-howto-section {
    width: calc(100vw - 20px);
  }

  .home-howto {
    padding: 1em !important;
  }

  .home-howto-grid {
    grid-template-columns: 1fr;
  }

  .lobby-actions-row {
    grid-template-columns: 1fr;
    gap: 0.5em;
  }

  .join-options-static {
    grid-template-columns: 1fr;
  }

  .multiplayer-list-header {
    flex-direction: column;
    align-items: stretch;
  }

  .site-footer {
    padding: 24px 14px 26px 14px;
  }

  .site-footer-inner {
    grid-template-columns: 1fr;
    gap: 1em;
    text-align: center;
    align-items: center;
  }

  .site-footer-brand {
    text-align: center;
  }

  .site-footer-meta {
    align-items: center;
  }

  .site-footer-copy {
    max-width: none;
  }

  .site-footer-links,
  .site-footer-socials {
    justify-content: center;
  }

  #lobby .secondary-lobby-btn {
    width: 100% !important;
  }

  /* Bestenliste - unter dem Lobby-Container im normalen Fluss für Mobile */
  #highscore-section {
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    right: auto !important;
    max-width: calc(100vw - 40px) !important;
    min-width: 280px !important;
    width: calc(100% - 40px) !important;
    margin: 60px auto 20px auto !important;
    padding: 0 !important;
    z-index: auto !important;
  }

  #highscore-section > div {
    max-width: 500px !important;
    margin: 0 auto !important;
    border-radius: 0.8em !important;
  }

  /* Verstecke Zoom-Funktionen */
  * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }

  /* Ausnahme für Input-Felder */
  input, textarea {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
  }

  /* Settings Modal für Mobile */
  #settings-modal > div {
    width: 95% !important;
    max-width: 400px !important;
    margin: 0 auto !important;
    padding: 1.5em !important;
  }

  /* Name Modal für Mobile */
  #name-modal > div {
    width: 90% !important;
    max-width: 350px !important;
    padding: 1.5em !important;
  }

  #name-modal input {
    width: 90% !important;
    padding: 0.8em !important;
    font-size: 1.1em !important;
  }
}

@media (max-width: 600px) {
  #lobby {
    max-width: 98vw;
    padding: 1.2em 0.5em;
  }

  #settings-modal > div {
    width: 96vw !important;
    max-width: 96vw !important;
    padding: 1.2em !important;
    margin: 0 auto !important;
  }

  .settings-group {
    padding: 0.9em !important;
  }

  .settings-item {
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
  }

  .settings-item-control {
    justify-content: flex-start !important;
  }

  #settings-modal input,
  #settings-modal select {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  #settings-modal .name-input-container,
  #settings-modal .discord-container {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  #lobby button {
    font-size: 1em;
    padding: 0.6em 0;
  }
}



#dice {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
  margin-bottom: 1.5em;
}

#roll, 
#toggle-sound {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 18px 36px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(102,126,234,0.25);
    transition: all 0.3s ease;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#roll::before, 
#toggle-sound::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

#roll:hover::before,
#toggle-sound:hover::before {
    left: 100%;
}

#roll:hover, 
#toggle-sound:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  box-shadow: 0 12px 40px rgba(102,126,234,0.35);
  transform: translateY(-3px);
}

#roll:disabled {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
  color: #d1d5db;
  cursor: not-allowed;
  box-shadow: 0 4px 16px rgba(156,163,175,0.15);
  transform: none;
  opacity: 0.6;
}

#roll:disabled::before {
  display: none;
}



.active-player {
    background: rgba(255,224,102,0.18) !important;
    color: #ffe066 !important;
    font-weight: bold !important;
    border-color: rgba(255,224,102,0.3) !important;
}

.die {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
  color: #1e293b;
  font-size: 28px !important;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35),
              0 4px 16px rgba(0,0,0,0.2),
              inset 0 1px 0 rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.die::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
  transform: rotate(45deg);
  transition: all 0.6s ease;
  opacity: 0;
}

.die:hover::before {
  opacity: 1;
  animation: shimmer 0.6s ease;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

.die:hover {
  transform: translateY(-2px) scale(1.05);
  background: rgba(255,255,255,0.13);
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4),
              0 6px 20px rgba(0,0,0,0.25),
              inset 0 1px 0 rgba(255,255,255,0.18);
}

.die.held {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  box-shadow: 0 8px 32px rgba(240,147,251,0.3), 
              0 4px 16px rgba(240,147,251,0.2),
              inset 0 1px 0 rgba(255,255,255,0.3);
  border: 2px solid rgba(240,147,251,0.5);
}

.die.dice-dots {
  font-size: 45px;
  line-height: 1;
  padding: 2px;
}

.die.dice-dots img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

#dice {
    display: flex;
    justify-content: center;
    gap: 0.6em;
    margin-top: 20px;
}


td.clickable {
    cursor: pointer;
    background: rgba(79,142,247,0.12);
    transition: all 0.3s ease;
}

td.clickable:hover {
    background: rgba(79,142,247,0.22);
    transform: scale(1.02);
}

#scorecard-container {
  margin-top: 10px;
  background: rgba(255,255,255,0.042);
  backdrop-filter: blur(16px);
  color: rgba(221,227,245,0.9);
  max-width: 1000px;
  min-width: 400px;
  margin-inline: auto;
  padding: 12px 16px 16px 16px;
  border-radius: 1.5em;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.075);
}



@media (max-width: 500px) {
  #scorecard-container {
    width: 100%;
    padding: 8px;
    font-size: 0.95rem;
  }
}

#scorecard {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(79, 140, 255, 0.1);
}

#scorecard td, #scorecard th {
  border: 1px solid rgba(255,255,255,0.07);
  padding: 8px 6px;
  min-width: 85px;
  text-align: center;
  background: transparent;
  color: rgba(221,227,245,0.85);
  transition: all 0.2s ease;
}

#scorecard th {
  background: rgba(255,255,255,0.05);
  font-size: 1.05em;
  font-weight: 600;
  color: rgba(221,227,245,0.9);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

#scorecard th:first-child,
#scorecard td:first-child {
    min-width: 140px;
    max-width: 180px;
    font-weight: 600;
    font-size: 1em;
    background: rgba(255,255,255,0.03);
    color: rgba(221,227,245,0.75);
}

.score-row {
  cursor: pointer;
  transition: all 0.2s ease;
}

.score-row:hover {
  background: rgba(255,255,255,0.04);
}

.score-row:hover td {
  background: rgba(255,255,255,0.04);
  transform: translateX(2px);
}
.score-row.used {
  background-color: rgba(255,255,255,0.025);
  cursor: not-allowed;
  opacity: 0.55;
}

.score-row.available {
  background: rgba(61,220,132,0.08);
}

.score-row.available:hover {
  background: rgba(61,220,132,0.14);
  transform: translateX(3px);
}

.score-row.available td {
  background: inherit;
  color: rgba(61,220,132,0.9);
  font-weight: 500;
}

.score-row.available td:first-child {
  background: rgba(61,220,132,0.05);
  color: rgba(61,220,132,0.9);
  font-weight: 600;
}


.thick-border-top {
  border-top: 2px solid rgba(255,255,255,0.18) !important;
}

.thick-border-bottom {
  border-bottom: 2px solid rgba(255,255,255,0.18) !important;
}


.spacer-row td {
  padding: 8px 0;
  background: transparent;
}




.filled-field {
    background: rgba(61,220,132,0.06);
    color: rgba(221,227,245,0.75) !important;
}


#game-over-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
#game-over-content {
  background: rgba(18,22,33,0.96);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(221,227,245,0.9);
  padding: 40px 32px;
  border-radius: 16px;
  text-align: center;
  min-width: 300px;
}
#restart-btn, #main-menu-btn {
  margin-top: 24px;
  padding: 12px 28px;
  font-size: 1.1rem;
  border-radius: 8px;
  border: none;
  background: linear-gradient(90deg, #4e54c8 0%, #8f94fb 100%);
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}
#restart-btn:hover, #main-menu-btn:hover {
  background: linear-gradient(90deg, #8f94fb 0%, #4e54c8 100%);
}


/* Buttons */
button {
    background: linear-gradient(90deg, #4f8cff 0%, #1cb5e0 100%);
    color: #fff;
    border: none;
    border-radius: 1.2em;
    padding: 0.6em 1.5em;
    margin: 0.3em 0.2em;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(79,140,255,0.08);
    transition: background 0.2s, transform 0.1s;
}
button:hover, button:focus {
    background: linear-gradient(90deg, #1cb5e0 0%, #4f8cff 100%);
    transform: translateY(-2px) scale(1.04);
    outline: none;
}
button:disabled, button.inactive {
    background: #ccc;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
}

/* Eingabefelder */
input[type="text"], input[type="number"], input[type="password"], input[type="email"], input[type="search"], input[type="tel"], input[type="url"], input[type="input"] {
    padding: 0.8em 1.2em;
    border: 2px solid rgba(79, 140, 255, 0.3);
    border-radius: 1.5em;
    font-size: 1.1em;
    margin: 0.3em 0.2em;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(79, 140, 255, 0.1);
    color: #234;
}
input:focus {
    border: 2px solid #1cb5e0;
    box-shadow: 0 0 0 3px rgba(28, 181, 224, 0.2), 0 8px 25px rgba(79, 140, 255, 0.15);
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

/* Select */
select {
    padding: 0.8em 1.2em;
    border: 2px solid rgba(79, 140, 255, 0.3);
    border-radius: 1.5em;
    font-size: 1.1em;
    margin: 0.3em 0.2em;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 140, 255, 0.1);
    color: #234;
    cursor: pointer;
}
select:focus {
    border: 2px solid #1cb5e0;
    box-shadow: 0 0 0 3px rgba(28, 181, 224, 0.2), 0 8px 25px rgba(79, 140, 255, 0.15);
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

/* Label */
label {
    font-weight: 600;
    color: #234;
    margin-bottom: 0.4em;
    display: inline-block;
    font-size: 1.05em;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Einladungslink */
#invite-link {
    background: linear-gradient(135deg, rgba(79, 140, 255, 0.1) 0%, rgba(28, 181, 224, 0.1) 100%);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(79, 140, 255, 0.2);
    border-radius: 1.5em;
    padding: 1em 1.5em;
    margin: 1.2em 0 0.8em 0;
    font-size: 1.1em;
    color: #234;
    box-shadow: 0 8px 25px rgba(79, 140, 255, 0.12);
    position: relative;
    overflow: hidden;
}

#invite-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}


.input-box {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 251, 255, 0.95) 100%);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(79, 140, 255, 0.3);
    border-radius: 1.8em;
    padding: 1em 2em;
    margin: 1.5em auto 1.2em auto;
    display: inline-block;
    box-shadow: 0 8px 25px rgba(79, 140, 255, 0.15);
    position: relative;
    transition: all 0.3s ease;
}

.input-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(79, 140, 255, 0.2);
    border-color: rgba(28, 181, 224, 0.5);
}

.input-box label {
    font-size: 1.15em;
    color: #234;
    font-weight: 600;
}

.empty-row {
    height: 2px;
    border-left: none !important;
    border-right: none !important;
    background: transparent !important;
}
.empty-row td {
    height: 10px !important;
    padding: 0 !important;
    border: none !important;
    border-top: 2px solid rgba(255,255,255,0.12) !important;
    background: transparent !important;
}



#user-name-display {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0.8em;
    padding: 0.5em;
}
#user-name-display:hover {
    background: linear-gradient(135deg, rgba(79, 140, 255, 0.1) 0%, rgba(28, 181, 224, 0.1) 100%);
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(79, 140, 255, 0.2);
}

.score-row.selected {
  background: linear-gradient(135deg, #ffe066 0%, #ffeb99 100%) !important;
  box-shadow: 0 4px 15px rgba(255, 224, 102, 0.4) !important;
  transform: scale(1.02) !important;
  border-radius: 0.5em !important;
  animation: selectedPulse 2s infinite;
}

@keyframes selectedPulse {
  0%, 100% { box-shadow: 0 4px 15px rgba(255, 224, 102, 0.4); }
  50% { box-shadow: 0 6px 20px rgba(255, 224, 102, 0.6); }
}

/* Mobile Optimierung für Startseite */
@media (max-width: 768px) {
    /* Prevent zoom and enable touch scrolling */
    html, body {
        touch-action: manipulation;
        -webkit-text-size-adjust: 100%;
        -ms-touch-action: manipulation;
    }
    
    /* Lobby - ganze Breite, unter Header */
    #lobby {
        position: static !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        width: 100% !important;
        margin: 80px auto 20px auto !important;
        text-align: center !important;
        min-height: auto !important;
        max-width: 350px !important;
        padding: 20px 20px !important;
        font-size: 0.6em !important;
        border-radius: 10px !important;
        order: 1 !important; /* Stelle sicher, dass die Lobby zuerst kommt */
    }
    #waiting{
      order: 1 !important;
      width: calc(100vw - 24px) !important;
      margin: 80px auto 20px auto !important;
      padding: 1.15em !important;
      border-radius: 20px !important;
    }

    #waiting h2 {
        font-size: 1.55rem !important;
    }

    .waiting-room-summary {
        grid-template-columns: 1fr !important;
    }

    .waiting-players-header {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .waiting-player-chip {
        width: 100% !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
    }

    .waiting-start-btn {
        width: 100% !important;
        margin: 0 !important;
    }
    
    #lobby h1 {
        font-size: 2.5em !important;
        margin-bottom: 1.5em !important;
    }
    
    #lobby button {
        width: 100% !important;
        max-width: 280px !important;
        margin: 0.8em auto !important;
        padding: 1em !important;
        font-size: 1.3em !important;
        display: block !important;
        text-align: center !important;
    }
    
    /* Bestenliste - unter dem Lobby-Container im normalen Fluss für Mobile */
    #highscore-section {
        position: static !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        right: auto !important;
        max-width: calc(100vw - 40px) !important;
        min-width: 280px !important;
        width: calc(100% - 40px) !important;
        margin: 100px auto 20px auto !important;
        padding: 0 !important;
        order: 2 !important;
        z-index: auto !important;
    }
    
    #highscore-section > div {
        max-width: 500px !important;
        margin: 0 auto !important;
        border-radius: 0.8em !important;
        background: linear-gradient(135deg, rgba(45, 55, 72, 0.95) 0%, rgba(55, 65, 81, 0.95) 100%);
    }
    
    /* Modal für Mobile anpassen */
    #settings-modal > div {
        width: 95% !important;
        max-width: 400px !important;
        padding: 1.5em !important;
    }

    .settings-item {
        grid-template-columns: 1fr !important;
    }

    #settings-modal input {
        width: 100% !important;
        font-size: 1em !important;
    }
    
    /* Zoom-Prävention */
    input, select, textarea, button {
        font-size: 16px !important;
    }
    
    /* Scorecard Mobile Optimierung */
    #scorecard-container {
        padding: 5px 8px 10px 8px !important;
        margin: 10px auto !important;
        max-width: 350px !important;
        width: 95% !important;
    }

    #scorecard-container td,
    #scorecard-container th {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.09);
    }

    
    #scorecard {
        font-size: 1em !important;
    }
    
    #scorecard td, #scorecard th {
        padding: 0.5em 1em !important;
        width: 70px !important;
        max-width: 70px !important;
        font-size: 0.8em !important;
    }
    
    #scorecard th:first-child,
    #scorecard td:first-child {
        min-width: 90px !important;
        max-width: 110px !important;
        font-size: 0.8em !important;

    }
    
    /* Würfel und Button Mobile Optimierung */
    #dice {
        justify-content: center !important;
        gap: 0.4em !important;
        margin: 15px auto !important;
        max-width: 350px !important;
    }
    
    .die {
        width: 50px !important;
        height: 50px !important;
        font-size: 20px !important;
    }
    
    .die.dice-dots {
        font-size: 90px !important;
        padding: 2px !important;
        width: 50px !important;
        height: 50px !important;
    }
    
    .die.dice-dots img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        border-radius: 4px !important;
    }
    
    #roll {
        display: block !important;
        margin: 15px auto !important;
        padding: 12px 24px !important;
        font-size: 14px !important;
        max-width: 200px !important;
    }
}
