:root {
  --wheel-width: 180px;
  --row-height: 44px;
  --accent: #667eea;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.8);
  --bg: rgba(255, 255, 255, 0.1);
  --ring: rgba(255, 255, 255, 0.3);
  --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background: 
    /* Purple gradient overlay to blend with photo */
    linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%),
    /* Frankfurt skyline photo */
    url('frankfurt-skyline.jpg') center top/cover no-repeat,
    /* Fallback gradient if image doesn't load */
    var(--gradient);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text);
  margin: 0;
  position: relative;
}

.container {
  text-align: center;
  max-width: 1000px;
  width: 100%;
  padding: 20px;
}

.question {
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin-bottom: 1rem;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  animation: fadeInDown 1s ease-out;
}

.lead {
  color: var(--muted);
  margin: 0 0 2rem;
  font-size: 1.1rem;
  animation: fadeIn 1s ease-out 0.5s both;
}

.lock {
  display: grid;
  grid-template-columns: repeat(4, var(--wheel-width));
  gap: 16px;
  justify-content: center;
  align-items: start;
  padding: 22px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: visible;
  backdrop-filter: blur(3px);
  margin-bottom: 2rem;
  animation: slideInUp 1s ease-out 0.3s both;
}

/* Highlight band across all wheels - REMOVED */
/* .lock::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: calc(50% - var(--row-height)/2 + 30px);
  height: var(--row-height);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.15), rgba(255,255,255,0.1));
  box-shadow: inset 0 0 0 2px var(--ring);
  pointer-events: none;
} */

.wheel-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.wheel-letter {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--text);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: 8px;
}

.wheel-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.wheel-btn {
  appearance: none;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.2);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-weight: 600;
  font-size: 14px;
  backdrop-filter: blur(5px);
  transition: all 0.2s ease;
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wheel-btn:active {
  transform: translateY(0);
}

.wheel {
  width: var(--wheel-width);
  height: calc(var(--row-height) * 3);
  position: relative;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  overflow: hidden;
}

.swiper {
  width: 100%;
  height: 100%;
}

.swiper-wrapper {
  align-items: center;
}

.swiper-slide {
  height: var(--row-height);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  opacity: 0.3;
  transition: opacity 0.3s ease, transform 0.3s ease;
  padding: 0 10px;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.swiper-slide-active {
  opacity: 1;
  transform: scale(1.05);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Additional mobile improvements */
@media (max-width: 768px) {
  :root {
    --wheel-width: 140px;
    --row-height: 38px;
  }
  
  .lock {
    grid-template-columns: repeat(4, var(--wheel-width));
    gap: 12px;
    padding: 16px;
  }
  
  .wheel-letter {
    font-size: 2rem;
    margin-bottom: 6px;
  }
  
  .wheel-btn {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
    padding: 6px 8px;
  }
  
  .swiper-slide {
    font-size: 14px;
    padding: 0 8px;
  }
}

@media (max-width: 480px) {
  :root {
    --wheel-width: 120px;
    --row-height: 34px;
  }
  
  .lock {
    grid-template-columns: repeat(4, var(--wheel-width));
    gap: 8px;
    padding: 12px;
  }
  
  .wheel-letter {
    font-size: 1.8rem;
  }
  
  .swiper-slide {
    font-size: 13px;
  }
}

.controls {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeIn 1s ease-out 0.8s both;
}

button {
  appearance: none;
  cursor: pointer;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

button.primary {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #2d3748;
  border-color: #ffd700;
  box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
  font-weight: 700;
  transform: translateY(0);
  position: relative;
  overflow: hidden;
}

button.primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.5s ease;
}

button.primary:hover {
  background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 215, 0, 0.4);
}

button.primary:hover::before {
  left: 100%;
}

button.primary:active {
  transform: translateY(0);
}

.output {
  margin-top: 16px;
  color: var(--muted);
  animation: fadeIn 1s ease-out 1s both;
  min-height: 24px;
}

.output strong {
  color: var(--text);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.hint {
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  animation: fadeIn 1s ease-out 1.2s both;
}

.contact-section {
  margin-top: 2rem;
  animation: fadeIn 2s ease-out 1.5s both;
}

.contact-section p {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.contact-section a {
  color: #ffd700;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
}

.contact-section a:hover {
  color: #ffed4e;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

/* Overlay Styles */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.overlay.show {
  opacity: 1;
  visibility: visible;
}

.overlay-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #5a67d8 100%);
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-radius: 25px;
  padding: 3rem 2.5rem;
  max-width: 550px;
  width: 90%;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(15px);
  transform: scale(0.8) translateY(30px) rotateX(10deg);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.overlay-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
}

.overlay-content::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(0deg); }
  50% { transform: translateX(0%) translateY(0%) rotate(180deg); }
}

.overlay.show .overlay-content {
  transform: scale(1) translateY(0) rotateX(0deg);
}

.overlay-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 2;
}

