/* Fasti · B / Daily Encounter production surface.
   Locked reference: docs/design/fasti-paivasuunnitelma-prototyyppi.html */

.fasti-view {
  --fasti-panel: rgba(13, 9, 7, .95);
  --fasti-panel-soft: rgba(24, 17, 12, .9);
  --fasti-ivory: #eee3cc;
  --fasti-muted: #aa9a7e;
  --fasti-dim: #756851;
  --fasti-gold: #d2aa56;
  --fasti-bronze: #805d30;
  --fasti-line: rgba(201, 151, 68, .3);
  --fasti-green: #8eaa59;
  --fasti-crimson: #9e342c;
  color: var(--fasti-ivory);
}

.fasti-scene {
  position: relative;
  min-height: calc(100svh - 70px);
  padding: 16px;
  overflow-x: hidden;
  background: #090604;
}
.fasti-scene > .backdrop-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  filter: saturate(.75) brightness(.62);
}
.fasti-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 28%, transparent 4%, rgba(4, 3, 2, .22) 52%, rgba(4, 3, 2, .82) 100%),
    linear-gradient(90deg, rgba(5, 4, 3, .7), rgba(9, 6, 4, .16) 43%, rgba(4, 3, 2, .7));
}

.fasti-book {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  min-height: 760px;
  margin: 0 auto;
  overflow: hidden;
  background: rgba(8, 6, 4, .28);
  border: 1px solid rgba(201, 151, 68, .48);
  box-shadow: 0 20px 58px rgba(0, 0, 0, .58);
}

