/* MEGURU replay layer — run themes, quests, mastery and persistent stickers. */

.replay-button {
  min-height: 42px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 13px;
  padding: 6px 10px;
  background: linear-gradient(135deg,rgba(255,44,168,.2),rgba(0,229,255,.12));
  color: #fff;
  display: grid;
  grid-template-columns: 22px auto;
  align-items: center;
  column-gap: 6px;
  cursor: pointer;
  box-shadow: inset 0 0 18px rgba(0,229,255,.05);
}
.replay-button > span { grid-row: 1 / 3; color:#ff75c6; font-size:17px; filter:drop-shadow(0 0 8px #ff2ca8); }
.replay-button b { font-size:10px; letter-spacing:.08em; line-height:1; }
.replay-button small { font-size:9px; color:#8ff5ff; line-height:1; }
.replay-button:hover { border-color:#ff75c6; transform:translateY(-1px); }

.run-preview {
  --run-color:#49bde8;
  margin: 14px 0 16px;
  max-width: 760px;
  display: grid;
  grid-template-columns: 64px minmax(220px,1fr) minmax(210px,.9fr);
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb,var(--run-color) 55%,rgba(255,255,255,.14));
  border-radius: 18px;
  background: linear-gradient(125deg,color-mix(in srgb,var(--run-color) 16%,rgba(8,28,28,.88)),rgba(6,18,20,.82));
  box-shadow: 0 15px 40px rgba(0,0,0,.18),inset 0 1px rgba(255,255,255,.08);
  position: relative;
  overflow: hidden;
}
.run-preview::after { content:""; position:absolute; inset:auto -30px -70px auto; width:170px; height:170px; border:25px solid color-mix(in srgb,var(--run-color) 16%,transparent); border-radius:50%; }
.run-preview-icon { width:58px; aspect-ratio:1; display:grid; place-items:center; border-radius:16px; font-size:30px; background:color-mix(in srgb,var(--run-color) 22%,#0b2322); border:1px solid var(--run-color); box-shadow:0 0 26px color-mix(in srgb,var(--run-color) 30%,transparent); }
.run-preview small { display:block; color:var(--run-color); font-size:9px; font-weight:900; letter-spacing:.13em; }
.run-preview h2 { margin:3px 0 2px; font-size:18px; color:#fff; }
.run-preview p { margin:0; color:rgba(255,255,255,.72); font-size:11px; line-height:1.55; }
.run-preview-quests { display:grid; gap:4px; position:relative; z-index:1; }
.run-preview-quests span { border:1px solid rgba(255,255,255,.09); border-radius:8px; padding:5px 7px; color:#eafffa; background:rgba(255,255,255,.04); font-size:9px; line-height:1.2; }

.sort-adventure-card {
  --run-color:#49bde8;
  width:min(1180px,calc(100% - 40px));
  margin:0 auto 16px;
  display:grid;
  grid-template-columns:58px 1fr auto;
  align-items:center;
  gap:14px;
  padding:11px 14px;
  border:1px solid rgba(255,255,255,.64);
  border-radius:18px;
  background:linear-gradient(120deg,rgba(255,255,255,.82),rgba(242,252,255,.62));
  box-shadow:0 13px 32px rgba(38,90,84,.1);
  backdrop-filter:blur(14px);
}
.sort-adventure-card > span { width:52px; aspect-ratio:1; display:grid; place-items:center; border-radius:15px; background:linear-gradient(145deg,#fff,#dff8ff); font-size:27px; box-shadow:0 8px 20px rgba(45,122,137,.15); }
.sort-adventure-card small { display:block; color:#4b8f8a; font-size:9px; font-weight:900; letter-spacing:.13em; }
.sort-adventure-card b { display:block; margin:2px 0; color:#163f3a; font-size:16px; }
.sort-adventure-card p { margin:0; color:#53746e; font-size:11px; }
.sort-mastery { min-width:130px; padding:8px 11px; border-radius:13px; background:#153f3a; color:#fff; text-align:center; }
.sort-mastery strong { display:block; color:#caff52; font-size:23px; line-height:1; }
.sort-mastery span { display:block; margin-top:3px; max-width:170px; color:#bde9e3; font-size:8px; }
.friend-album #sort-collection { grid-template-columns:repeat(6,1fr); gap:4px; }
.collection-gem.is-silver { box-shadow:inset 0 0 0 2px #dce9ef,0 0 9px rgba(137,210,255,.35); }
.collection-gem.is-gold { box-shadow:inset 0 0 0 2px #ffd75b,0 0 13px rgba(255,194,55,.55); transform:translateY(-1px); }
.sort-feedback small { font-size:9px; opacity:.72; }

.draft-actions { display:grid; grid-template-columns:auto 1fr; gap:8px; align-items:stretch; }
.draft-actions .draft-confirm { width:100%; }
.draft-reroll { border:1px solid rgba(0,229,255,.35); border-radius:12px; padding:8px 10px; background:rgba(0,229,255,.08); color:#b9faff; font:800 10px/1.2 inherit; cursor:pointer; }
.draft-reroll small { display:block; margin-top:3px; color:#fff; font-size:8px; }
.draft-reroll:hover:not(:disabled) { background:rgba(0,229,255,.17); border-color:#00e5ff; }
.draft-reroll:disabled { opacity:.35; cursor:not-allowed; }
.draft-card.is-mission-fit { box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--card-color) 70%,#fff),0 0 22px color-mix(in srgb,var(--card-color) 16%,transparent); }
.draft-card b em { display:inline-block; margin-left:4px; border-radius:5px; padding:2px 4px; background:#caff52; color:#173b34; font-style:normal; font-size:7px; vertical-align:2px; }
.incident-banner.is-forecast { border-color:#ffd45a; background:linear-gradient(90deg,rgba(255,212,90,.13),rgba(0,229,255,.05)); }
.incident-banner.is-forecast #incident-type { color:#ffd45a; }

.replay-result {
  --run-color:#49bde8;
  width:min(1080px,calc(100% - 40px));
  margin:18px auto;
  display:grid;
  grid-template-columns:160px 1fr 190px;
  gap:18px;
  align-items:center;
  padding:16px;
  border:1px solid color-mix(in srgb,var(--run-color) 48%,rgba(255,255,255,.2));
  border-radius:20px;
  color:#fff;
  background:linear-gradient(125deg,color-mix(in srgb,var(--run-color) 18%,#102d29),#0c211f 58%,#091916);
  box-shadow:0 20px 45px rgba(9,31,28,.23),inset 0 1px rgba(255,255,255,.08);
}
.replay-result-score { align-self:stretch; display:flex; flex-direction:column; justify-content:center; align-items:center; border-radius:15px; background:color-mix(in srgb,var(--run-color) 14%,rgba(0,0,0,.25)); border:1px solid color-mix(in srgb,var(--run-color) 36%,transparent); }
.replay-result-score small,.replay-result > div > small { color:var(--run-color); font-size:9px; font-weight:900; letter-spacing:.12em; }
.replay-result-score strong { font-size:30px; line-height:1.15; }
.replay-result-score b { color:#caff52; font-size:11px; }
.replay-result h3 { margin:4px 0 8px; font-size:18px; }
.replay-result-quests { display:grid; grid-template-columns:repeat(3,1fr); gap:5px; }
.replay-quest { display:flex; align-items:center; gap:7px; min-width:0; padding:7px; border:1px solid rgba(255,255,255,.09); border-radius:9px; background:rgba(255,255,255,.035); opacity:.58; }
.replay-quest.is-cleared { opacity:1; border-color:rgba(202,255,82,.5); background:rgba(202,255,82,.09); }
.replay-quest > span { flex:0 0 25px; width:25px; aspect-ratio:1; display:grid; place-items:center; border-radius:7px; color:#0d2a25; background:#dbe9e6; font-size:11px; font-weight:1000; }
.replay-quest.is-cleared > span { background:#caff52; }
.replay-quest small { display:block; color:#80dcd2; font-size:7px; font-weight:900; }
.replay-quest b { display:block; color:#fff; font-size:8px; line-height:1.25; }
.replay-quest p { margin:2px 0 0; color:rgba(255,255,255,.6); font-size:8px; line-height:1.35; }
.replay-result-reward { text-align:center; padding:11px; border-left:1px solid rgba(255,255,255,.12); }
.replay-result-reward b { display:block; margin:4px 0; color:#ffd45a; font-size:22px; letter-spacing:.08em; }
.replay-result-reward p { margin:0; color:rgba(255,255,255,.67); font-size:9px; line-height:1.45; }

.replay-modal[hidden] { display:none; }
.replay-modal { position:fixed; inset:0; z-index:120; display:grid; place-items:center; padding:20px; }
.replay-backdrop { position:absolute; inset:0; background:rgba(3,15,14,.78); backdrop-filter:blur(12px); }
.replay-dialog { position:relative; width:min(970px,96vw); max-height:90vh; overflow:auto; border:1px solid rgba(143,245,255,.28); border-radius:24px; color:#fff; background:radial-gradient(circle at 88% 0,rgba(255,44,168,.17),transparent 32%),linear-gradient(150deg,#123a34,#081c1a 70%); box-shadow:0 35px 90px rgba(0,0,0,.55); }
.replay-dialog > header { position:sticky; top:0; z-index:3; display:flex; justify-content:space-between; gap:20px; padding:20px 22px; background:rgba(8,28,26,.88); border-bottom:1px solid rgba(255,255,255,.1); backdrop-filter:blur(16px); }
.replay-dialog > header span { color:#ff75c6; font-size:9px; font-weight:900; letter-spacing:.16em; }
.replay-dialog > header h2 { margin:4px 0; font-size:24px; }
.replay-dialog > header p { margin:0; color:rgba(255,255,255,.64); font-size:11px; }
.replay-dialog > header button { width:38px; height:38px; border:1px solid rgba(255,255,255,.17); border-radius:50%; color:#fff; background:rgba(255,255,255,.05); font-size:23px; cursor:pointer; }
.replay-dialog-body { display:grid; gap:14px; padding:18px; }
.replay-current { display:grid; grid-template-columns:94px 1fr; gap:16px; align-items:start; padding:17px; border:1px solid rgba(143,245,255,.2); border-radius:18px; background:rgba(255,255,255,.045); }
.replay-current-icon { width:82px; aspect-ratio:1; display:grid; place-items:center; border:1px solid var(--run-color); border-radius:20px; background:color-mix(in srgb,var(--run-color) 18%,#0c2421); font-size:42px; box-shadow:0 0 35px color-mix(in srgb,var(--run-color) 22%,transparent); }
.replay-current small { color:#80dcd2; font-size:9px; font-weight:900; letter-spacing:.12em; }
.replay-current h3 { margin:3px 0; font-size:21px; }
.replay-current p { margin:0; color:rgba(255,255,255,.65); font-size:11px; }
.replay-current-quests { display:grid; grid-template-columns:repeat(3,1fr); gap:7px; margin-top:12px; }
.replay-mastery-panel,.replay-badges-panel,.replay-plant-panel { padding:15px; border:1px solid rgba(255,255,255,.09); border-radius:16px; background:rgba(255,255,255,.03); }
.replay-section-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.replay-section-head span { color:#ff75c6; font-size:9px; font-weight:900; letter-spacing:.15em; }
.replay-section-head b { color:#caff52; font-size:10px; }
#replay-mastery-grid { display:grid; gap:6px; }
#replay-mastery-grid article { display:grid; grid-template-columns:55px 1fr 56px; gap:9px; align-items:center; padding:7px 9px; border-radius:9px; background:rgba(255,255,255,.035); }
#replay-mastery-grid article > span { color:#83d9d0; font-size:9px; }
#replay-mastery-grid article b { display:block; font-size:10px; }
#replay-mastery-grid article i { display:block; height:5px; margin-top:4px; border-radius:5px; overflow:hidden; background:rgba(255,255,255,.09); }
#replay-mastery-grid article em { display:block; height:100%; border-radius:5px; background:linear-gradient(90deg,#00e5ff,#caff52); }
#replay-mastery-grid article strong { color:#b8cfca; font-size:9px; text-align:right; }
#replay-badge-grid { display:grid; grid-template-columns:repeat(6,1fr); gap:7px; }
#replay-badge-grid > span { min-height:72px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; border:1px solid rgba(255,255,255,.11); border-radius:12px; background:linear-gradient(145deg,rgba(255,255,255,.07),rgba(255,255,255,.02)); font-size:25px; }
#replay-badge-grid > span small { color:#cde4df; font-size:7px; text-align:center; }
#replay-badge-grid > span.is-locked { filter:grayscale(1); opacity:.28; }
.replay-badges-panel > p,.replay-plant-panel > p { margin:10px 0 0; color:rgba(255,255,255,.58); font-size:9px; line-height:1.5; }

@media (max-width:1080px) {
  .replay-button b { display:none; }
  .replay-button { grid-template-columns:18px auto; padding-inline:7px; }
  .run-preview { grid-template-columns:54px 1fr; }
  .run-preview-quests { grid-column:1 / -1; grid-template-columns:repeat(3,1fr); }
  .replay-result { grid-template-columns:135px 1fr; }
  .replay-result-reward { grid-column:1 / -1; border-left:0; border-top:1px solid rgba(255,255,255,.12); }
}

@media (max-width:720px) {
  .replay-button { min-width:39px; grid-template-columns:1fr; }
  .replay-button > span { grid-row:auto; }
  .replay-button small { display:none; }
  .run-preview { grid-template-columns:46px 1fr; gap:9px; padding:10px; }
  .run-preview-icon { width:44px; border-radius:12px; font-size:23px; }
  .run-preview h2 { font-size:15px; }
  .run-preview-quests { display:none; }
  .sort-adventure-card { width:calc(100% - 22px); grid-template-columns:44px 1fr; gap:9px; }
  .sort-adventure-card > span { width:42px; font-size:21px; }
  .sort-mastery { grid-column:1 / -1; display:flex; align-items:center; justify-content:space-between; min-width:0; padding:7px 10px; }
  .sort-mastery strong { font-size:18px; }
  .draft-actions { grid-template-columns:1fr; }
  .replay-result { width:calc(100% - 22px); grid-template-columns:1fr; gap:10px; padding:11px; }
  .replay-result-score { min-height:90px; }
  .replay-result-quests,.replay-current-quests { grid-template-columns:1fr; }
  .replay-result-reward { grid-column:auto; }
  .replay-dialog { width:97vw; }
  .replay-dialog > header { padding:15px; }
  .replay-dialog > header h2 { font-size:19px; }
  .replay-current { grid-template-columns:1fr; }
  .replay-current-icon { width:60px; border-radius:15px; font-size:30px; }
  #replay-badge-grid { grid-template-columns:repeat(3,1fr); }
}

@media (prefers-reduced-motion:reduce) {
  .replay-button,.collection-gem { transition:none!important; }
}
