/* Hearthmist module styles: events */

/* ---------- the open event: a plate in the bottom-right corner of the map ---------- */

.events-plate, .events-buffs { width: 280px; max-width: 100%; }
.events-plate { padding: 10px var(--s3) var(--s3); }
.events-plate:not([hidden]) { animation: events-in 0.25s ease-out both; }
@keyframes events-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.events-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.events-name {
  font-family: var(--serif);
  font-size: var(--fs-name);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
}
/* Time left to answer: a figure beside the name. */
.events-left { flex: none; color: var(--muted); white-space: nowrap; }
.events-text { margin-top: 5px; color: var(--text-2); line-height: 1.4; }

.events-choices { display: grid; gap: var(--s2); margin-top: 10px; }
.events-choice {
  display: flex;
  justify-content: space-between;
  width: 100%;
  min-height: 32px;
  padding: 4px 10px;
  font-size: var(--fs-text);
  text-align: left;
  white-space: normal;
}
.btn.events-choice > span:only-child { margin: 0; }
.events-choice.ghost { padding-left: 10px; }
.events-fx { display: block; margin: 3px 0 0 11px; color: var(--muted); font-size: var(--fs-small); line-height: 1.3; }
.events-fx .good { font-weight: 700; }
.events-fx .bad { font-weight: 700; }


/* ---------- timed effects in force, under the event ---------- */

.events-buff { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); padding: 1px 0; }
.events-buff > span:first-child { color: var(--text-2); }
.events-buff > span:last-child { flex: none; color: var(--muted); }
.events-buff b.good { color: var(--good); }
.events-buff b.bad { color: var(--bad); }

/* ---------- one tappable line, for small screens ---------- */

.events-line {
  display: none;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  width: 100%;
  padding: 6px 11px;
  background: none;
  border: 0;
  border-radius: var(--r);
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
}
.events-line:hover { background: var(--panel-2); }
.events-line .events-name { font-size: var(--fs-body); }
.events-line > span:last-child { flex: none; color: var(--muted); }
.events-line b.good { color: var(--good); }
.events-line b.bad { color: var(--bad); }

/* ---------- the same event in the shared dialog ---------- */

.events-dlg .events-choices { margin-top: var(--s4); gap: 10px; }
.events-dlg .events-choice { min-height: 38px; padding: 6px 12px; font-size: var(--fs-body); }
.events-dlg .events-fx { margin-left: 13px; }
#dlg-body .events-timer { margin-top: var(--s4); color: var(--muted); font-size: var(--fs-small); }
.events-dlg .dlg-actions { margin-top: var(--s4); }
.events-bufflist { margin-top: var(--s3); font-size: var(--fs-text); }
.events-bufflist .events-buff { padding: 3px 0; }

/* ---------- chronicle, under the idle Land tab ---------- */

.events-log { margin-top: var(--s2); }
.events-log li { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); padding: 3px 0; }
.events-log b { flex: none; font-family: var(--serif); font-size: var(--fs-body); font-weight: 400; }
.events-log span { color: var(--muted); font-size: var(--fs-text); text-align: right; }

/* On a map too narrow to keep the plate off the fire (a tablet, a phone), both plates fold to one line each;
   a tap opens the same thing in the dialog. */
@media (max-width: 1100px) {
  .events-plate, .events-buffs { width: auto; max-width: 100%; padding: 0; }
  .events-plate .events-full, .events-buffs .events-full { display: none; }
  .events-line { display: flex; min-height: 34px; align-items: center; }
  .events-line > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 820px) {
  .events-line { min-height: 38px; }
  /* The bottom row of the map belongs to the next-reveal note on the left: stay clear of it. */
  .events-buffs { max-width: min(100%, calc(100vw - 190px)); }
  .events-buffs[hidden] + .events-plate { margin-bottom: 40px; }
}
