:root {
  --ravo-navy: #081829;
  --ravo-violet: #6d46f6;
  --ravo-teal: #20d2b1;
  --ravo-yellow: #f8d615;
  --ravo-blue: #1f76d8;
  --ravo-pink: #ff005e;
  --ravo-coral: #ff4778;
  --slate-100: #d9d9d9;
  --slate-300: #7e8b9c;
  --slate-500: #29354a;
  --surface: #0e2238;
  --surface-2: #132a44;
  --surface-3: #193451;
  --text: #f5f8ff;
  --muted: #a5b2c6;
  --line: rgba(167, 184, 206, 0.28);
  --good: #27cc8f;
  --bad: #ff6f72;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 86% 12%, rgba(109, 70, 246, 0.26), transparent 35%),
    radial-gradient(circle at 6% 80%, rgba(32, 210, 177, 0.14), transparent 40%),
    linear-gradient(180deg, #07111d 0%, #081829 100%);
}

.ravo-ribbon {
  width: min(1180px, 94vw);
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.ravo-ribbon span {
  display: block;
  height: 8px;
  border-radius: 999px;
}

.ravo-ribbon span:nth-child(1) {
  background: var(--ravo-violet);
}

.ravo-ribbon span:nth-child(2) {
  background: var(--ravo-yellow);
}

.ravo-ribbon span:nth-child(3) {
  background: var(--ravo-teal);
}

.ravo-ribbon span:nth-child(4) {
  background: var(--ravo-pink);
}

.ravo-ribbon span:nth-child(5) {
  background: #4aaedc;
}

.app-shell {
  width: min(1180px, 94vw);
  margin: 14px auto 28px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(320px, 1fr) minmax(380px, 1.25fr);
}

.card {
  background: linear-gradient(180deg, rgba(19, 42, 68, 0.88), rgba(9, 28, 47, 0.94));
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow:
    0 20px 55px rgba(2, 9, 20, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  padding: 22px;
}

.setup-card {
  position: relative;
  overflow: hidden;
}

.setup-card::before {
  content: "";
  position: absolute;
  right: -100px;
  top: -90px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(248, 214, 21, 0.23), transparent 70%);
}

.section-head h1,
.section-head h2 {
  margin: 4px 0 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.hero-logo {
  width: 229px;
  max-width: 100%;
}

.hero-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.field {
  margin-top: 16px;
}

.hidden {
  display: none;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
  color: #ecf3ff;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  color: #eaf3ff;
  border-radius: 12px;
  padding: 11px 12px;
  background: rgba(2, 16, 31, 0.58);
}

input[readonly] {
  background: rgba(2, 16, 31, 0.8);
  color: #d6e4f7;
}

input::placeholder {
  color: #8695a8;
}

select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a5b2c6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 14px;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--ravo-violet);
  box-shadow: 0 0 0 3px rgba(109, 70, 246, 0.23);
}

.inline-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

button {
  border: 1px solid transparent;
  border-radius: 12px;
  background: linear-gradient(120deg, #7c59ff, #5d35ed);
  color: #f8f6ff;
  font-weight: 800;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

button:disabled {
  cursor: not-allowed;
  transform: none;
  filter: none;
  opacity: 0.5;
}

.primary {
  width: 100%;
  margin-top: 16px;
  background: linear-gradient(115deg, #20d2b1, #4ba5f3);
  color: #042136;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(74, 174, 220, 0.45);
  background: rgba(25, 52, 81, 0.85);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.9rem;
}

.chip button {
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid rgba(255, 71, 120, 0.45);
  background: rgba(255, 71, 120, 0.2);
  color: #ffd8e3;
}

.hint,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.rank-grid {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.rank-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: 8px;
}

.rank-row span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.84rem;
  color: #9cb1cb;
}

.chat-feed {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(17, 38, 61, 0.96), rgba(8, 24, 41, 0.96)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 22px
    );
  min-height: 210px;
  max-height: 360px;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-empty {
  color: var(--muted);
  text-align: center;
  margin: auto;
}

.msg {
  max-width: 86%;
  align-self: flex-start;
  border-radius: 14px 14px 14px 6px;
  border: 1px solid rgba(167, 184, 206, 0.22);
  background: linear-gradient(140deg, rgba(27, 53, 81, 0.9), rgba(16, 36, 58, 0.86));
  padding: 10px 12px;
}

.msg-tone-0 {
  border-left: 4px solid var(--ravo-violet);
}

.msg-tone-1 {
  border-left: 4px solid var(--ravo-yellow);
}

.msg-tone-2 {
  border-left: 4px solid var(--ravo-teal);
}

.msg-tone-3 {
  border-left: 4px solid var(--ravo-pink);
}

.msg-tone-4 {
  border-left: 4px solid #4aaedc;
}

.msg .meta {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #c9d8ea;
  margin-bottom: 6px;
}

.msg .rank-text {
  margin: 0;
  color: #ecf3ff;
}

.results-panel {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.results-panel h3 {
  margin: 0 0 8px;
}

.pref-summary {
  border: 1px solid rgba(167, 184, 206, 0.27);
  border-radius: 11px;
  padding: 9px 10px;
  margin-top: 6px;
  background: rgba(19, 42, 68, 0.55);
  display: grid;
  gap: 6px;
}

.rank-order {
  display: grid;
  gap: 8px;
  margin: 8px 0 10px;
}

.rank-order-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(167, 184, 206, 0.22);
  border-radius: 11px;
  background: rgba(19, 42, 68, 0.45);
  padding: 7px 9px;
}

.rank-badge {
  min-width: 50px;
  text-align: center;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 5px 8px;
}

.rank-color-1 {
  background: rgba(109, 70, 246, 0.24);
  border: 1px solid rgba(109, 70, 246, 0.6);
  color: #ede8ff;
}

.rank-color-2 {
  background: rgba(248, 214, 21, 0.2);
  border: 1px solid rgba(248, 214, 21, 0.65);
  color: #fff6bd;
}

.rank-color-3 {
  background: rgba(32, 210, 177, 0.2);
  border: 1px solid rgba(32, 210, 177, 0.62);
  color: #cbfff2;
}

.rank-color-4 {
  background: rgba(255, 0, 94, 0.2);
  border: 1px solid rgba(255, 0, 94, 0.62);
  color: #ffd0e2;
}

.rank-color-5 {
  background: rgba(74, 174, 220, 0.2);
  border: 1px solid rgba(74, 174, 220, 0.62);
  color: #d5f3ff;
}

.winner {
  font-weight: 800;
  color: var(--good);
}

.warn {
  color: var(--bad);
  font-weight: 700;
}

.mono {
  font-family: "IBM Plex Mono", monospace;
}

.round {
  border: 1px solid rgba(167, 184, 206, 0.27);
  border-radius: 11px;
  padding: 9px 10px;
  margin-top: 8px;
  background: rgba(26, 50, 78, 0.6);
}

.round strong {
  color: #eaf3ff;
}

@media (max-width: 920px) {
  .ravo-ribbon {
    margin-top: 16px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    margin-top: 10px;
  }
}