.overlay-close {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  font-size: 1.8rem;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 2;
}

.overlay-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.overlay-body {
  text-align: center;
  position: relative;
  z-index: 2;
}

.overlay-body p {
  font-size: 1.4rem;
  color: var(--text);
  margin: 0.5rem 0;
  line-height: 1.6;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  font-weight: 500;
}

.overlay-body .guess-display {
  font-size: 1.8rem;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  font-weight: 700;
  padding: 0.5em 1em;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 12px;
  border: 2px solid rgba(255, 215, 0, 0.3);
  margin: 1rem 0;
  word-break: break-word;
}

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Mobile Responsive - Portrait orientation: 2x2 grid */
@media (max-width: 900px) and (orientation: portrait) {
  :root {
    --wheel-width: 140px;
    --row-height: 36px;
  }
  
  .lock {
    grid-template-columns: repeat(2, var(--wheel-width));
    gap: 12px;
    padding: 16px;
  }
  
  .wheel-letter {
    font-size: 1.8rem;
    margin-bottom: 6px;
  }
  
  .wheel-btn {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
    padding: 6px 8px;
  }
  
  .question {
    font-size: 1.8rem;
    margin-bottom: 1rem;
  }
  
  .lead {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .controls {
    gap: 8px;
  }
  
  button {
    padding: 10px 14px;
    font-size: 14px;
  }
  
  .contact-section p {
    font-size: 1.1rem;
  }
  
  .overlay-content {
    padding: 2rem 1.5rem;
    margin: 20px;
  }
  
  .overlay-body p {
    font-size: 1.2rem;
  }
  
  .overlay-body .guess-display {
    font-size: 1.5rem;
    padding: 0.4em 0.8em;
  }
  
  .overlay-close {
    width: 36px;
    height: 36px;
    font-size: 1.6rem;
  }
}

/* Mobile Responsive - Landscape orientation: 4 wheels in one row */
@media (max-width: 900px) and (orientation: landscape) {
  :root {
    --wheel-width: 120px;
    --row-height: 32px;
  }
  
  .lock {
    grid-template-columns: repeat(4, var(--wheel-width));
    gap: 8px;
    padding: 12px;
  }
  
  .wheel-letter {
    font-size: 1.4rem;
    margin-bottom: 4px;
  }
  
  .wheel-btn {
    min-width: 28px;
    height: 28px;
    font-size: 11px;
    padding: 4px 6px;
  }
  
  .question {
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
  }
  
  .lead {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }
  
  .controls {
    gap: 6px;
  }
  
  button {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .contact-section p {
    font-size: 1rem;
  }
  
  .overlay-content {
    padding: 1.5rem 1rem;
    margin: 15px;
  }
  
  .overlay-body p {
    font-size: 1.1rem;
  }
  
  .overlay-body .guess-display {
    font-size: 1.3rem;
    padding: 0.3em 0.6em;
  }
  
  .overlay-close {
    width: 32px;
    height: 32px;
    font-size: 1.4rem;
  }
}

/* Small screens - Portrait orientation */
@media (max-width: 480px) and (orientation: portrait) {
  :root {
    --wheel-width: 130px;
    --row-height: 34px;
  }
  
  .container {
    padding: 15px;
  }
  
  .lock {
    grid-template-columns: repeat(2, var(--wheel-width));
    gap: 8px;
    padding: 12px;
  }
  
  .wheel-letter {
    font-size: 1.5rem;
    margin-bottom: 4px;
  }
  
  .wheel-btn {
    min-width: 32px;
    max-width: 32px;
    width: 32px;
    height: 32px;
    font-size: 12px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  
  .question {
    font-size: 1.5rem;
  }
  
  .lead {
    font-size: 0.9rem;
  }
  
  .controls {
    flex-direction: column;
    align-items: center;
  }
  
  button {
    width: 200px;
    padding: 8px 12px;
  }
  
  .overlay-content {
    padding: 1.5rem 1rem;
    margin: 15px;
  }
  
  .overlay-body p {
    font-size: 1.1rem;
  }
  
  .overlay-body .guess-display {
    font-size: 1.3rem;
    padding: 0.3em 0.6em;
  }
  
  .overlay-close {
    font-size: 1.4rem;
    width: 32px;
    height: 32px;
  }
}

/* Small screens - Landscape orientation */
@media (max-width: 480px) and (orientation: landscape) {
  :root {
    --wheel-width: 100px;
    --row-height: 30px;
  }
  
  .container {
    padding: 10px;
  }
  
  .lock {
    grid-template-columns: repeat(4, var(--wheel-width));
    gap: 6px;
    padding: 10px;
  }
  
  .wheel-letter {
    font-size: 1.2rem;
    margin-bottom: 3px;
  }
  
  .wheel-btn {
    min-width: 26px;
    max-width: 26px;
    width: 26px;
    height: 26px;
    font-size: 10px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  
  .question {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
  }
  
  .lead {
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
  }
  
  .controls {
    gap: 4px;
    margin-top: 12px;
  }
  
  button {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .contact-section p {
    font-size: 0.9rem;
  }
  
  .overlay-content {
    padding: 1rem 0.8rem;
    margin: 10px;
  }
  
  .overlay-body p {
    font-size: 1rem;
  }
  
  .overlay-body .guess-display {
    font-size: 1.2rem;
    padding: 0.2em 0.5em;
  }
  
  .overlay-close {
    font-size: 1.2rem;
    width: 28px;
    height: 28px;
  }
}

/* Firefox Android specific fixes for portrait */
@media (max-width: 480px) and (orientation: portrait) {
  @supports (-moz-appearance: none) {
    .wheel-btn {
      min-width: 30px;
      max-width: 30px;
      width: 30px;
      height: 30px;
      font-size: 11px;
    }
    
    .wheel {
      height: calc(var(--row-height) * 3);
      min-height: calc(var(--row-height) * 3);
      max-height: calc(var(--row-height) * 3);
      overscroll-behavior: contain;
      scroll-behavior: smooth;
    }
    
    .wheel-container {
      position: relative;
      overflow: hidden;
      min-height: calc(var(--row-height) * 3 + 80px);
    }
    
    .lock {
      min-height: calc(var(--row-height) * 3 + 120px);
    }
  }
}

/* Firefox Android specific fixes for landscape */
@media (max-width: 480px) and (orientation: landscape) {
  @supports (-moz-appearance: none) {
    .wheel-btn {
      min-width: 24px;
      max-width: 24px;
      width: 24px;
      height: 24px;
      font-size: 9px;
    }
    
    .wheel {
      height: calc(var(--row-height) * 3);
      min-height: calc(var(--row-height) * 3);
      max-height: calc(var(--row-height) * 3);
      overscroll-behavior: contain;
      scroll-behavior: smooth;
    }
    
    .wheel-container {
      position: relative;
      overflow: hidden;
      min-height: calc(var(--row-height) * 3 + 60px);
    }
    
    .lock {
      min-height: calc(var(--row-height) * 3 + 80px);
    }
  }
}

/* Prevent overscroll and page bouncing on mobile */
html, body {
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

/* Additional mobile stability for preventing page jumps */
@media (max-width: 900px) {
  body {
    position: relative;
    overflow-x: hidden;
    -webkit-overflow-scrolling: auto;
  }
  
  .wheel {
    isolation: isolate;
    contain: layout style;
  }
}