/* The community event page as a game screen (views/eventPage.jsx +
   views/eventProgressPartial.jsx). Frame, ribbon banner and brackets come from
   the trophy hall (public/achievements-hall.css: .ach-hall-frame,
   .ach-hall-banner, .ach-hall-bracket); everything here is scoped to .ev-hall.
   The old public/event.css stays for the claim modal and other event views. */

.ev-hall {
  --ev-ink: #f6e9cc;
  --ev-ink-dim: #d4c39f;
  --ev-gold: #ffd23a;
  --ev-panel: rgba(18, 14, 10, 0.58);
  --ev-edge: rgba(255, 220, 160, 0.16);
  padding: 22px 12px 40px;
  color: var(--ev-ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.ev-hall .ev-frame {
  width: auto;
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: inherit;
}
.ev-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font: 700 1rem/1.2 "Cinzel", serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ev-ink);
}
.ev-section-title i { color: var(--ev-gold); }

.ev-preview-note {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(120, 80, 200, 0.3);
  border: 1px dashed rgba(200, 170, 255, 0.6);
  font-size: 0.85rem;
}

/* ── Hero ── */
.ev-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 20px;
  border-radius: 12px;
  text-align: center;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--ev-edge);
}
.ev-hero.has-painting {
  min-height: 340px;
  justify-content: flex-end;
  background:
    linear-gradient(180deg, rgba(12, 9, 6, 0.15) 0%, rgba(12, 9, 6, 0.55) 45%, rgba(12, 9, 6, 0.92) 100%),
    var(--ev-hero-img) center 30% / cover no-repeat;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.55);
}
.ev-type-seal {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(#7a1f16, #4e120c);
  border: 1px solid rgba(255, 210, 58, 0.6);
  color: #ffe9b0;
  font: 800 0.72rem/1.2 system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.ev-hero:not(.has-painting) .ev-type-seal { position: static; }
.ev-hero-art {
  width: 150px;
  height: auto;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
}
.ev-banner { margin-top: 0; }
.ev-banner h2,
.ev-hall .event-title {
  margin: 0 0 6%;
  max-width: 64%;
  font: 700 clamp(0.9rem, 0.55rem + 1.6vw, 1.5rem)/1.05 "Cinzel", serif;
  color: #3d2000;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}
.ev-hero-desc {
  margin: -6px 0 0;
  max-width: 560px;
  font-size: 0.98rem;
  line-height: 1.4;
  color: var(--ev-ink);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.ev-hero-note {
  margin: 0;
  max-width: 520px;
  font-size: 0.82rem;
  color: var(--ev-ink-dim);
}

/* Countdown on iron plates. */
.ev-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.ev-timer-label {
  font: 700 0.78rem/1 "Cinzel", serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ev-ink-dim);
}
.ev-timer.is-ended .ev-timer-label {
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  font-size: 0.95rem;
  color: var(--ev-ink);
}
.ev-timer-plates { display: flex; gap: 8px; }
.ev-plate {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 58px;
  padding: 6px 6px 4px;
  border-radius: 8px;
  background: linear-gradient(160deg, #5b6068 0%, #3a3e44 50%, #26292d 100%);
  border: 1px solid rgba(0, 0, 0, 0.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 3px 6px rgba(0, 0, 0, 0.5);
}
.ev-plate[hidden] { display: none; }
.ev-plate b {
  font: 800 1.6rem/1 "Cinzel", serif;
  color: var(--ev-gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6);
}
.ev-plate small {
  margin-top: 2px;
  font: 700 0.62rem/1 system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b8bec7;
}

/* Buttons: one big gold one, a quieter wooden one for the story. */
.ev-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}
.ev-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 26px;
  border: 2px solid #7a5310;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffe48a 0%, #f0b52e 55%, #c98a12 100%);
  color: #3d2000;
  font: 800 1.05rem/1.1 "Cinzel", serif;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    0 4px 0 #6b4410,
    0 8px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.08s ease, filter 0.15s ease;
}
.ev-cta:hover,
.ev-cta:focus-visible { filter: brightness(1.08); outline: none; }
.ev-cta:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55), 0 1px 0 #6b4410, 0 4px 8px rgba(0, 0, 0, 0.45); }
/* Secondary (the story): dark with a gold edge, so the gold Play stays the
   main choice. */
.ev-cta-alt {
  min-height: 44px;
  padding: 8px 20px;
  border: 2px solid rgba(255, 210, 58, 0.75);
  background: linear-gradient(180deg, rgba(58, 42, 24, 0.92) 0%, rgba(28, 20, 11, 0.92) 100%);
  color: #ffe27a;
  font-size: 0.9rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 230, 150, 0.25),
    0 3px 0 #120c05,
    0 6px 12px rgba(0, 0, 0, 0.45);
}
.ev-cta-alt:hover,
.ev-cta-alt:focus-visible {
  border-color: #ffd23a;
  background: linear-gradient(180deg, rgba(78, 56, 30, 0.95) 0%, rgba(38, 27, 14, 0.95) 100%);
}
.ev-cta-alt:active {
  box-shadow: inset 0 1px 0 rgba(255, 230, 150, 0.25), 0 1px 0 #120c05, 0 3px 6px rgba(0, 0, 0, 0.45);
}

/* ── How to take part ── */
.ev-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ev-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background:
    linear-gradient(rgba(249, 230, 190, 0.94), rgba(236, 210, 160, 0.94)),
    url("/gui/paper_texture.png") center / cover;
  color: #3d2000;
  font-size: 0.88rem;
  line-height: 1.35;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}
