/* MurderMostSocial palette — see /static/brand/ and docs/BRAND.md */
:root {
  --mp-ink: #1d1720;       /* Ink: text, the header */
  --mp-accent: #8c1c2b;    /* Claret: the brand colour, buttons, links */
  --mp-accent-2: #c2384a;  /* Blood: hover, focus, claret on dark */
  --mp-rose: #e06a78;      /* Rose: claret-family text on dark */
  --mp-crimson: #e50c43;   /* Crimson: the logo's red — "Social", accents on black */
  --mp-brass: #cc8e40;     /* Gold: the dagger's hilt — stars, highlights; never text on light */
  --mp-noir: #000000;      /* Noir: the logo's background — the header */
  --mp-verdigris: #2e6b5c; /* Verdigris: clues, success */
  --mp-paper: #f7f3ee;     /* Parchment: page background */
  --mp-line: #e3dbd1;      /* Fog: borders, dividers */
  --mp-muted: #6e6470;     /* Smoke: secondary text */
  --bs-primary: #8c1c2b;
  --bs-link-color: #8c1c2b;
  --bs-link-hover-color: #5e101b;
}
body { background: var(--mp-paper); color: var(--mp-ink); }
h1, h2, h3, .brand { font-family: Georgia, 'Times New Roman', serif; }

