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

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #fff0f5 0%, #ffe4ec 25%, #ffd6e7 50%, #ffe4ec 75%, #fff0f5 100%);
  overflow: hidden;
  position: relative;
  font-family: 'Nunito', sans-serif;
}

.background-gradient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255, 182, 210, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(255, 200, 220, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 220, 235, 0.3) 0%, transparent 60%);
  animation: bg-shift 20s ease-in-out infinite;
}

.glow-orbs-container,
.bubbles-container,
.sparkles-container,
.hearts-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.bubbles-container,
.hearts-container {
  z-index: 1;
}

.sparkles-container {
  z-index: 2;
}

.glow-orbs-container {
  z-index: 0;
}

.bubble,
.glow-orb {
  position: absolute;
  border-radius: 50%;
}

.bubble {
  animation: bubble-float linear infinite;
  opacity: 0;
}

.glow-orb {
  filter: blur(40px);
  animation: orb-pulse ease-in-out infinite;
}

.sparkle {
  position: absolute;
  animation: sparkle-twinkle ease-in-out infinite;
}

.sparkle::before,
.sparkle::after {
  content: '';
  position: absolute;
}

.sparkle::before {
  width: 100%;
  height: 2px;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  border-radius: 1px;
}

.sparkle::after {
  width: 2px;
  height: 100%;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  border-radius: 1px;
}

.heart {
  position: absolute;
  opacity: 0;
  animation: heart-float linear infinite;
}

.bubble.pink {
  background: radial-gradient(circle at 30% 30%, rgba(255, 200, 220, 0.6) 0%, rgba(255, 153, 194, 0.3) 40%, rgba(255, 153, 194, 0.1) 70%, transparent 100%);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(255, 153, 194, 0.2);
}

.bubble.purple {
  background: radial-gradient(circle at 30% 30%, rgba(200, 180, 255, 0.6) 0%, rgba(168, 130, 255, 0.3) 40%, rgba(168, 130, 255, 0.1) 70%, transparent 100%);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(168, 130, 255, 0.2);
}

.bubble.peach {
  background: radial-gradient(circle at 30% 30%, rgba(255, 220, 200, 0.6) 0%, rgba(255, 180, 160, 0.3) 40%, rgba(255, 180, 160, 0.1) 70%, transparent 100%);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(255, 180, 160, 0.2);
}

.bubble.lavender {
  background: radial-gradient(circle at 30% 30%, rgba(230, 200, 255, 0.6) 0%, rgba(210, 170, 255, 0.3) 40%, rgba(210, 170, 255, 0.1) 70%, transparent 100%);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(210, 170, 255, 0.2);
}

.glow-orb.pink { background: rgba(255, 182, 210, 0.5); }
.glow-orb.rose { background: rgba(255, 150, 180, 0.45); }
.glow-orb.peach { background: rgba(255, 210, 200, 0.4); }
.glow-orb.lavender { background: rgba(255, 200, 220, 0.35); }

.sparkle.pink::before,
.sparkle.pink::after {
  background: #ffb3d1;
  box-shadow: 0 0 4px #ffb3d1;
}