.ev-step-seal {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c0392b, #7d1f15);
  color: #ffe9b0;
  font-size: 1.05rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45), inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}
.ev-step-num {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3d2000;
  color: #ffe9b0;
  font: 800 0.66rem/1 system-ui, sans-serif;
}

/* ── Panels ── */
.ev-panel {
  padding: 14px;
  border-radius: 12px;
  background: var(--ev-panel);
  border: 1px solid var(--ev-edge);
}
.ev-panel-sub {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--ev-ink-dim);
}

/* Community goal (eventProgressPartial). */
.ev-goal-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 26px;
}
.ev-goal-count { font-size: 1rem; }
.ev-goal-count strong {
  font: 800 1.5rem/1 "Cinzel", serif;
  color: var(--ev-gold);
}
.ev-goal-count i { color: var(--ev-gold); }
.ev-goal-next {
  font-weight: 700;
  font-size: 0.9rem;
  color: #ffe27a;
}
.ev-road {
  position: relative;
  margin: 0 14px 34px;
}
.ev-road-track {
  height: 16px;
  border-radius: 8px;
  background: url("/gui/dirt_texture_mini_dark.png") center / 120px auto, #3a2a1a;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.ev-road-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, #b8860b, #ffd23a);
  box-shadow: 0 0 10px rgba(255, 210, 58, 0.6);
  transition: width 0.8s ease-out;
}
.ev-road-stop {
  position: absolute;
  top: 8px;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ev-road-stop-pin {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(160deg, #5b6068, #26292d);
  border: 2px solid #8a8f98;
  color: #c7ccd4;
  font-size: 0.75rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}
.ev-road-stop.is-reached .ev-road-stop-pin {
  background: linear-gradient(160deg, #ffe48a, #c98a12);
  border-color: #fff3c4;
  color: #3d2000;
  box-shadow: 0 0 10px rgba(255, 210, 58, 0.8);
}
.ev-road-stop.is-next .ev-road-stop-pin {
  border-color: var(--ev-gold);
  color: var(--ev-gold);
  animation: evStopPulse 1.6s ease-in-out infinite;
}
.ev-road-stop-label {
  position: absolute;
  top: 34px;
  font: 800 0.8rem/1 system-ui, sans-serif;
  color: var(--ev-ink-dim);
}
.ev-rewards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.ev-reward {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--ev-edge);
  text-align: center;
}
.ev-reward.is-reached {
  border-color: rgba(255, 210, 58, 0.75);
  box-shadow: 0 0 14px rgba(255, 210, 58, 0.3);
}
.ev-reward.is-next { border-color: rgba(255, 210, 58, 0.45); border-style: dashed; }
.ev-reward-state {
  font: 800 0.66rem/1 system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ev-ink-dim);
}
.ev-reward.is-reached .ev-reward-state { color: #7ee07e; }
.ev-reward.is-next .ev-reward-state { color: var(--ev-gold); }
.ev-reward-img {
  display: grid;
  place-items: center;
  height: 78px;
}
.ev-reward-castle { width: auto; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6)); }
.ev-reward-crown { font-size: 2.8rem; color: var(--ev-gold); }
.ev-reward-cards { position: relative; width: 74px; }
.ev-reward-cards img {
  position: absolute;
  width: 40px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
}
.ev-reward-cards img:nth-child(1) { transform: rotate(-14deg) translateX(-14px); }
.ev-reward-cards img:nth-child(2) { transform: rotate(0deg); z-index: 1; }
.ev-reward-cards img:nth-child(3) { transform: rotate(14deg) translateX(14px); z-index: 2; }
.ev-reward:not(.is-reached) .ev-reward-img { filter: grayscale(0.7) brightness(0.75); }
.ev-reward:not(.is-reached) .ev-reward-castle { filter: grayscale(0.7) brightness(0.75) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6)); }
.ev-reward-name {
  font: 700 0.95rem/1.2 "Cinzel", serif;
  color: var(--ev-ink);
}
.ev-reward.is-grand .ev-reward-name { color: #ffe27a; }
.ev-reward-at { font-size: 0.78rem; color: var(--ev-ink-dim); }

/* ── Your part ── */
.ev-yours {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--ev-edge);
}
.ev-yours-icon {
  flex: 0 0 auto;
  font-size: 1.8rem;
  color: var(--ev-gold);
}
.ev-yours-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}
.ev-yours-text strong { font: 700 1rem/1.25 "Cinzel", serif; }
.ev-yours-text span { font-size: 0.88rem; color: var(--ev-ink-dim); }
.ev-yours.is-done { border-color: rgba(126, 224, 126, 0.5); }
.ev-yours.is-done .ev-yours-icon { color: #7ee07e; }
.ev-yours.is-muted .ev-yours-icon { color: var(--ev-ink-dim); }
.ev-yours-claim {
  flex-wrap: wrap;
  border-color: rgba(255, 210, 58, 0.75);
  background: linear-gradient(rgba(70, 48, 10, 0.85), rgba(40, 26, 6, 0.85));
  box-shadow: 0 0 18px rgba(255, 210, 58, 0.25);
}
.ev-yours-chest {
  width: 64px;
  height: 64px;
  animation: evChestShake 2.2s ease-in-out infinite;
}

/* ── Notice board + chat ── */
.ev-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 14px;
}
.ev-board,
.ev-chat { min-width: 0; }
.ev-hall .ev-board-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 10px;
  background:
    linear-gradient(rgba(249, 230, 190, 0.95), rgba(236, 210, 160, 0.95)),
    url("/gui/paper_texture.png") center / cover;
  color: #3d2000;
  box-shadow: inset 0 0 14px rgba(120, 70, 20, 0.35), 0 3px 8px rgba(0, 0, 0, 0.4);
}
.ev-hall .event-log-list { display: flex; flex-direction: column; gap: 2px; }
.ev-hall .event-log-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
  padding: 6px 4px;
  border-bottom: 1px dashed rgba(61, 32, 0, 0.25);
  background: none;
  font-size: 0.86rem;
  white-space: normal;
}
.ev-hall .event-log-entry:last-child { border-bottom: 0; }
.ev-hall .event-log-icon { color: #8a5a12; }
.ev-hall .event-log-claim .event-log-icon { color: #b8860b; }
.ev-hall .event-log-player { font-weight: 800; color: #3d2000; }
.ev-hall .event-log-text { flex: 1 1 auto; min-width: 0; color: #5a3a12; }
.ev-hall .event-log-time { margin-left: auto; font-size: 0.75rem; color: #8a6a3a; white-space: nowrap; }
.ev-hall .event-log-empty { text-align: center; color: #5a3a12; }

.ev-hall .event-chat-area {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--ev-edge);
  overflow: hidden;
}
.ev-hall .event-chat-messages {
  height: 260px;
  max-height: none;
  overflow-y: auto;
  padding: 10px 12px;
  background: none;
}
.ev-hall .event-chat-msg {
  padding: 4px 0;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--ev-ink);
  overflow-wrap: anywhere;
}
.ev-hall .event-chat-name { font-weight: 800; color: #ffe27a; margin-right: 4px; }
.ev-hall .event-chat-admin .event-chat-name { color: #d6b4ff; }
.ev-hall .event-chat-time { margin-right: 6px; font-size: 0.72rem; color: #a99a7c; }
.ev-hall .event-chat-text { color: var(--ev-ink); }
.ev-hall .event-chat-empty { color: var(--ev-ink-dim); text-align: center; padding: 20px 0; }
.ev-hall .event-chat-form {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--ev-edge);
  background: rgba(0, 0, 0, 0.3);
}
.ev-hall .event-chat-form input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 220, 160, 0.3);
  background: rgba(255, 248, 230, 0.95);
  color: #3d2000;
  font: inherit;
}
.ev-hall .event-chat-form button {
  padding: 0 14px;
  border: 1px solid #7a5310;
  border-radius: 8px;
  background: linear-gradient(#ffe48a, #c98a12);
  color: #3d2000;
  cursor: pointer;
}
.ev-hall .event-chat-no-name {
  padding: 10px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ev-ink-dim);
  border-top: 1px solid var(--ev-edge);
}

/* ── No event ── */
.ev-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 10px 26px;
  text-align: center;
}
.ev-empty p { margin: 0; color: var(--ev-ink-dim); }

/* ── Phones ── */
@media (max-width: 700px) {
  .ev-steps { grid-template-columns: 1fr; }
  .ev-columns { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .ev-hall { padding: 14px 6px 30px; }
  .ev-hall .ev-frame { padding: 12px 10px 18px; border-width: 9px; }
  .ev-hero.has-painting { min-height: 300px; }
  .ev-type-seal { top: 8px; left: 8px; }
  .ev-plate { min-width: 50px; }
  .ev-plate b { font-size: 1.35rem; }
  .ev-cta { width: 100%; }
  .ev-rewards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .ev-reward { padding: 8px 4px 10px; }
  .ev-reward-img { height: 60px; }
  .ev-reward-name { font-size: 0.8rem; }
  .ev-road { margin: 0 12px 34px; }
}

@keyframes evStopPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 210, 58, 0.6); }
  50% { box-shadow: 0 0 0 7px rgba(255, 210, 58, 0); }
}
@keyframes evChestShake {
  0%, 70%, 100% { transform: rotate(0); }
  74% { transform: rotate(-9deg); }
  80% { transform: rotate(8deg); }
  86% { transform: rotate(-6deg); }
  92% { transform: rotate(4deg); }
}
@media (prefers-reduced-motion: reduce) {
  .ev-road-stop.is-next .ev-road-stop-pin,
  .ev-yours-chest { animation: none; }
}

/* The type seal sits above the ribbon, never under it. */
.ev-type-seal,
.ev-hero:not(.has-painting) .ev-type-seal {
  position: static;
}
.ev-hero.has-painting { padding-top: 26px; }

/* The castle prize is a dark painting: greying it out made it unreadable, so a
   locked one is only dimmed, and it gets more room than the card stacks. */
.ev-reward.is-grand .ev-reward-img { height: 96px; }
.ev-reward:not(.is-reached) .ev-reward-castle {
  filter: brightness(0.85) drop-shadow(0 0 10px rgba(160, 120, 255, 0.35)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}
.ev-reward-castle { max-height: 100%; }

@media (max-width: 600px) {
  .ev-reward-state { font-size: 0.56rem; letter-spacing: 0.02em; }
  .ev-reward.is-grand .ev-reward-img { height: 74px; }
}
