/* Twxtter — cubist design system. Flat planes, hard ink outlines, offset shadows, fragmented shards. */
:root {
  --paper: #f4ecd8; --paper-2: #ebe0c6; --card: #fffaf0; --ink: #141414; --muted: #5c5546;
  --ochre: #f2c14e; --blue: #1f4fa3; --red: #d1462f; --green: #2e7d4f; --accent: #1f4fa3;
  --line: 3px solid var(--ink); --shadow: 5px 5px 0 var(--ink);
  --font: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Futura", "Century Gothic", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #191713; --paper-2: #221f19; --card: #26221b; --ink: #f1e6cc; --muted: #b3a88f; color-scheme: dark; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 16px/1.5 var(--font); color: var(--ink); background-color: var(--paper);
  background-image:
    linear-gradient(115deg, transparent 0 62%, color-mix(in srgb, var(--ochre) 18%, transparent) 62% 74%, transparent 74%),
    linear-gradient(35deg, color-mix(in srgb, var(--blue) 10%, transparent) 0 18%, transparent 18%),
    linear-gradient(160deg, transparent 0 82%, color-mix(in srgb, var(--red) 12%, transparent) 82%);
  background-attachment: fixed; min-height: 100vh;
}
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: .01em; line-height: 1.15; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: .06em; }
code { font-size: .85em; word-break: break-all; background: var(--paper-2); padding: 1px 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.muted, small { color: var(--muted); }
.hint { display: block; font-size: .8rem; color: var(--muted); font-weight: 400; }

/* ---------- 3-column shell */
.shell { display: grid; grid-template-columns: 250px minmax(0, 620px) 320px; gap: 28px; max-width: 1280px; margin: 0 auto; padding: 0 16px; justify-content: center; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 10px; padding: 18px 0; }
.main { padding: 18px 0 80px; min-width: 0; }
.rail { position: sticky; top: 0; align-self: start; padding: 18px 0; display: flex; flex-direction: column; gap: 18px; max-height: 100vh; overflow-y: auto; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 1.6rem var(--display); padding: 4px 8px; }
.logo { width: 42px; height: 42px; flex: none; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 14px; padding: 10px 12px; text-decoration: none; font-weight: 600; font-size: 1.08rem; border: 3px solid transparent; position: relative; }
.nav a:hover { border-color: var(--ink); background: var(--card); }
.nav a.on { border: var(--line); background: var(--ochre); color: #141414; box-shadow: var(--shadow); transform: rotate(-1deg); }
.ico { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: miter; }
.badge { background: var(--red); color: #fff; font-size: .75rem; padding: 0 6px; border: 2px solid var(--ink); margin-left: auto; }
.guest { display: flex; flex-direction: column; gap: 8px; }

.me { position: relative; margin-top: auto; }
.me summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 8px; border: 3px solid transparent; }
.me summary::-webkit-details-marker { display: none; }
.me summary:hover, .me[open] summary { border-color: var(--ink); background: var(--card); }
.me-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.me-name small, .me-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; background: var(--card); border: var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; z-index: 5; }
.menu a, .menu button { padding: 10px 14px; text-decoration: none; text-align: left; background: none; border: 0; border-bottom: 2px solid var(--paper-2); font: inherit; color: inherit; cursor: pointer; width: 100%; }
.menu a:hover, .menu button:hover { background: var(--ochre); color: #141414; }
.menu form { margin: 0; }

/* ---------- building blocks */
.page-title { font-size: 1.9rem; margin: 4px 0 16px; display: inline-block; padding: 2px 14px 2px 10px; background: var(--ink); color: var(--paper); transform: skew(-8deg); }
.page-sub { margin: 26px 0 10px; }
.card { background: var(--card); border: var(--line); box-shadow: var(--shadow); padding: 16px; margin-bottom: 18px; position: relative; }
.card.cut::after, .card.cut-r::after, .card.cut-l::after { content: ""; position: absolute; width: 38px; height: 38px; pointer-events: none; }
.card.cut::after { top: -3px; right: -3px; background: linear-gradient(225deg, var(--accent) 50%, transparent 50%); }
.card.cut-r::after { bottom: -3px; right: -3px; background: linear-gradient(315deg, var(--red) 50%, transparent 50%); }
.card.cut-l::after { top: -3px; left: -3px; background: linear-gradient(135deg, var(--ochre) 50%, transparent 50%); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 700 1rem var(--font); padding: 9px 18px; background: var(--accent); color: #fff; border: var(--line); box-shadow: 3px 3px 0 var(--ink); text-decoration: none; cursor: pointer; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.ghost { background: var(--card); color: var(--ink); }
.btn.danger { background: var(--red); }
.btn-big { padding: 12px 20px; font-size: 1.1rem; width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .6; cursor: progress; }
.flash { border: var(--line); padding: 10px 14px; margin: 0 0 16px; font-weight: 600; background: #ffe1d9; color: #141414; }
.flash.ok { background: #dff2e3; }
.empty { text-align: center; padding: 34px 12px; color: var(--muted); border: 3px dashed var(--muted); }
.chip { display: inline-block; padding: 1px 9px; border: 2px solid var(--ink); font-size: .82rem; text-decoration: none; font-weight: 600; background: var(--paper-2); }
.chip.match { background: var(--ochre); color: #141414; margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.more { display: inline-block; margin-top: 8px; font-weight: 700; }
.list { list-style: none; margin: 0; padding: 0; }
.list li a { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 2px; text-decoration: none; border-bottom: 2px solid var(--paper-2); }
.list li:last-child a { border-bottom: 0; }
.list li a:hover b { text-decoration: underline; }
.list small { flex-basis: 100%; }
.list .avatar + b + small, .list .swatch + b + small { flex-basis: auto; }
.swatch { width: 18px; height: 18px; border: 2px solid var(--ink); background: linear-gradient(135deg, var(--a) 50%, var(--b) 50%); flex: none; }
.foot { font-size: .8rem; color: var(--muted); }
.tabs { display: flex; gap: 0; margin-bottom: 14px; }
.tabs a { padding: 8px 16px; border: var(--line); text-decoration: none; font-weight: 700; background: var(--card); }
.tabs a + a { border-left: 0; }
.tabs a.on { background: var(--ink); color: var(--paper); }

.avatar { --c: var(--accent); width: 46px; height: 46px; flex: none; display: grid; place-items: center; font: 800 1.2rem var(--display); color: #fff; text-decoration: none; text-transform: uppercase;
  background: linear-gradient(135deg, var(--c) 0 55%, color-mix(in srgb, var(--c) 60%, #000) 55%); border: var(--line); clip-path: polygon(12% 0, 100% 6%, 90% 100%, 0 88%); }
.avatar.sm { width: 32px; height: 32px; font-size: .9rem; border-width: 2px; }
.avatar.xl { width: 96px; height: 96px; font-size: 2.6rem; }

/* ---------- forms */
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack > h2 { margin: 0; }
label { font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
label.check { flex-direction: row; align-items: center; gap: 8px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); padding: 9px 10px; width: 100%; border-radius: 0; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
input[type=color] { height: 44px; padding: 3px; }
textarea { resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.count { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; align-self: flex-end; }
.count.warn { color: var(--red); font-weight: 700; }
.auth { max-width: 460px; margin: 20px auto; }
.search input { border-width: 3px; }
.search.big { display: flex; gap: 8px; margin-bottom: 18px; }
.danger { border-color: var(--red); }
.prose ul { padding-left: 20px; }

/* ---------- twxts */
.composer textarea { border: 0; border-bottom: 2px solid var(--paper-2); background: transparent; font-size: 1.1rem; padding: 6px 0; }
.composer .row { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 8px; }
.composer .minute { flex-direction: row; align-items: center; gap: 8px; font-size: .9rem; margin-bottom: 6px; }
.composer .minute input { width: 90px; padding: 4px 8px; }
.join { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.join p { margin: 0; }
.twxt { display: flex; gap: 12px; padding: 14px; margin-bottom: 14px; box-shadow: 4px 4px 0 var(--ink); }
.twxt:nth-child(3n+2) { box-shadow: -4px 4px 0 var(--ink); }
.twxt .body { flex: 1; min-width: 0; }
.twxt header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.twxt header > a:first-child { text-decoration: none; }
.twxt header > a:first-child:hover b { text-decoration: underline; }
.twxt .when { margin-left: auto; }
.twxt .when a { text-decoration: none; }
.twxt p { margin: 6px 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.twxt p a { color: var(--accent); font-weight: 600; text-decoration: none; }
.twxt footer { display: flex; gap: 18px; align-items: center; margin-top: 6px; }
.twxt footer form { margin: 0; }
.like, .replies, .del { background: none; border: 0; font: inherit; color: var(--muted); cursor: pointer; padding: 4px 0; text-decoration: none; font-weight: 600; }
.like.on { color: var(--red); }
.like:hover, .replies:hover { color: var(--ink); }
.del { margin-left: auto; font-size: .85rem; }
.del:hover { color: var(--red); }
.min { display: inline-block; background: var(--ink); color: var(--paper); font-weight: 800; padding: 0 8px; transform: skew(-10deg); }
.focus .twxt { border-width: 4px; }
.focus .twxt p { font-size: 1.2rem; }
.parent { opacity: .85; }

/* ---------- profile & team */
.profile { padding: 0; overflow: hidden; display: grid; grid-template-columns: auto 1fr auto; gap: 0 16px; align-items: start; }
.profile .banner { grid-column: 1 / -1; height: 120px; border-bottom: var(--line);
  background: linear-gradient(120deg, var(--c) 0 34%, var(--ochre) 34% 52%, var(--paper-2) 52% 60%, var(--red) 60% 78%, var(--ink) 78%); }
.profile .avatar.xl { margin: -48px 0 16px 16px; }
.profile .pinfo { padding: 12px 0 16px; min-width: 0; }
.profile .pinfo h1 { margin: 0; }
.profile .pinfo p { margin: 4px 0; }
.profile .pact { padding: 14px 16px; }
.profile .pact form { margin: 0; }
.stats b { color: var(--ink); }
.team-hero { --a: var(--blue); --b: var(--ochre); overflow: hidden; color: #fff; background: var(--a); padding: 26px 20px; }
.team-hero h1 { font-size: 2.2rem; position: relative; text-shadow: 3px 3px 0 #141414; }
.team-hero > p, .team-hero dl, .team-hero form, .team-hero .muted { position: relative; }
.team-hero .muted { color: #fff; }
.shards i { position: absolute; display: block; background: var(--b); border: 3px solid #141414; }
.shards i:nth-child(1) { width: 220px; height: 220px; right: -60px; top: -80px; transform: rotate(28deg); }
.shards i:nth-child(2) { width: 120px; height: 120px; right: 90px; bottom: -70px; transform: rotate(-18deg); background: #141414; }
.shards i:nth-child(3) { width: 80px; height: 160px; right: 10px; bottom: -40px; transform: skew(-20deg); background: var(--paper); }
.team-hero dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 18px 0; }
.team-hero dl div { background: rgba(0, 0, 0, .45); border: 2px solid #141414; padding: 6px 10px; }
.team-hero dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.team-hero dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.verified { display: inline-grid; place-items: center; width: 30px; height: 30px; background: var(--green); border: 3px solid #141414; font-size: 1rem; vertical-align: middle; text-shadow: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.team-tile { --a: var(--blue); --b: var(--ochre); display: flex; flex-direction: column; justify-content: flex-end; min-height: 100px; padding: 10px; color: #fff; text-decoration: none; border: var(--line);
  background: linear-gradient(150deg, var(--a) 0 58%, var(--b) 58% 72%, #141414 72%); }
.team-tile small { color: #fff; opacity: .9; }
.team-tile b { text-shadow: 2px 2px 0 #141414; }
.team-tile:hover { transform: rotate(-1.5deg); }

/* ---------- matches */
.matches { list-style: none; padding: 0; margin: 0; }
.match-card { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px 12px; align-items: center; text-decoration: none; }
.match-card small { grid-column: 1 / -1; text-align: center; }
.match-card .team:first-child, .sb .team:first-child { text-align: right; }
.team { font: 800 1.1rem var(--display); overflow-wrap: anywhere; }
.score { font: 800 1.6rem var(--display); background: var(--ink); color: var(--paper); padding: 2px 12px; transform: skew(-8deg); white-space: nowrap; }
.score i { font-style: normal; opacity: .6; padding: 0 4px; }
.scoreboard { text-align: center; background: linear-gradient(110deg, var(--card) 0 48%, var(--paper-2) 48%); }
.sb { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; margin: 10px 0; }
.sb .team { font-size: 1.5rem; }
.sb .score { font-size: 2.4rem; }
.score-form { display: flex; justify-content: center; gap: 8px; align-items: center; }
.score-form input { width: 70px; text-align: center; }
.live-note { margin: 6px 0 0; font-size: .85rem; color: var(--muted); min-height: 1.2em; }
.new-match summary { list-style: none; width: auto; }
.new-match summary::-webkit-details-marker { display: none; }
.new-match[open] summary { margin-bottom: 14px; }
.twxt.fresh { animation: drop .5s ease-out; }
@keyframes drop { from { transform: translateY(-8px) rotate(-1deg); background: var(--ochre); } }

/* ---------- tactix */
.pitch, .tactix-view svg { width: 100%; max-width: 420px; display: block; margin: 12px auto; border: var(--line); touch-action: none; user-select: none; }
.tactix-view { margin: 8px 0; max-width: 300px; }
.tactix-view figcaption { font-size: .8rem; font-weight: 700; }
.grass { fill: #2e7d4f; }
.shard { fill: #3b9160; } .shard.s2 { fill: #256b42; } .shard.s3 { fill: #f2c14e; opacity: .35; }
.lines * { fill: none; stroke: #f4ecd8; stroke-width: .5; }
.pl circle { fill: #1f4fa3; stroke: #141414; stroke-width: .7; }
.pl.away circle { fill: #d1462f; }
.pl text { font: 700 3px var(--font); fill: #fff; text-anchor: middle; pointer-events: none; }
.pitch .pl { cursor: grab; }
.pitch .pl.drag { cursor: grabbing; }
.pitch .pl.drag circle { stroke: #f2c14e; stroke-width: 1; }
.arrow { stroke: #141414; stroke-width: .8; stroke-dasharray: 2 1; }
.tx-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.tx-tools label:first-child { flex: 1; min-width: 140px; }

/* ---------- legends */
.legends { list-style: none; padding: 0; margin: 0; }
.legends li { display: flex; gap: 16px; }
.legends .year { font: 800 2rem var(--display); background: var(--ink); color: var(--ochre); padding: 4px 10px; align-self: flex-start; transform: skew(-8deg); }
.legends p { margin: 4px 0; }
.error-page h1 { font-size: 2rem; }
.notif li a { align-items: flex-start; flex-wrap: nowrap; }
.notif small { display: block; }

/* ---------- responsive: 3 columns -> 2 -> 1 with bottom bar */
@media (max-width: 1120px) {
  .shell { grid-template-columns: 76px minmax(0, 620px) 300px; gap: 20px; }
  .brand span, .nav a span, .me-name, .sidebar .btn-big, .guest .ghost { display: none; }
  .nav a { justify-content: center; padding: 10px; }
  .badge { position: absolute; top: 2px; right: 2px; }
  .sidebar .btn-big { display: none; }
  .guest .btn-big { display: inline-flex; padding: 10px 4px; font-size: .8rem; }
  .menu { width: 200px; right: auto; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 76px minmax(0, 1fr); }
  .rail { grid-column: 2; position: static; max-height: none; padding-top: 0; }
}
@media (max-width: 640px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 0 16px; gap: 0; }
  .sidebar { position: fixed; z-index: 20; bottom: 0; left: 0; right: 0; top: auto; height: auto; flex-direction: row; align-items: center; padding: 6px 8px; background: var(--card); border-top: var(--line); gap: 4px; }
  .brand { display: none; }
  .nav { flex-direction: row; flex: 1; justify-content: space-around; gap: 0; }
  .nav li:nth-child(n+6) { display: none; }
  .nav a { padding: 8px; border: 0; }
  .nav a.on { transform: none; box-shadow: none; }
  .me { margin: 0; }
  .me summary { padding: 2px; }
  .me .avatar { width: 38px; height: 38px; }
  .menu { right: 0; left: auto; bottom: calc(100% + 10px); }
  .guest { flex-direction: row; }
  .guest .btn-big { width: auto; }
  .main { padding-bottom: 20px; }
  .rail { grid-column: 1; padding-bottom: 90px; }
  .page-title { font-size: 1.5rem; }
  .two, .team-hero dl { grid-template-columns: 1fr 1fr; }
  .profile { grid-template-columns: auto 1fr; }
  .profile .pact { grid-column: 1 / -1; padding-top: 0; }
  .sb .team { font-size: 1.1rem; }
  .sb .score { font-size: 1.8rem; }
  .legends li { flex-direction: column; gap: 8px; }
  .search.big { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } .nav a.on, .team-tile:hover { transform: none; } }

/* ---------- Bluesky */
.bfly { width: 1.1em; height: 1.1em; fill: currentColor; vertical-align: -0.15em; flex: none; }
.bsky-btn { background: #1185fe; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 2px solid var(--paper-2); }
.help { margin-top: 12px; }
.help summary { cursor: pointer; font-weight: 600; }
.help ol { padding-left: 20px; }
.on-bsky { color: #1185fe; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.twxt footer .on-bsky { padding: 4px 0; }
.bsky-post { border-color: #1185fe; box-shadow: 4px 4px 0 #1185fe; }
.bsky-post footer { justify-content: space-between; }
.bsky-img { display: block; max-width: 100%; max-height: 360px; border: 2px solid var(--ink); margin: 6px 0; object-fit: cover; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feed-note { margin: 0 0 12px; }
.match-tag { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 14px; font-weight: 600; }
.flash.warn { background: #fff1c9; }
.tabs { flex-wrap: wrap; }
.guest .bsky-btn { gap: 8px; }
@media (max-width: 1120px) { .guest .bsky-btn span { display: none; } .guest .bsky-btn { font-size: 1.3rem; padding: 10px; } }
@media (max-width: 640px) { .guest .bsky-btn { width: auto; padding: 8px 12px; } .guest .ghost { display: inline-flex; padding: 8px 10px; } }
.twxt header { flex-wrap: nowrap; min-width: 0; }
.twxt header > a:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.twxt header .chip { flex: none; }
.twxt header .when { flex: none; }
