:root {
  --steel: #71797e;
  --steel-light: #e8eaeb;
  --ink: #1a1a1a;
  --muted: #5f666a;
  --bg: #f4f5f6;
  --card: #ffffff;
  --line: #dcdfe1;
  --ok: #2e7d32;
  --err: #b3261e;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; }
img, video { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.pre { white-space: pre-wrap; }

/* ---------- header ---------- */
.topbar { background: var(--primary); color: #fff; border-bottom: 4px solid var(--accent); position: sticky; top: 0; z-index: 50; }
.nav { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; text-decoration: none; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.brand .logo { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--accent); background: #000; object-fit: cover; }
.links { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.links a, .links button.linkish { text-decoration: none; padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: .95rem; color: #e9e9e9; background: none; border: 0; cursor: pointer; font-family: inherit; }
.links a:hover, .links button.linkish:hover { background: rgba(255,255,255,.1); color: #fff; }
.links a.active { color: var(--accent); }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 8px; font-size: 1.3rem; padding: 4px 12px; cursor: pointer; }
.famzone { background: var(--steel); color: #fff; }
.famzone .wrap { display: flex; gap: 4px; align-items: center; overflow-x: auto; min-height: 44px; scrollbar-width: none; }
.famzone .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; opacity: .85; margin-right: 8px; white-space: nowrap; }
.famzone a { color: #fff; text-decoration: none; padding: 6px 10px; border-radius: 6px; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.famzone a:hover { background: rgba(0,0,0,.15); }
.famzone a.active { background: var(--primary); color: var(--accent); }
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .links { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  .nav { flex-wrap: wrap; }
  body.nav-open .links { display: flex; }
}

/* ---------- buttons / forms ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: #111; border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer; font-family: inherit; }
.btn:hover { filter: brightness(1.06); }
.btn.dark { background: var(--primary); color: #fff; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn.danger { background: transparent; color: var(--err); border: 1.5px solid #e9c3c0; }
.btn.sm { padding: 5px 12px; font-size: .85rem; }
.links .btn { color: #111; padding: 8px 16px; }
form.inline { display: inline; }
label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number],
input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(196,180,122,.3); }
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: 14px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.formcard { max-width: 640px; }

/* ---------- cards / layout ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stack > * + * { margin-top: 16px; }
.section { margin-top: 36px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.pagehead h1 { margin: 0; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; background: var(--steel-light); color: #333; }
.tag.Game, .tag.Tournament { background: var(--primary); color: var(--accent); }
.tag.Practice { background: var(--steel); color: #fff; }
.tag.gold { background: var(--accent); color: #111; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--radius); }

/* ---------- hero ---------- */
.hero { background: #231f20; color: #fff; border-radius: 18px; padding: clamp(24px, 5vw, 48px); position: relative; overflow: hidden;
  display: flex; align-items: center; gap: clamp(16px, 4vw, 40px); border-bottom: 5px solid var(--accent); }
.hero-art { flex: 0 0 auto; width: min(44%, 440px); height: auto; border-radius: 12px; order: 2; }
.hero-text { flex: 1; min-width: 0; }
@media (max-width: 760px) { .hero { flex-direction: column; align-items: stretch; } .hero-art { order: 0; width: 100%; max-width: 440px; margin: 0 auto; } }
.about-card { display: flow-root; }
.about-logo { float: right; width: min(240px, 40%); margin: 0 0 12px 20px; border-radius: 12px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); text-transform: uppercase; letter-spacing: .02em; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 1.1rem; color: #ddd; max-width: 640px; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.hero .btn.ghost { color: #fff; border-color: rgba(255,255,255,.4); }

/* ---------- events ---------- */
.event { display: flex; gap: 14px; align-items: flex-start; }
.datebox { flex: none; width: 58px; text-align: center; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.datebox .mo { background: var(--primary); color: var(--accent); font-size: .7rem; font-weight: 800; text-transform: uppercase; padding: 2px 0; }
.datebox .d { font-size: 1.5rem; font-weight: 800; line-height: 1.4; }
.event h3 { margin: 2px 0 2px; }
.event .meta { color: var(--muted); font-size: .9rem; }
.eventlist > .event { padding: 14px 0; border-bottom: 1px solid var(--line); }
.eventlist > .event:last-child { border-bottom: 0; }

.cal { width: 100%; border-collapse: collapse; table-layout: fixed; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cal th { background: var(--primary); color: var(--accent); font-size: .75rem; text-transform: uppercase; padding: 8px 4px; }
.cal td { border: 1px solid var(--line); vertical-align: top; height: 104px; padding: 4px; font-size: .78rem; }
.cal td.other { background: #fafafa; color: #aaa; }
.cal td.today { background: #fbf8ea; }
.cal .num { font-weight: 700; font-size: .85rem; }
.cal .ev { display: block; margin-top: 3px; padding: 2px 5px; border-radius: 5px; background: var(--steel-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .ev.Game, .cal .ev.Tournament { background: var(--primary); color: var(--accent); }
.cal .ev.Practice { background: var(--steel); color: #fff; }
.calnav { display: flex; align-items: center; gap: 10px; }
@media (max-width: 700px) { .cal-wrap { display: none; } }

/* ---------- progress ---------- */
.progress { height: 12px; background: var(--steel-light); border-radius: 999px; overflow: hidden; margin: 10px 0 6px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), #e0cf7a); border-radius: 999px; }

/* ---------- media grid ---------- */
.cover { aspect-ratio: 4/3; max-height: 260px; width: calc(100% + 8px);background: var(--steel-light) center/cover no-repeat; border-radius: 10px; margin: -4px -4px 12px; display: grid; place-items: center; color: var(--steel); font-size: 2.2rem; }
.cardlink { text-decoration: none; display: block; }
.cardlink:hover .card { border-color: var(--accent); }
.gallery { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.gallery .tile { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #222; cursor: zoom-in; }
.gallery .tile img, .gallery .tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .tile .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 2.4rem; text-shadow: 0 2px 8px rgba(0,0,0,.6); pointer-events: none; }
.gallery .tile form { position: absolute; top: 6px; right: 6px; opacity: 0; transition: opacity .15s; }
.gallery .tile:hover form { opacity: 1; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); display: none; align-items: center; justify-content: center; z-index: 100; }
.lightbox.open { display: flex; }
.lightbox img, .lightbox video { max-width: 94vw; max-height: 86vh; border-radius: 6px; }
.lightbox .lb-btn { position: absolute; background: rgba(255,255,255,.12); border: 0; color: #fff; font-size: 1.6rem; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; }
.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-prev { left: 12px; top: 50%; }
.lightbox .lb-next { right: 12px; top: 50%; }
.lightbox .lb-dl { position: absolute; bottom: 18px; color: #ddd; font-size: .9rem; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { background: #fafafa; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pos { color: var(--ok); } .neg { color: var(--err); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .k { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.stat .v { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat.hl { background: var(--primary); color: #fff; border-color: var(--primary); }
.stat.hl .k { color: var(--accent); }

/* ---------- board / chat ---------- */
.post { border-bottom: 1px solid var(--line); padding: 14px 0; }
.post:last-child { border-bottom: 0; }
.who { font-weight: 700; }
.chatbox { height: min(60vh, 560px); overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 78%; align-self: flex-start; background: var(--steel-light); padding: 8px 12px; border-radius: 14px 14px 14px 4px; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; background: var(--primary); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg .h { font-size: .74rem; opacity: .75; margin-bottom: 2px; }
.msg.mine .h { color: var(--accent); opacity: 1; }
.chatform { display: flex; gap: 8px; margin-top: 10px; }
.chatform input { flex: 1; }

/* ---------- sponsors ---------- */
.sponsor-strip { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.sponsor-strip a, .sponsor-strip span { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; text-decoration: none; font-weight: 700; display: flex; align-items: center; gap: 8px; min-height: 64px; }
.sponsor-strip img { max-height: 44px; max-width: 140px; object-fit: contain; }
.logo-box { height: 110px; display: grid; place-items: center; margin-bottom: 12px; background: #fafafa; border-radius: 10px; }
.logo-box img { max-height: 90px; max-width: 80%; object-fit: contain; }
.avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: var(--steel-light); display: grid; place-items: center; font-size: 2rem; font-weight: 800; color: var(--steel); margin-bottom: 10px; }

/* ---------- flash / footer ---------- */
.flashes { margin-bottom: 18px; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 8px; font-weight: 500; }
.flash.ok { background: #e8f3e9; color: #1d5b21; border: 1px solid #c4dfc6; }
.flash.error { background: #fbeaea; color: #8a1c15; border: 1px solid #f0c8c5; }
footer.site { background: var(--primary); color: #bbb; padding: 28px 0; font-size: .9rem; border-top: 4px solid var(--accent); }
footer.site .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer.site a { color: var(--accent); }
.copybox { display: flex; gap: 6px; }
.copybox input { font-size: .8rem; padding: 6px 8px; }
