@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0B1120;
  --bg2: #111827;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.08);
  --border: rgba(0,195,255,0.15);
  --border-selected: rgba(0,195,255,0.7);
  --accent: #00C3FF;
  --accent2: #0080FF;
  --accent-glow: rgba(0,195,255,0.3);
  --text: #F0F6FF;
  --text-muted: rgba(240,246,255,0.5);
  --success: #00E5A0;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(0,195,255,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(0,128,255,0.08) 0%, transparent 70%),
    var(--bg);
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Typography ── */
.accent { color: var(--accent); }

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.02em;
  box-shadow: 0 0 20px rgba(0,195,255,0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(0,195,255,0.45);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0 20px rgba(0,195,255,0.25);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(0,195,255,0.45);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--border-selected);
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-outline:hover {
  background: rgba(0,195,255,0.08);
  transform: translateY(-2px);
}

/* ── Phase 1 ── */
.phase1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 20px 24px;
  min-height: 100vh;
  gap: 16px;
}

.phase1-header {
  text-align: center;
  max-width: 540px;
}

.phase1-title {
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.phase1-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Company Grid ── */
.company-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 480px;
}

.company-card {
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  max-width: 140px;
  justify-self: center;
  width: 100%;
}

.company-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,195,255,0.06), transparent);
  opacity: 0;
  transition: var(--transition);
}

.company-card:hover:not(.disabled) {
  border-color: rgba(0,195,255,0.4);
  background: var(--surface-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,195,255,0.12);
}

.company-card:hover:not(.disabled)::before { opacity: 1; }

.company-card.selected {
  border-color: var(--border-selected);
  background: rgba(0,195,255,0.06);
  box-shadow: 0 0 0 1px rgba(0,195,255,0.3), 0 8px 30px rgba(0,195,255,0.15);
}

.company-card.codelaundry-card {
  border-color: var(--accent);
  background: rgba(0,195,255,0.08);
  box-shadow: 0 0 0 1px rgba(0,195,255,0.5), 0 0 40px rgba(0,195,255,0.2);
}

.company-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  padding: 10px 8px;
  position: relative;
}

.logo-wrapper {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.33);
}

.company-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.logo-fallback {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}


.check-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: var(--transition);
}

.company-card.selected .check-icon {
  opacity: 1;
  transform: scale(1);
}

