/* Remove bottom margin from add-person-area, move to main-menu for mobile spacing */
#add-person-area {
  margin-bottom: 0 !important;
  padding-bottom: 24px !important;
  display: flex;
  align-items: center;
  gap: 8px;
}
#add-person-area > * {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  height: 40px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}
#player-list {
  margin-bottom: 0;
}

@media (max-width: 500px) {
  #main-menu {
    margin-bottom: 120px !important;
  }
}
/* Active rules indicator container */
.active-rules {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 24px 0 0 0;
  width: 100%;
}

/* Each active rule indicator (pill) */
.active-rule-indicator {
  background: #fff9c4;
  color: #7a4a00;
  border-radius: 16px;
  padding: 14px 20px;
  margin: 0 0 0 0;
  font-size: 1.08rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  min-width: 120px;
  max-width: 95%;
  text-align: center;
  user-select: none;
  pointer-events: none;
  border: none;
  outline: none;
  transition: background 0.2s;
}
input, button, select, textarea {
  font-size: 16px;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #f3f4f8;
  color: #181818;
  /* Notch area color for iOS */
  padding-top: env(safe-area-inset-top);
}

/* Notch area background to match top bar */
body::before {
  content: '';
  display: block;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: env(safe-area-inset-top);
  background: #fff;
  z-index: 1000;
}
.top-bar {
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  padding: 16px 0 16px 0;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-arrow {
  position: absolute;
  left: 16px;
  font-size: 1.5rem;
  cursor: pointer;
/* Improved rule indicator for mobile */
/* Active rules: stack vertically, each in its own box */
/* Active rules: stack vertically, each in its own white card with yellow bubble inside */

/* Active rules pill below next button, inside card */
  flex: 1;
}
#main-menu, #game-screen {
  max-width: 400px;
  margin: 32px auto 24px auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  padding: 24px;
}

.card {
  background: linear-gradient(135deg, #fff 60%, #dbeafe 100%);
  border-radius: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  margin: 32px 0 24px 0;
  padding: 48px 24px 48px 24px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  color: #222;
  transition: box-shadow 0.2s;
  text-align: center;
}
.card.large {
  font-size: 2.8rem;
}
.card .card-text {
  width: 100%;
  word-break: break-word;
}
.next-btn {
  display: block;
  width: 100%;
  margin: 32px auto 0 auto;
  font-size: 1.3rem;
  padding: 18px 0;
  border-radius: 14px;
  border: none;
  background: #0051c7;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: background 0.2s;
  letter-spacing: 0.02em;
}
.next-btn:active {
  background: #003a8c;
}
.card button, .card #show-answer {
  margin-top: 24px;
  font-size: 1.1rem;
  padding: 12px 32px;
}
.card button:active, .card #show-answer:active {
  background: #003a8c;
}
.drawer {
  font-size: 1.1rem;
  color: #0051c7;
  margin-bottom: 16px;
  font-weight: 600;
}
#game-list button {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: #e3e8f0;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}
#game-list button:hover {
  background: #c7d2e5;
}
#player-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
#player-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}
#player-list button {
  background: none;
  border: none;
  color: #ff3b30;
  font-size: 1.1rem;
  cursor: pointer;
}
#player-input {
  width: 70%;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  margin-right: 0;
  height: 40px;
  box-sizing: border-box;
  font-size: 1em;
  display: flex;
  align-items: center;
  text-align: left;
}
#player-input::placeholder {
  text-align: left;
}
input#player-input::-webkit-input-placeholder { text-align: left; }
input#player-input:-moz-placeholder { text-align: left; }
input#player-input::-moz-placeholder { text-align: left; }
input#player-input:-ms-input-placeholder { text-align: left; }
#player-input::placeholder {
  text-align: center;
}
#add-player {
  padding: 0 16px;
  border-radius: 8px;
  border: none;
  background: #0051c7;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  height: 40px;
  font-size: 1.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
#add-player:active {
  background: #003a8c;
}
.card-rules {
  text-align: justify;
  white-space: pre-line;
}
@media (max-width: 500px) {
  #main-menu, #game-screen {
  margin: 0 0 32px 0;
    border-radius: 0;
    box-shadow: none;
    padding: 16px 4px;
  }
  .top-bar {
    padding: 12px 0;
    font-size: 1.1rem;
  }
}