.fasti-bookbar {
  display: grid;
  grid-template-columns: minmax(130px, auto) 76px minmax(420px, 1fr);
  align-items: stretch;
  gap: 14px;
  min-height: 78px;
  padding: 9px 16px;
  background: rgba(9, 7, 5, .98);
  border-bottom: 1px solid var(--fasti-bronze);
}
.fasti-date {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  font-family: var(--font-display);
  text-transform: uppercase;
}
.fasti-date span { color: var(--fasti-gold); font-size: 9px; letter-spacing: .16em; }
.fasti-date b { margin-top: 3px; color: #efe0c2; font-size: 14px; font-weight: 500; letter-spacing: .08em; }

.fasti-seal {
  align-self: center;
  display: grid;
  place-content: center;
  width: 64px;
  height: 68px;
  color: #f6e5c6;
  text-align: center;
  clip-path: polygon(50% 0, 94% 16%, 84% 78%, 50% 100%, 16% 78%, 6% 16%);
  background: radial-gradient(circle at 50% 32%, #6d291d, #24100d 68%);
  border: 1px solid #9d7136;
}
.fasti-seal.is-complete { background: radial-gradient(circle at 50% 32%, #566b37, #233019 68%); }
.fasti-seal b { font: 700 16px/1 var(--font-display); }
.fasti-seal span { margin-top: 4px; font: 700 7px/1.1 var(--font-display); letter-spacing: .06em; text-transform: uppercase; }

.fasti-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-self: stretch;
}
.fasti-tabs a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 58px;
  padding: 9px 13px;
  color: #94856e;
  text-decoration: none;
  background: rgba(20, 14, 10, .56);
  border: 1px solid rgba(201, 151, 68, .2);
  border-top: 2px solid rgba(201, 151, 68, .28);
}
.fasti-tabs a + a { border-left: 0; }
.fasti-tabs a:hover { color: #dbc89f; background: rgba(71, 42, 20, .45); }
.fasti-tabs a[aria-current="page"] {
  color: #f0c86f;
  background: linear-gradient(180deg, rgba(121, 70, 24, .38), rgba(35, 22, 13, .54));
  border-color: #9e7135;
  border-top-color: var(--fasti-gold);
}
.fasti-tabs b { overflow: hidden; font: 700 11px/1.2 var(--font-display); letter-spacing: .07em; text-overflow: ellipsis; text-transform: uppercase; }
.fasti-tabs span { margin-top: 4px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.fasti-main { padding: 23px 28px 48px; }
.fasti-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--fasti-bronze);
}
.fasti-head h1 {
  margin: 3px 0 0;
  color: #f3e7d1;
  font: 500 clamp(25px, 3vw, 38px)/1.08 var(--font-display);
  letter-spacing: .055em;
  text-transform: uppercase;
}
.fasti-head p { margin: 7px 0 0; color: var(--fasti-muted); font-size: 14px; }
.fasti-head > span { color: #9f8f73; font: 400 11px/1.4 var(--font-display); letter-spacing: .1em; text-align: right; }
.fasti-kicker { color: var(--fasti-gold); font: 700 9px/1.25 var(--font-display); letter-spacing: .15em; text-transform: uppercase; }

.fasti-event {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  margin-top: 18px;
  padding: 13px 15px;
  background: linear-gradient(100deg, rgba(61, 31, 17, .97), rgba(12, 9, 7, .97) 48%, rgba(31, 17, 13, .97));
  border: 1px solid rgba(201, 151, 68, .46);
  border-left: 3px solid #b98135;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .34);
}
.fasti-event[data-fasti-event="guild-war"] { border-left-color: var(--fasti-crimson); }
.fasti-event > img { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 5px 8px #000); }
.fasti-event h2 { margin: 3px 0 0; color: #f3e5cb; font: 500 17px/1.2 var(--font-display); letter-spacing: .035em; text-transform: uppercase; }
.fasti-event p { margin: 4px 0 0; color: var(--fasti-muted); font-size: 12px; }
.fasti-event-time { color: #b7a483; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fasti-event-note { margin-top: 12px; padding: 9px 11px; color: var(--fasti-muted); background: rgba(12, 9, 7, .86); border-left: 2px solid var(--fasti-bronze); font-size: 12px; }

.fasti-encounter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 43%);
  gap: 28px;
  align-items: end;
  min-height: 250px;
}
.fasti-clerk { align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end; padding: 36px 30px; text-shadow: 0 3px 10px #000; }
.fasti-clerk blockquote { margin: 7px 0 0; color: #f5e5c7; font: italic 500 29px/1.15 var(--font-display); }
.fasti-clerk p { max-width: 40ch; margin: 8px 0 0; color: #c0ad8e; font-size: 15px; font-style: italic; }
.fasti-next {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 13px;
  min-height: 216px;
  margin: 22px 0;
  padding: 17px;
  background: rgba(13, 9, 7, .95);
  border: 1px solid rgba(201, 151, 68, .55);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .38);
}
.fasti-next > img { width: 42px; height: 42px; object-fit: contain; }
.fasti-next h2 { margin: 4px 0 0; color: #f6e9cf; font: 500 18px/1.2 var(--font-display); letter-spacing: .035em; text-transform: uppercase; }
.fasti-next p { margin: 6px 0 0; color: #b8a88e; font-size: 13px; }
.fasti-next dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 13px 0 0; border-top: 1px solid rgba(201, 151, 68, .16); }
.fasti-next dl div { min-width: 0; padding: 8px 8px 0 0; }
.fasti-next dt { color: #786c58; font: 700 8px/1.2 var(--font-display); letter-spacing: .12em; text-transform: uppercase; }
.fasti-next dd { margin: 4px 0 0; color: #d9c7a7; font-size: 11px; overflow-wrap: anywhere; }
.fasti-next > .btn { grid-column: 1 / -1; width: 100%; }

.fasti-view .btn {
  min-height: 44px;
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: .065em;
}
.fasti-view .btn:not(.btn-ghost) { color: #f5ead5; background: linear-gradient(180deg, #814a1b, #4c290f); border-color: #b2813b; }
.fasti-view .btn:not(.btn-ghost):hover { background: linear-gradient(180deg, #925820, #572f11); border-color: #e0b65e; }
.fasti-view .btn.btn-ghost { color: #c6b28d; background: rgba(30, 21, 15, .68); border-color: rgba(201, 151, 68, .34); }
.fasti-view .btn:disabled { color: #756a57; background: rgba(31, 23, 17, .74); border-color: rgba(201, 151, 68, .17); opacity: .68; }

.fasti-horizon { padding: 19px 20px 21px; background: rgba(12, 9, 7, .93); border: 1px solid rgba(201, 151, 68, .24); }
.fasti-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 9px; border-bottom: 1px solid rgba(201, 151, 68, .22); }
.fasti-section-head > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 9px; }
.fasti-section-head h2 { margin: 0; color: #eadfc9; font: 500 19px/1.2 var(--font-display); letter-spacing: .06em; text-transform: uppercase; }
.fasti-section-head > div > span { color: var(--fasti-muted); font-size: 12px; }
.fasti-section-head p { display: flex; align-items: center; gap: 5px; margin: 0; color: #cbae71; font-size: 12px; white-space: nowrap; }
.fasti-section-head p img { width: 17px; height: 17px; object-fit: contain; }
.fasti-section-note { margin: 10px 0 14px; color: var(--fasti-muted); font-size: 13px; }

.fasti-ledger { overflow: hidden; border-top: 1px solid rgba(201, 151, 68, .2); border-bottom: 1px solid rgba(201, 151, 68, .2); }
.fasti-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(120px, 176px) minmax(104px, auto);
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 11px 10px;
  background: rgba(17, 12, 9, .5);
  border-bottom: 1px solid rgba(201, 151, 68, .13);
}
.fasti-row:last-child { border-bottom: 0; }
.fasti-row:hover { background: rgba(46, 31, 19, .58); }
.fasti-row.is-ready { background: linear-gradient(90deg, rgba(128, 73, 25, .42), rgba(25, 17, 12, .48) 64%); box-shadow: inset 3px 0 0 var(--fasti-gold); }
.fasti-row.is-blocked { background: linear-gradient(90deg, rgba(100, 28, 25, .2), rgba(18, 12, 10, .44)); }
.fasti-row.is-complete { opacity: .58; }
.fasti-row-icon { width: 30px; height: 30px; object-fit: contain; }
.fasti-row-copy { min-width: 0; }
.fasti-row-copy h3 { margin: 0; color: #e9dec8; font: 500 14px/1.3 var(--font-display); overflow-wrap: anywhere; }
.fasti-row-copy p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 5px 0 0; color: #93846e; font-size: 12px; }
.fasti-chip { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 7px; color: #c9aa6b; background: rgba(116, 75, 28, .16); border: 1px solid rgba(201, 151, 68, .38); font: 700 9px/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
.fasti-chip.is-active { color: #a8c77a; background: rgba(70, 91, 43, .2); border-color: rgba(142, 170, 89, .4); }
.fasti-chip.is-journey { color: #88b0ca; background: rgba(61, 99, 124, .16); border-color: rgba(102, 174, 232, .38); }
.fasti-chip.is-pinned { color: #d29688; background: rgba(122, 32, 32, .2); border-color: rgba(213, 107, 94, .4); }
.fasti-progress { min-width: 0; }
.fasti-progress > span { display: block; height: 7px; overflow: hidden; background: #241b13; border: 1px solid rgba(201, 151, 68, .22); }
.fasti-progress i { display: block; height: 100%; background: linear-gradient(90deg, #83531f, var(--fasti-gold)); }
.fasti-progress b { display: block; margin-top: 4px; color: #93846e; font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; text-align: right; }
.fasti-state { color: #93846e; font-size: 11px; text-align: right; }
.fasti-state b, .fasti-state span { display: block; }
.fasti-state b { color: #dac9aa; font: 500 11px/1.25 var(--font-display); }
.fasti-state.is-done b { color: var(--fasti-green); }
.fasti-row-mark { color: var(--fasti-green); font: 700 20px/1 var(--font-display); text-align: center; }
.fasti-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.fasti-row-actions .btn { min-width: 68px; padding: 7px 9px; font-size: 9px; }

.fasti-focus { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 14px; padding: 12px 13px; background: linear-gradient(90deg, rgba(122, 32, 32, .18), rgba(39, 24, 16, .42)); border: 1px solid rgba(213, 107, 94, .38); border-left: 3px solid var(--fasti-crimson); }
.fasti-focus > div { min-width: 0; }
.fasti-focus b, .fasti-focus small { display: block; }
.fasti-focus b { margin-top: 4px; color: #eadbc1; font: 500 14px/1.3 var(--font-display); overflow-wrap: anywhere; }
.fasti-focus small { margin-top: 4px; color: var(--fasti-muted); }
.fasti-activity { margin-top: 12px; padding: 12px; background: rgba(63, 83, 41, .1); border: 1px solid rgba(142, 170, 89, .28); }
.fasti-fineprint { margin: 8px 0 0; color: #8f826c; font-size: 11px; }

.fasti-complete-banner { display: grid; grid-template-columns: 44px 1fr; gap: 13px; align-items: center; margin: 0 0 14px; padding: 14px; background: rgba(58, 79, 36, .28); border: 1px solid rgba(142, 170, 89, .42); border-left: 3px solid var(--fasti-green); }
.fasti-complete-banner img { width: 40px; height: 40px; object-fit: contain; }
.fasti-complete-banner h2 { margin: 0; color: #dfeac5; font: 500 17px/1.2 var(--font-display); text-transform: uppercase; }
.fasti-complete-banner p { margin: 4px 0 0; color: #a8b58f; font-size: 12px; }
.fasti-empty { padding: 28px 20px; color: var(--fasti-ivory); background: rgba(17, 12, 9, .66); border: 1px dashed rgba(201, 151, 68, .34); text-align: center; }
.fasti-empty img { width: 40px; height: 40px; margin: 0 auto 9px; opacity: .72; }
.fasti-empty h3 { margin: 0; font: 500 16px/1.2 var(--font-display); }
.fasti-empty p { margin: 7px 0 0; color: var(--fasti-muted); font-size: 13px; }
.fasti-source-error { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 11px; margin: 10px 0; padding: 11px; color: #e5c6bb; background: rgba(93, 28, 24, .27); border: 1px solid rgba(213, 107, 94, .35); }
.fasti-source-error img { width: 28px; height: 28px; }
.fasti-source-error b, .fasti-source-error span { display: block; }
.fasti-source-error b { font: 500 12px/1.25 var(--font-display); }
.fasti-source-error span { margin-top: 3px; color: #aa8f84; font-size: 11px; }
.fasti-pin-toolbar { display: flex; justify-content: flex-end; margin-top: 12px; }

.fasti-armarium { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-top: 24px; padding: 15px; background: linear-gradient(140deg, rgba(48, 31, 21, .95), rgba(15, 10, 8, .98) 68%, rgba(47, 20, 18, .96)); border: 1px solid rgba(201, 151, 68, .38); border-left: 3px solid var(--fasti-crimson); }
.fasti-armarium > img { width: 42px; height: 42px; object-fit: contain; }
.fasti-armarium h3 { margin: 4px 0 0; color: #f0e1c6; font: 500 16px/1.25 var(--font-display); }
.fasti-armarium p { margin: 5px 0 0; color: var(--fasti-muted); font-size: 12px; }

.fasti-goal-dialog {
  width: min(600px, calc(100vw - 24px));
  max-height: min(760px, calc(100svh - 24px));
  padding: 0;
  color: var(--fasti-ivory);
  background: #100c09;
  border: 1px solid var(--fasti-bronze);
  box-shadow: 0 28px 75px rgba(0, 0, 0, .7);
}
.fasti-goal-dialog::backdrop { background: rgba(8, 5, 3, .82); backdrop-filter: blur(2px); }
.fasti-goal-form { overflow-y: auto; }
.fasti-goal-form > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px; background: #090705; border-bottom: 1px solid var(--fasti-bronze); }
.fasti-goal-form h2 { margin: 4px 0 0; color: #f2e3c8; font: 500 21px/1.2 var(--font-display); }
.fasti-goal-form header p { margin: 5px 0 0; color: var(--fasti-muted); font-size: 12px; }
.fasti-dialog-close { flex: none; width: 44px; height: 44px; color: #ebdabb; background: transparent; border: 1px solid var(--fasti-line); font-size: 23px; cursor: pointer; }
.fasti-goal-kinds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 18px 20px 5px; }
.fasti-goal-kinds button { min-height: 48px; padding: 7px; color: #9d8c70; background: #1b130e; border: 1px solid var(--fasti-line); font: 700 10px/1.25 var(--font-display); text-transform: uppercase; cursor: pointer; }
.fasti-goal-kinds button[aria-pressed="true"] { color: #f0c86f; background: rgba(113, 64, 23, .3); border-color: #a87937; }
.fasti-goal-form > label:not(.fasti-focus-check) { display: grid; gap: 6px; padding: 10px 20px 0; }
.fasti-goal-form > label > span:first-child { color: var(--fasti-gold); font: 700 10px/1.2 var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
.fasti-goal-form select, .fasti-goal-form input[type="number"], .fasti-goal-form input[type="text"] { width: 100%; min-height: 46px; padding: 9px 11px; color: var(--fasti-ivory); background: #1b130e; border: 1px solid var(--fasti-line); border-radius: 0; }
.fasti-focus-check { display: flex; align-items: flex-start; gap: 9px; margin: 16px 20px 0; color: var(--fasti-muted); font-size: 12px; }
.fasti-focus-check input { width: 20px; height: 20px; margin: 0; accent-color: #9d7136; }
.fasti-goal-truth { margin: 14px 20px; padding: 10px 12px; color: #c7b18b; background: rgba(116, 75, 28, .18); border-left: 3px solid var(--fasti-gold); font-size: 12px; }
.fasti-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 20px; }

.fasti-view a:focus-visible,
.fasti-view button:focus-visible,
.fasti-view input:focus-visible,
.fasti-view select:focus-visible { outline: 3px solid #f4cf72; outline-offset: 2px; }

@media (max-width: 1100px) {
  .fasti-bookbar { grid-template-columns: 116px 70px minmax(360px, 1fr); }
  .fasti-main { padding-inline: 20px; }
  .fasti-encounter { grid-template-columns: minmax(0, 1fr) minmax(330px, 46%); gap: 16px; }
  .fasti-clerk { padding-inline: 15px; }
}

@media (max-width: 899px) {
  .fasti-scene { min-height: calc(100svh - 147px); padding: 0 0 8px; }
  .fasti-book { width: 100%; min-height: 0; border-inline: 0; box-shadow: none; }
  .fasti-bookbar { position: sticky; top: 0; z-index: 4; grid-template-columns: 1fr; gap: 6px; min-height: 0; padding: 8px; }
  .fasti-date, .fasti-seal { display: none; }
  .fasti-tabs { width: 100%; }
  .fasti-tabs a { align-items: center; min-height: 48px; padding: 6px 4px; text-align: center; }
  .fasti-tabs b { font-size: 9px; }
  .fasti-tabs span { display: none; }
  .fasti-main { padding: 16px 12px 28px; }
  .fasti-head { padding-bottom: 12px; }
  .fasti-head h1 { font-size: 25px; }
  .fasti-head p { font-size: 12px; }
  .fasti-head > span { display: none; }
  .fasti-event { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 9px; min-height: 0; margin-top: 12px; padding: 10px; }
  .fasti-event > img { width: 34px; height: 34px; }
  .fasti-event h2 { font-size: 13px; }
  .fasti-event p { display: none; }
  .fasti-event-time { grid-column: 2; }
  .fasti-event > .btn { grid-column: 3; grid-row: 1 / span 2; align-self: stretch; padding-inline: 9px; }
  .fasti-encounter { display: block; min-height: 0; }
  .fasti-clerk { display: none; }
  .fasti-next { min-height: 0; margin: 14px 0 18px; padding: 14px; }
  .fasti-next dl { grid-template-columns: 1fr; }
  .fasti-next dl div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
  .fasti-next dd { text-align: right; }
  .fasti-horizon { padding: 14px 10px 16px; }
  .fasti-section-head { align-items: flex-start; }
  .fasti-section-head > div { display: block; }
  .fasti-section-head > div > span { display: block; margin-top: 4px; }
  .fasti-row { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 9px; padding: 12px 6px; }
  .fasti-row-icon { width: 27px; height: 27px; }
  .fasti-progress { grid-column: 2 / -1; width: 100%; }
  .fasti-row > .btn, .fasti-row > .fasti-row-mark, .fasti-row-actions { grid-column: 2 / -1; width: 100%; }
  .fasti-row-actions .btn { flex: 1 1 88px; }
  .fasti-state { grid-column: 3; }
  .fasti-focus { align-items: stretch; flex-direction: column; }
  .fasti-focus .btn { width: 100%; }
  .fasti-armarium { grid-template-columns: 38px minmax(0, 1fr); }
  .fasti-armarium > img { width: 36px; height: 36px; }
  .fasti-armarium > .btn { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 560px) {
  .fasti-main { padding-inline: 9px; }
  .fasti-head h1 { font-size: 22px; }
  .fasti-event { grid-template-columns: 32px minmax(0, 1fr); }
  .fasti-event-time { grid-column: 2; }
  .fasti-event > .btn { grid-column: 1 / -1; grid-row: auto; width: 100%; }
  .fasti-section-head { display: block; }
  .fasti-section-head p { margin-top: 7px; white-space: normal; }
  .fasti-goal-kinds { grid-template-columns: repeat(2, 1fr); }
  .fasti-dialog-actions { flex-direction: column-reverse; }
  .fasti-dialog-actions .btn { width: 100%; }
  .fasti-source-error { grid-template-columns: 28px minmax(0, 1fr); }
  .fasti-source-error .btn { grid-column: 1 / -1; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .fasti-view *, .fasti-view *::before, .fasti-view *::after { animation: none !important; transition: none !important; }
}