.sparkle.white::before,
.sparkle.white::after {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

.sparkle.rose::before,
.sparkle.rose::after {
  background: #ffb3c9;
  box-shadow: 0 0 4px #ffb3c9;
}

@keyframes bg-shift {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes bubble-float {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.8; transform: translateY(90vh) scale(1); }
  90% { opacity: 0.6; }
  100% { transform: translateY(-10vh) scale(0.8); opacity: 0; }
}

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

@keyframes sparkle-twinkle {
  0%, 100% { transform: scale(0) rotate(0deg); opacity: 0; }
  50% { transform: scale(1) rotate(90deg); opacity: 1; }
}

@keyframes heart-float {
  0% { transform: translateY(100vh) rotate(0deg) scale(0.5); opacity: 0; }
  10% { opacity: 0.4; }
  90% { opacity: 0.3; }
  100% { transform: translateY(-10vh) rotate(360deg) scale(0.8); opacity: 0; }
}

@keyframes slideUp {
  to { transform: translateY(0); opacity: 1; }
}

.cat-icon {
  font-size: 48px;
  margin-bottom: 10px;
  display: inline-block;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.paw-print {
  position: absolute;
  color: rgba(255, 153, 194, 0.15);
  font-size: 40px;
  transform: rotate(-20deg);
  bottom: -15px;
  right: -15px;
  pointer-events: none;
}

.paw-print.left {
  transform: rotate(20deg);
  top: -15px;
  left: -15px;
  bottom: auto;
  right: auto;
}

/* ------------ */

.app-container {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.container {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 24px;
  padding: 40px;
  width: 720px;
  max-width: 100%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(255, 153, 194, 0.15),
              inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  position: relative;
  transform: translateY(20px);
  opacity: 0;
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.2s;
}

.container--narrow {
  width: 450px;
}

.container h3 {
  font-family: 'Pacifico', cursive;
  font-size: 28px;
  color: #ff99c2;
  margin-bottom: 5px;
  font-weight: 400;
}

.container h4 {
  font-size: 18px;
  font-weight: 600;
  color: #5c3a4d;
  opacity: 0.8;
  margin-bottom: 30px;
}

.riddle-box {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 25px 20px;
  margin: 20px 0;
  border: 1px dashed rgba(255, 153, 194, 0.4);
  transition: all 0.3s ease;
  position: relative;
}

.riddle-box:hover {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 5px 15px rgba(255, 153, 194, 0.1);
  transform: scale(1.02);
}

.riddle-box p {
  line-height: 1.8;
  font-size: 22px;
  color: #5c3a4d;
  font-weight: 600;
}

.question-field {
  padding: 10px 15px;
}

.highlight {
  color: #ff99c2;
  font-weight: 700;
  font-size: 26px;
}

.answer-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 10px;
}

.answer-btn {
  flex: 1;
  padding: 22px 30px;
  font-family: 'Pacifico', cursive;
  font-size: 30px;
  color: #fff;
  background: linear-gradient(135deg, #ffb3d1 0%, #ff8fb8 50%, #ff7aa8 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 122, 168, 0.4),
              inset 0 2px 0 rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.answer-btn:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 12px 28px rgba(255, 122, 168, 0.5),
              inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.answer-btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 4px 12px rgba(255, 122, 168, 0.4);
}

.answer-btn:nth-child(2) {
  background: linear-gradient(135deg, #c9b3ff 0%, #a98bff 50%, #9a7aff 100%);
  box-shadow: 0 8px 20px rgba(154, 122, 255, 0.4),
              inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.answer-btn:nth-child(2):hover {
  box-shadow: 0 12px 28px rgba(154, 122, 255, 0.5),
              inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.answer-btn:nth-child(2):active {
  box-shadow: 0 4px 12px rgba(154, 122, 255, 0.4);
}

/* ------------ Forms & lobby ------------ */

.form-group {
  display: flex;
  flex-direction: column;
  text-align: left;
  margin-bottom: 16px;
  flex: 1;
}

.form-group label {
  font-size: 14px;
  font-weight: 700;
  color: #5c3a4d;
  opacity: 0.7;
  margin-bottom: 6px;
}

.form-group input {
  padding: 14px 16px;
  font-size: 18px;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  color: #5c3a4d;
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid rgba(255, 153, 194, 0.4);
  border-radius: 12px;
  outline: none;
  transition: all 0.3s ease;
}

.form-group input:focus {
  border-color: #ff99c2;
  box-shadow: 0 0 0 3px rgba(255, 153, 194, 0.2);
}

.room-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.icon-btn {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ffb3d1 0%, #ff8fb8 50%, #ff7aa8 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 122, 168, 0.4);
  transition: all 0.3s ease;
  margin-bottom: 16px;
}

.icon-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 28px rgba(255, 122, 168, 0.5);
}

.primary-btn {
  width: 100%;
  padding: 16px 30px;
  font-family: 'Pacifico', cursive;
  font-size: 24px;
  color: #fff;
  background: linear-gradient(135deg, #ffb3d1 0%, #ff8fb8 50%, #ff7aa8 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 122, 168, 0.4);
  transition: all 0.3s ease;
  margin-top: 10px;
}

.primary-btn:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 28px rgba(255, 122, 168, 0.5),
              inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.error-msg {
  min-height: 20px;
  color: #e0526e;
  font-weight: 700;
  font-size: 15px;
  margin: 8px 0;
}

/* ------------ Waiting ------------ */

.waiting-info {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 20px;
  margin: 20px 0;
  border: 1px dashed rgba(255, 153, 194, 0.4);
  font-size: 17px;
  color: #5c3a4d;
  line-height: 1.8;
}

.guest-line {
  font-size: 18px;
}

.guest-line strong {
  color: #ff99c2;
}

.room-code {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  letter-spacing: 2px;
  color: #5c3a4d;
  background: rgba(255, 153, 194, 0.15);
  padding: 2px 10px;
  border-radius: 8px;
}

.answer-btn.selected {
  transform: scale(1.05);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9),
              0 0 0 8px rgba(255, 122, 168, 0.45),
              0 12px 28px rgba(255, 122, 168, 0.5);
  opacity: 1;
  filter: brightness(1.08);
}

.answer-btn:disabled:not(.selected) {
  opacity: 0.35;
  transform: scale(0.96);
  filter: grayscale(0.4);
}

.answer-btn.selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 14px;
  font-size: 22px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* ------------ Reveal ------------ */

.reveal-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 20px 0;
}

.reveal-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 20px;
  border: 2px solid rgba(255, 153, 194, 0.4);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reveal-name {
  font-family: 'Pacifico', cursive;
  font-size: 20px;
  color: #5c3a4d;
}

.reveal-pick {
  font-size: 22px;
  font-weight: 700;
  color: #ff99c2;
}

/* ------------ Reveal match ------------ */

.match-banner {
  font-family: 'Pacifico', cursive;
  font-size: 24px;
  color: #2e8b57;
  margin: 10px 0 0;
}

.reveal-row.match .reveal-card {
  border-color: #7fd8a4;
  background: rgba(220, 255, 230, 0.7);
  box-shadow: 0 8px 20px rgba(46, 139, 87, 0.2);
}

.reveal-row.match .reveal-pick {
  color: #2e8b57;
}

.primary-btn.match {
  background: linear-gradient(135deg, #8fe3b0 0%, #5ecf8f 50%, #3fbf7d 100%);
  box-shadow: 0 8px 20px rgba(63, 191, 125, 0.4),
              inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.primary-btn.match:hover:not(:disabled) {
  box-shadow: 0 12px 28px rgba(63, 191, 125, 0.5),
              inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

/* ------------ Summary ------------ */

.summary-list {
  max-height: 45vh;
  overflow-y: auto;
  margin: 20px 0 10px;
  padding-right: 6px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-list::-webkit-scrollbar {
  width: 8px;
}

.summary-list::-webkit-scrollbar-track {
  background: rgba(255, 153, 194, 0.1);
  border-radius: 8px;
}

.summary-list::-webkit-scrollbar-thumb {
  background: rgba(255, 153, 194, 0.5);
  border-radius: 8px;
}

.summary-row {
  position: relative;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 153, 194, 0.35);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.3s ease;
}

.summary-row:hover {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 5px 15px rgba(255, 153, 194, 0.12);
}

.summary-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffb3d1 0%, #ff8fb8 100%);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-question {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: #5c3a4d;
  line-height: 1.4;
}

.summary-question > .highlight {
  font-size: 15px;
}

.summary-answers {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  min-width: 120px;
  text-align: right;
}

.summary-answer {
  font-size: 14px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 8px;
  background: rgba(255, 153, 194, 0.12);
  color: #5c3a4d;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-answer-name {
  font-size: 12px;
  font-weight: 800;
  color: #dc7099;
  white-space: nowrap;
}

.summary-row.match {
  border-color: #7fd8a4;
  background: rgba(220, 255, 230, 0.7);
  box-shadow: 0 4px 12px rgba(46, 139, 87, 0.15);
}

.summary-row.match .summary-answer {
  background: rgba(46, 139, 87, 0.15);
  color: #2e8b57;
}

.summary-row.match .summary-answer.match-answer {
  justify-content: center;
  font-size: 15px;
  padding: 8px 10px;
}

.summary-match-badge {
  position: absolute;
  top: -8px;
  right: 12px;
  background: linear-gradient(135deg, #8fe3b0 0%, #3fbf7d 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(63, 191, 125, 0.4);
}

.summary-footer {
  margin: 10px 0 0;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 153, 194, 0.4);
}

.summary-match-count {
  display: inline-block;
  font-size: 16px;
  font-weight: 700;
  color: #2e8b57;
  background: rgba(220, 255, 230, 0.7);
  border: 1px solid #7fd8a4;
  padding: 8px 16px;
  border-radius: 12px;
}