.mp-nav { background: var(--mp-noir); position: sticky; top: 0; z-index: 1030; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.mp-nav .navbar-brand { color: #fff; letter-spacing: .02em; }
.mp-nav .nav-link { color: rgba(255,255,255,.8); }
.mp-nav .nav-link:hover, .mp-nav .nav-link.active { color: #fff; }
/* Full-width header: logo and menu left, account right. */
.mp-nav .mp-nav-inner { display: flex; flex-wrap: wrap; align-items: center; width: 100%; padding: 0 1.5rem; row-gap: .25rem; column-gap: 1.25rem; }
.mp-nav .mp-menu { gap: .25rem; }
.mp-nav .mp-account { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.mp-nav .mp-profile { color: #fff; display: flex; align-items: center; gap: .5rem; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: .2rem .7rem .2rem .25rem; }
.mp-nav .mp-profile:hover, .mp-nav .mp-profile[aria-expanded="true"] { color: #fff; border-color: rgba(255,255,255,.6); }
.mp-nav .mp-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--mp-crimson); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; letter-spacing: .02em; }
.mp-nav .dropdown-menu { --bs-dropdown-link-active-bg: var(--mp-accent); min-width: 14rem; }
.mp-nav .dropdown-item { cursor: pointer; }
.mp-nav .nav-link { white-space: nowrap; }
@media (max-width: 576px) {
  .mp-nav .navbar-brand { font-size: 1.05rem; margin-right: .5rem; }
  .mp-nav .navbar-nav .nav-link { padding-left: .4rem; padding-right: .4rem; font-size: .9rem; }
  .mp-nav .mp-nav-inner { padding: 0 .75rem; }

  .mp-nav .mp-profile { padding-right: .3rem; }
}
/* Simulation settings fold away on a phone so the feed comes first. */
details.sim-settings > summary { list-style: none; cursor: pointer; }
details.sim-settings > summary::-webkit-details-marker { display: none; }
details.sim-settings > summary::after { content: '\F282'; font-family: bootstrap-icons; float: right; transition: transform .2s; }
details.sim-settings[open] > summary::after { transform: rotate(180deg); }

main { max-width: 1100px; }
.btn-primary { --bs-btn-bg: var(--mp-accent); --bs-btn-border-color: var(--mp-accent); --bs-btn-hover-bg: #6f1522; --bs-btn-hover-border-color: #6f1522; --bs-btn-active-bg: #5e101b; }
.btn-outline-primary { --bs-btn-color: var(--mp-accent); --bs-btn-border-color: var(--mp-accent); --bs-btn-hover-bg: var(--mp-accent); --bs-btn-hover-border-color: var(--mp-accent); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--mp-accent-2); box-shadow: 0 0 0 .2rem rgba(140,28,43,.15); }
.form-check-input:checked { background-color: var(--mp-accent); border-color: var(--mp-accent); }

.card { border-color: var(--mp-line); border-radius: 12px; }
.card-header { background: #fff; border-bottom-color: var(--mp-line); font-weight: 600; }
.text-muted, .form-text { color: var(--mp-muted) !important; }

/* Mystery tabs scroll sideways on a phone rather than wrapping into a wall. */
.mp-tabs { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--mp-line); margin-bottom: 1.25rem; }
.mp-tabs::-webkit-scrollbar { display: none; }
.mp-tabs a { white-space: nowrap; padding: .55rem .8rem; color: var(--mp-muted); text-decoration: none; border-bottom: 3px solid transparent; font-weight: 500; }
.mp-tabs a.active { color: var(--mp-ink); border-bottom-color: var(--mp-accent); }
.mp-tabs .badge { font-size: .65rem; vertical-align: top; }

.hint { font-size: .85rem; color: var(--mp-muted); }
.secret { background: #fff6f6; border-left: 3px solid var(--mp-accent-2); }
.portrait { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: #ddd; }
.portrait-lg { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; }
.chip { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; background: #eee6dc; color: #4a3f46; margin-right: .25rem; }
.chip-red { background: #f6dadd; color: #7a1724; }
.chip-dark { background: var(--mp-ink); color: #fff; }

/* Repeated rows (knowledge, actions, motives) */
.rep-row { border: 1px solid var(--mp-line); border-radius: 10px; padding: .75rem; background: #fff; margin-bottom: .6rem; position: relative; }
.rep-row .rep-remove { position: absolute; top: .4rem; right: .4rem; }

/* Timeline */
.tl-act { border-left: 4px solid var(--mp-accent); }
.tl-event { border-left: 2px dashed var(--mp-line); margin-left: .5rem; padding-left: 1rem; }
.tl-time { font-variant-numeric: tabular-nums; color: var(--mp-muted); font-size: .8rem; min-width: 4.5rem; display: inline-block; }

/* Simulation: a phone-ish message feed */
.feed { max-width: 640px; }
.msg { background: #fff; border: 1px solid var(--mp-line); border-radius: 14px; padding: .75rem .9rem; margin-bottom: .6rem; }
.msg.k-task, .msg.k-task_target { border-left: 4px solid #c58b00; }
.msg.k-briefing { border-left: 4px solid var(--mp-accent); }
.msg.k-clue, .msg.k-clue_hidden { border-left: 4px solid #2e6b5c; }
.msg.k-solution { background: var(--mp-ink); color: #fff; }
.msg.k-cue { border-style: dashed; background: #fbf7ef; }
.msg .to { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--mp-muted); }
.msg.k-solution .to { color: #bbb; }
.step-hidden { display: none; }

/* Overlay preview: the clue sits on a photo the way players will see it */
.overlay-stage { position: relative; border-radius: 10px; overflow: hidden; background: linear-gradient(160deg,#6b5b4e,#3b302a 60%,#2a221e); aspect-ratio: 4/3; max-width: 420px; }
.overlay-stage > img.bg { width: 100%; height: 100%; object-fit: cover; }
.overlay-stage > img.ov { position: absolute; left: 50%; top: 62%; transform: translate(-50%,-50%); filter: drop-shadow(0 6px 8px rgba(0,0,0,.45)); }
.overlay-stage .ph { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: flex-end; padding: .5rem; color: rgba(255,255,255,.6); font-size: .75rem; }

/* Organiser wizard */
.wizard { display: flex; gap: .25rem; list-style: none; padding: 0; margin: 0; counter-reset: s; flex-wrap: wrap; }
.wizard li { flex: 1 1 0; min-width: 7rem; padding: .5rem .6rem; border-bottom: 3px solid var(--mp-line); color: var(--mp-muted); font-size: .9rem; white-space: nowrap; }
.wizard li a { color: inherit; text-decoration: none; }
.wizard li .n { display: inline-flex; width: 1.4rem; height: 1.4rem; border-radius: 50%; align-items: center; justify-content: center; background: var(--mp-line); font-size: .75rem; font-weight: 600; margin-right: .2rem; }
.wizard li.done { color: var(--mp-ink); border-bottom-color: #c9b9a8; }
.wizard li.done .n { background: #c9b9a8; color: #fff; }
.wizard li.active { color: var(--mp-ink); font-weight: 600; border-bottom-color: var(--mp-accent); }
.wizard li.active .n { background: var(--mp-accent); color: #fff; }
.invite-choice { border: 1px solid var(--mp-line); background: #fff; transition: border-color .15s, box-shadow .15s; }
.invite-choice:hover:not(:disabled) { border-color: var(--mp-accent-2); box-shadow: 0 2px 10px rgba(140,28,43,.12); }
.invite-choice:disabled { opacity: .45; cursor: not-allowed; }

.mp-nav .navbar-brand img { height: 44px; width: auto; display: block; }
.mp-nav .navbar-brand img.wording { height: 26px; }
@media (max-width: 576px) { .mp-nav .navbar-brand img { height: 34px; } .mp-nav .navbar-brand img.wording { height: 18px; } }
.mp-stars { color: var(--mp-brass); }
.text-success { color: var(--mp-verdigris) !important; }

/* Error and not-found pages */
.problem { max-width: 560px; margin: 2.5rem auto 3rem; text-align: center; background: #fff; border: 1px solid var(--mp-line); border-radius: 16px; padding: 2rem 1.5rem; }
.problem-emblem { height: 96px; width: auto; background: var(--mp-noir); border-radius: 22%; padding: 10px 16px; }
.problem-message { color: var(--mp-muted); font-size: 1.05rem; margin: 0 auto; max-width: 30rem; }

pre.wrap { white-space: pre-wrap; font-family: inherit; margin: 0; }
@media (max-width: 576px) { h1 { font-size: 1.6rem; } .card-body { padding: .9rem; } }

/* Below tablet width the menu drops to its own row under the logo and account. */
@media (max-width: 767.98px) { .mp-nav .mp-menu { width: 100%; } }

/* Home page */
.home-way { transition: border-color .15s, box-shadow .15s; }
.home-way:hover { border-color: var(--mp-accent-2); box-shadow: 0 2px 12px rgba(140,28,43,.12); }

/* Mystery cards: the title stretches over the whole card; the author link sits on top of it. */
.author-link { position: relative; z-index: 2; color: var(--mp-ink); text-decoration: none; }
.author-link:hover { color: var(--mp-accent); text-decoration: underline; }
.mystery-card .stretched-link { color: inherit; text-decoration: none; }
.mystery-card:hover { border-color: var(--mp-accent-2); box-shadow: 0 2px 12px rgba(140,28,43,.12); }

/* "How it works": each box has a faint sepia illustration behind the text. */
.how-card { position: relative; overflow: hidden; background: #f6eedf; border-color: #e3d6bf; }
/* The picture fills the box behind the text, anchored bottom right. */
.how-card::before { content: ''; position: absolute; inset: 0; background: var(--art) right bottom / var(--art-size, auto 96%) no-repeat; opacity: var(--art-opacity, .42); pointer-events: none; }
/* A parchment wash behind the writing, fading out towards the picture. */
.how-card { min-height: 280px; }
.how-card .card-body { position: relative; }
/* A soft parchment glow round the letters keeps them readable over the picture. */
.how-card h3 { font-weight: 700; color: var(--mp-ink); text-shadow: 0 0 2px #f6eedf, 0 0 6px #f6eedf, 0 0 10px #f6eedf, 0 0 14px #f6eedf; }
.how-card p { color: #1d1610; font-weight: 500; text-shadow: 0 0 1px #f6eedf, 0 0 3px #f6eedf, 0 0 5px #f6eedf, 0 0 8px #f6eedf, 0 0 12px #f6eedf, 0 0 16px #f6eedf; }

/* The main menu as tabs along the bottom of the header. The current tab takes
   the page's colour, so it reads as joined to the page below. */
.mp-nav { padding-bottom: 0; }
.mp-nav .mp-nav-inner > .navbar-brand, .mp-nav .mp-nav-inner > .mp-account { margin-bottom: .5rem; }
.mp-nav .mp-menu { align-self: flex-end; gap: .3rem; }
.mp-nav .mp-tab { display: flex; align-items: center; gap: .4rem; padding: .5rem .95rem .55rem !important; border-radius: .6rem .6rem 0 0;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.12); border-bottom: 0; font-weight: 500; }
.mp-nav .mp-tab i { font-size: 1rem; opacity: .9; }
.mp-nav .mp-tab:hover { background: rgba(255,255,255,.16); color: #fff; }
.mp-nav .mp-tab.active { background: var(--mp-paper); color: var(--mp-ink); border-color: var(--mp-paper); }
.mp-nav .mp-tab.active i { color: var(--mp-accent); }
/* The tab row may shrink below its natural width, so it can never widen the page. */
.mp-nav .mp-menu { min-width: 0; max-width: 100%; }
@media (max-width: 575.98px) { .how-card { min-height: 220px; } }

/* Desktop shows each tab's full name; the phone bar uses a short one. */
.mp-nav .mp-tab .tab-short { display: none; }

/* On a phone the menu is a tab bar fixed to the bottom of the screen, like an
   app: icon over a short name, the current tab highlighted. */
@media (max-width: 767.98px) {
  .mp-nav .mp-menu {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040; width: 100%; max-width: none;
    display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: space-around; gap: 0; margin: 0;
    background: var(--mp-noir); border-top: 1px solid rgba(255,255,255,.12); box-shadow: 0 -2px 10px rgba(0,0,0,.3);
    padding: .25rem .25rem calc(.25rem + env(safe-area-inset-bottom));
  }
  .mp-nav .mp-menu .nav-item { flex: 1 1 0; min-width: 0; }
  .mp-nav .mp-tab {
    flex-direction: column; gap: .1rem; justify-content: center; text-align: center;
    padding: .35rem .2rem .3rem !important; border: 0; border-radius: .6rem; background: transparent;
    font-size: .7rem; line-height: 1.1; color: rgba(255,255,255,.7);
  }
  .mp-nav .mp-tab i { font-size: 1.3rem; opacity: 1; }
  .mp-nav .mp-tab .tab-full { display: none; }
  .mp-nav .mp-tab .tab-short { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .mp-nav .mp-tab:hover { background: rgba(255,255,255,.08); }
  .mp-nav .mp-tab.active { background: rgba(229,12,67,.16); color: #fff; }
  .mp-nav .mp-tab.active i { color: var(--mp-crimson); }
  /* The header keeps just the logo and account; and the page leaves room for the bar. */
  .mp-nav { padding-bottom: .5rem; }
  body { padding-bottom: calc(4.2rem + env(safe-area-inset-bottom)); }
}

/* Home page introduction: plain text and buttons on the page. */
.home-intro { padding: .5rem 0 .25rem; }
.home-intro p { max-width: 42rem; color: #3b3036; }

/* Signed out: a person icon in place of the initials. */
.mp-nav .mp-guest { padding: .15rem .35rem; border-radius: 50%; }
.mp-nav .mp-guest i { font-size: 1.7rem; line-height: 1; display: block; }
