/* Base layout */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body.app-body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #2c2e3b 0, #171821 55%, #101016 100%);
  color: #f7f3eb;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  background: linear-gradient(to bottom, rgba(5, 5, 10, 0.92), rgba(5, 5, 10, 0.75));
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #ffcf6b, #ff8b3d);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #20120a;
  box-shadow: 0 0 0 2px #2c2017, 0 10px 20px rgba(0, 0, 0, 0.6);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: "Playfair Display", "Times New Roman", serif;
  letter-spacing: 0.04em;
  font-size: 1.1rem;
}

.brand-subtitle {
  font-size: 0.7rem;
  opacity: 0.8;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.85rem;
}

.top-nav a {
  color: #f7f3eb;
  text-decoration: none;
  opacity: 0.85;
}

.top-nav a:hover {
  opacity: 1;
}

.nav-user {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.badge {
  margin-left: 0.3rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(255, 207, 107, 0.18);
  color: #ffc36b;
}

.badge-warning {
  background: rgba(255, 142, 90, 0.18);
  color: #ff9c66;
}

.app-main {
  flex: 1;
  padding: 1.4rem 1.1rem 2rem;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

.page-header h1 {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 1.7rem;
  margin-bottom: 0.2rem;
}

.page-header p {
  margin: 0;
  opacity: 0.8;
}

.card-grid {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.card {
  border-radius: 18px;
  padding: 1rem 1.1rem;
  background: radial-gradient(circle at top left, #28232d, #18141f);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.5);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.16s ease-out, box-shadow 0.16s ease-out, border-color 0.16s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.65);
  border-color: rgba(255, 207, 107, 0.6);
}

.card-header h2 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.card-body {
  font-size: 0.86rem;
  opacity: 0.9;
}

.card-footer {
  margin-top: 0.9rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  opacity: 0.7;
}

.auth-card {
  max-width: 420px;
  margin: 3rem auto 0;
  padding: 1.8rem 1.6rem 2rem;
  border-radius: 22px;
  background: radial-gradient(circle at top left, #302633, #17141f);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.7);
}

.auth-card .headline {
  margin: 0 0 0.6rem;
  font-family: "Playfair Display", "Times New Roman", serif;
}

.auth-card .headline span {
  color: #ffc36b;
}

.auth-card .subcopy {
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
  opacity: 0.85;
}

.auth-card .footnote {
  margin-top: 1rem;
  font-size: 0.8rem;
  opacity: 0.7;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.field span {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
  opacity: 0.8;
}

input[type="email"],
input[type="text"],
input[type="url"],
input[type="number"],
select {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.55rem 0.9rem;
  color: #f7f3eb;
  font-size: 0.9rem;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(255, 207, 107, 0.75);
  box-shadow: 0 0 0 1px rgba(255, 207, 107, 0.25);
}

.btn {
  border-radius: 999px;
  padding: 0.55rem 1.3rem;
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.btn-primary {
  background: linear-gradient(135deg, #ffb347, #ff8b3d);
  color: #26140a;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.7);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-accent {
  background: linear-gradient(135deg, #9cd46b, #71b851);
  color: #0f1a0c;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.7);
}

.btn-accent:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #f7f3eb;
}

.btn-wide {
  width: 100%;
  margin-top: 0.6rem;
}

.btn-small {
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
}

.flash-container {
  margin-bottom: 0.9rem;
}

.flash {
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  margin-bottom: 0.3rem;
}

.flash-success {
  background: rgba(142, 209, 119, 0.15);
  border: 1px solid rgba(142, 209, 119, 0.55);
}

.flash-error {
  background: rgba(255, 129, 129, 0.12);
  border: 1px solid rgba(255, 129, 129, 0.65);
}

.flash-info {
  background: rgba(120, 170, 255, 0.14);
  border: 1px solid rgba(120, 170, 255, 0.6);
}

.layout-two {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 1.2rem;
  margin-top: 1.1rem;
}

.layout-three {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.panel {
  border-radius: 20px;
  padding: 1rem 1.1rem 1.1rem;
  background: radial-gradient(circle at top left, #2f2632, #17141f);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.55);
}

.panel.highlight {
  background: radial-gradient(circle at top left, #332826, #16131c);
  border-color: rgba(255, 189, 105, 0.5);
}

.panel.warning {
  background: radial-gradient(circle at top left, #3a2823, #171118);
  border-color: rgba(255, 165, 120, 0.65);
}

.panel.danger {
  background: radial-gradient(circle at top left, #3b2226, #160f13);
  border-color: rgba(255, 116, 129, 0.7);
}

.attendee-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.4rem 0 0.9rem;
}

.chip {
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}

.chip input {
  accent-color: #ffb347;
}

.cooldown-control {
  margin: 0.4rem 0 1rem;
}

#cooldown-slider {
  width: 100%;
}

.cooldown-label {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  opacity: 0.85;
}

.roulette-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.5rem;
}

.plate {
  width: min(280px, 80vw);
  height: min(280px, 80vw);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #ffffff, #f7f3eb 40%, #e6d0b7 70%, #8c6b4b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 30px 40px rgba(0, 0, 0, 0.75);
}

.plate-inner {
  width: 78%;
  height: 78%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #fefaf4, #f1e1cf 60%, #e0c7aa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.plate-shadow {
  position: absolute;
  inset: auto 16% -24px 16%;
  height: 28px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.65), transparent 70%);
  filter: blur(6px);
  z-index: -1;
}

.roulette-card {
  width: 100%;
  height: 100%;
  padding: 0.9rem;
  text-align: center;
  color: #241711;
  font-size: 0.88rem;
}

.roulette-card .name {
  font-weight: 700;
  font-size: 1rem;
}

.roulette-card .meta {
  margin-top: 0.2rem;
  font-size: 0.8rem;
}

.roulette-card .link {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #a6531a;
}

.roulette-card .placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.roulette-card .emoji {
  font-size: 2.2rem;
}

.roulette-card .placeholder p {
  margin: 0;
  font-size: 0.86rem;
}

.roulette-spinning .plate-inner {
  animation: spin 0.85s cubic-bezier(0.4, 0.1, 0.1, 1) infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.hint,
.tiny-hint {
  font-size: 0.78rem;
  opacity: 0.75;
  text-align: center;
}

.tiny-hint {
  font-size: 0.7rem;
}

.crumb {
  display: inline-block;
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

.crumb:hover {
  color: rgba(255, 255, 255, 0.95);
}

.list {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
}

.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
}

.list .name {
  font-weight: 500;
}

.list .meta {
  font-size: 0.8rem;
  opacity: 0.78;
}

.list.compact li {
  padding: 0.25rem 0;
  font-size: 0.8rem;
}

.empty-state {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  opacity: 0.75;
}

.inline-form {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.inline-form input[type="email"],
.inline-form input[type="text"],
.inline-form input[type="url"] {
  min-width: 140px;
}

.panel-groups .name a {
  color: #ffe3a4;
  text-decoration: underline;
}

.panel-groups .name a:hover {
  color: #fff4c9;
}

.nav-masquerade-form {
  display: inline-flex;
}

.link-danger {
  background: none;
  border: none;
  color: rgba(255, 145, 145, 0.9);
  font-size: 0.78rem;
  cursor: pointer;
}

.ratings-grid {
  margin-top: 0.8rem;
  overflow-x: auto;
}

.ratings-grid table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.ratings-grid th,
.ratings-grid td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.25rem 0.4rem;
}

.ratings-grid th {
  background: rgba(0, 0, 0, 0.3);
}

.ratings-grid .row-label {
  font-weight: 500;
  white-space: nowrap;
}

.rating-input {
  width: 3rem;
  text-align: center;
}

.ratings-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.rating-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rating-name .meta {
  margin-left: 0.4rem;
  font-size: 0.8rem;
  opacity: 0.75;
}

.rating-control {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 180px;
}

.rating-control input[type="range"] {
  flex: 1;
}

.rating-control .rating-value {
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.page {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-advanced a {
  color: #ffd18a;
  text-decoration: underline;
}

.panel-advanced a:hover {
  color: #ffe7b8;
}

@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
  .app-main {
    padding-inline: 0.85rem;
  }
  .layout-two {
    grid-template-columns: minmax(0, 1fr);
  }
}