/* ── Phase 1 Footer ── */
.phase1-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.selection-count {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.selection-count.ready {
  color: var(--success);
  font-weight: 600;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,17,32,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

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

.modal {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 40px 36px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 0 80px rgba(0,195,255,0.1);
}

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

.modal-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.modal-body {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

.modal-body strong {
  color: var(--accent);
}

.meme-container {
  margin-bottom: 24px;
  border-radius: 12px;
  overflow: hidden;
}

.meme-img {
  width: 100%;
  border-radius: 12px;
  max-height: 280px;
  object-fit: contain;
}

/* CSS Drake meme fallback */
.drake-meme {
  background: #222;
  border-radius: 12px;
  overflow: hidden;
  font-size: 14px;
}

.drake-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.drake-row + .drake-row { border-top: 1px solid #333; }

.drake-face { font-size: 32px; flex-shrink: 0; }

.drake-text {
  font-weight: 600;
  text-align: left;
  line-height: 1.3;
}

.drake-no { background: #1a1a1a; opacity: 0.7; }
.drake-yes { background: #1a2a1a; }
.drake-yes .drake-text { color: var(--success); }

/* ── Phase 2 ── */
.phase2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 32px;
  min-height: 100vh;
  gap: 16px;
}

.phase2-header {
  text-align: center;
}

.phase2-title {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.phase2-subtitle {
  font-size: 16px;
  color: var(--text-muted);
}

/* ── Straws Scene ── */
.straws-scene {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 500px;
}

.straws-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  width: 100%;
  padding-bottom: 20px;
  position: relative;
  z-index: 2;
}

/* ── Straw ── */
.straw-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  flex: 1;
  max-width: 90px;
  transform-origin: bottom center;
  transition: transform var(--transition);
}

.straw-wrapper:hover:not(.picked):not(.revealed) .straw-body {
  box-shadow: 0 0 20px rgba(0,195,255,0.5);
  background: linear-gradient(180deg, #00D4FF 0%, #0090CC 100%);
}

/* Slight natural fan tilt */
.straw-wrapper[data-idx="0"] { transform: rotate(-6deg); }
.straw-wrapper[data-idx="1"] { transform: rotate(-2deg); }
.straw-wrapper[data-idx="2"] { transform: rotate(2deg); }
.straw-wrapper[data-idx="3"] { transform: rotate(6deg); }

.straw-wrapper[data-idx="0"]:hover:not(.picked):not(.revealed) { transform: rotate(-6deg) translateY(-12px); }
.straw-wrapper[data-idx="1"]:hover:not(.picked):not(.revealed) { transform: rotate(-2deg) translateY(-12px); }
.straw-wrapper[data-idx="2"]:hover:not(.picked):not(.revealed) { transform: rotate(2deg) translateY(-12px); }
.straw-wrapper[data-idx="3"]:hover:not(.picked):not(.revealed) { transform: rotate(6deg) translateY(-12px); }

.straw {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.straw-body {
  width: 100%;
  height: 160px;
  background: linear-gradient(180deg, #00C3FF 0%, #0070A0 100%);
  border-radius: 8px 8px 4px 4px;
  transition: var(--transition);
  position: relative;
  box-shadow: inset 2px 0 6px rgba(255,255,255,0.2), inset -2px 0 6px rgba(0,0,0,0.2);
}

.straw-body::after {
  content: '';
  position: absolute;
  top: 10%;
  left: 20%;
  width: 25%;
  height: 70%;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}

.straw-reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px 4px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

/* Picked straw: rises up with CodeLaundry */
.straw-wrapper.picked {
  transform: rotate(0deg) translateY(-36px) !important;
  z-index: 10;
  cursor: default;
}

.straw-wrapper.picked .straw-body {
  background: linear-gradient(180deg, #00FFD0 0%, #00C3FF 50%, #0070A0 100%);
  box-shadow: 0 0 40px rgba(0,195,255,0.6), 0 0 80px rgba(0,195,255,0.3);
}

.straw-wrapper.picked .straw-reveal {
  opacity: 1;
  transform: translateY(0);
}

/* Revealed straws */
.straw-wrapper.revealed {
  cursor: default;
}

.straw-wrapper.revealed .straw-body {
  background: linear-gradient(180deg, #556 0%, #334 100%);
  box-shadow: none;
  opacity: 0.7;
}

.straw-wrapper.revealed .straw-reveal {
  opacity: 1;
  transform: translateY(0);
}

.straw-logo-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.33);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255,255,255,0.15);
}

.straw-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
}

.straw-logo-fallback {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}


/* ── Cup ── */
.straws-cup {
  width: 100%;
  height: 50px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.04) 100%);
  border: 1.5px solid var(--border);
  border-radius: 0 0 20px 20px;
  position: relative;
  z-index: 3;
  margin-top: -2px;
  backdrop-filter: blur(4px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

/* ── Result ── */
.phase2-result {
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.phase2-result.visible {
  opacity: 1;
  transform: translateY(0);
}

.result-winner {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.winner-glow {
  position: absolute;
  inset: -30px;
  background: radial-gradient(circle, rgba(0,195,255,0.2) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.winner-logo {
  width: 100px;
  height: 100px;
  border-radius: var(--radius);
  object-fit: contain;
  padding: 16px;
  background: rgba(0,195,255,0.1);
  border: 2px solid rgba(0,195,255,0.5);
  position: relative;
  z-index: 1;
}

.winner-logo-fallback {
  width: 100px;
  height: 100px;
  border-radius: var(--radius);
  background: rgba(0,195,255,0.1);
  border: 2px solid rgba(0,195,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 800;
  color: var(--accent);
  position: relative;
  z-index: 1;
}

.winner-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.winner-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.result-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Responsive ── */
@media (max-width: 500px) {
  .phase1, .phase2 {
    padding: 24px 14px 48px;
    gap: 24px;
  }

  .company-grid {
    gap: 10px;
  }

  .logo-wrapper {
    width: 48px;
    height: 48px;
  }

  .straw-body {
    height: 160px;
  }

  .straws-container {
    gap: 10px;
  }


  .modal {
    padding: 28px 20px;
  }

  .modal-title {
    font-size: 20px;
  }
}

@media (max-width: 360px) {
  .straw-body { height: 130px; }
  .straw-logo-wrapper { width: 36px; height: 36px; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
