/*
 * Uppsala Mahjong - shared stylesheet of the sub-sites (tournaments, statistics).
 *
 * Concept: the green felt table (mat.jpg) is the stage; the page is an ivory mahjong tile lying on it
 * (off-white panel, rounded corners, bevelled bottom edge); red and gold accents come from the 東 logo;
 * section headings are marked with the seat winds 東 南 西 北 on small tiles. Montserrat (headings,
 * navigation) + Lato (text), as on the main site.
 *
 * No framework. A small Bootstrap-3-compatible grid is included because the organisers' tournament
 * texts (v2/events/*.html) use row / col-sm-* / container-fluid / bg-grey / table / alert-*.
 * URLs are relative to this file (/shared/site.css -> /mat.jpg, /images/...), so the same stylesheet
 * also works when loaded from https://uppsalamahjong.se/shared/site.css.
 */
:root {
  --green-900: #163f27;   /* navbar, footer */
  --green-700: #1f5f3a;   /* headings accents, links */
  --green-500: #6caf76;   /* the main site's navbar green, used as accent */
  --green-100: #e4f0e6;
  --red: #c1272d;         /* logo red */
  --red-dark: #8f1a1f;
  --gold: #e8b53a;        /* logo yellow */
  --gold-100: #fbf1d2;
  --ivory: #f5efe0;       /* tile face */
  --ivory-dark: #d9cfb3;  /* tile edge / bevel */
  --paper: #fffdf8;
  --ink: #1f2a24;
  --text: #3b463f;
  --muted: #74807a;
  --line: #e6dfcd;
  --column: 1060px;
  --pad-x: 56px;
  --pad-y: 40px;
  --nav-h: 56px;
  --radius: 12px;
}

@counter-style winds { system: cyclic; symbols: "東" "南" "西" "北"; suffix: ""; }

* { box-sizing: border-box; }
html {
  background: #1d7a46 url(../mat.jpg) center top fixed;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100vh;
  font: 400 16px/1.7 Lato, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  counter-reset: wind;
}
main { display: block; }
img { max-width: 100%; height: auto; vertical-align: middle; }
a { color: var(--green-700); text-decoration: underline; text-decoration-color: rgba(31, 95, 58, .35); text-underline-offset: 3px; }
a:hover, a:focus { color: var(--red); text-decoration-color: currentColor; }
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 12px; padding-left: 28px; }
li { margin-bottom: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
code { font-family: Menlo, Consolas, monospace; font-size: 90%; color: var(--red); background: var(--ivory); padding: 2px 5px; border-radius: 4px; }
b, strong { font-weight: 700; color: var(--ink); }
small, .small { font-size: 87%; }
.muted, .text-muted { color: var(--muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-danger { color: var(--red); }
.clearfix::after { content: ""; display: table; clear: both; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---- Headings ---- */
h1, h2, h3, h4, h5 { color: var(--ink); font-family: Montserrat, Lato, sans-serif; line-height: 1.25; margin: 0; }
h1 { font-size: 44px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 24px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin: 28px 0 22px; display: flex; align-items: center; gap: 14px; }
h2:first-child { margin-top: 0; }
h2::before {
  counter-increment: wind; content: counter(wind, winds);
  flex: 0 0 auto; width: 34px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  font: 400 18px/1 "Noto Sans CJK SC", "Microsoft YaHei", "PingFang SC", "Hiragino Sans", serif; color: var(--red);
  background: linear-gradient(#fffdf8, var(--ivory)); border: 1px solid var(--ivory-dark); border-bottom-width: 4px; border-radius: 6px;
  text-transform: none; letter-spacing: 0;
}
h3 { font-size: 19px; font-weight: 700; margin: 24px 0 10px; }
h4 { font-size: 17px; font-weight: 600; margin: 18px 0 8px; }
h5 { font-size: 15px; font-weight: 700; margin: 16px 0 8px; }
.page-header { padding-bottom: 10px; margin: 20px 0; border-bottom: 1px solid var(--line); }
.page-header h1 { font-size: 34px; }

/* ---- Navbar (full width, dark green) ---- */
.um-nav {
  position: sticky; top: 0; z-index: 1000;
  background: var(--green-900); color: #fff;
  font-family: Montserrat, Lato, sans-serif; font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}
.um-nav-inner { max-width: var(--column); margin: 0 auto; display: flex; align-items: center; flex-wrap: wrap; min-height: var(--nav-h); padding: 0 16px; }
.um-nav a { color: #fff; text-decoration: none; display: block; padding: 18px 14px; white-space: nowrap; position: relative; }
.um-nav ul a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 11px; height: 2px; background: var(--gold);
  transform: scaleX(0); transform-origin: left; transition: transform .2s;
}
.um-nav ul a:hover::after, .um-nav ul a:focus::after, .um-nav ul a.active::after { transform: scaleX(1); }
.um-nav ul a.active { color: var(--gold); }
.um-brand { display: inline-flex; align-items: center; padding: 10px 0 !important; margin-right: auto; font-weight: 700; }
.um-brand img { height: 32px; width: auto; margin-right: 10px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4)); }
.um-nav ul { list-style: none; margin: 0; padding: 0; display: flex; }
.um-nav li { margin: 0; }
.um-nav-toggle {
  display: none; margin-left: auto; width: 44px; height: 38px; padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, .25); border-radius: 6px; background: transparent; cursor: pointer;
}
.um-nav-toggle span { display: block; width: 22px; height: 2px; background: #fff; margin: 5px auto; border-radius: 1px; }
.um-nav-toggle:hover, .um-nav-toggle[aria-expanded="true"] { background: rgba(255, 255, 255, .12); }
@media (max-width: 991px) {
  .um-nav { letter-spacing: .14em; }
  .um-nav a { padding: 18px 10px; }
}
@media (max-width: 767px) {
  .um-nav-toggle { display: block; }
  .um-nav ul { display: none; flex-direction: column; width: 100%; padding: 4px 0 10px; border-top: 1px solid rgba(255, 255, 255, .15); }
  .um-nav-inner.open ul { display: flex; }
  .um-nav ul a { padding: 12px 6px; }
  .um-nav ul a::after { display: none; }
  .um-brand { margin-right: 0; }
}

/* ---- The page: an ivory tile on the table ---- */
.um-page {
  max-width: var(--column); margin: 32px auto 48px;
  background: var(--paper); color: var(--text);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 8px 0 var(--ivory-dark), 0 30px 60px rgba(0, 0, 0, .35);
}
.um-notice { background: var(--gold-100); color: #6b4d00; text-align: center; padding: 8px 16px; font-size: 14px; border-bottom: 1px solid #ecd9a0; }

/* ---- Hero / banner ---- */
.um-hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(120deg, var(--green-700), var(--green-500)); font-family: Montserrat, Lato, sans-serif; }
.um-hero::after {
  content: "東"; position: absolute; right: -16px; bottom: -64px; font: 400 300px/1 "Noto Sans CJK SC", "Microsoft YaHei", "PingFang SC", "Hiragino Sans", serif;
  color: rgba(255, 255, 255, .09); pointer-events: none; user-select: none;
}
.um-hero-photo { background-size: cover; background-position: center; }
.um-hero-photo::after { display: none; }
.um-hero-photo .um-hero-inner { background: linear-gradient(to top, rgba(22, 63, 39, .92) 0%, rgba(22, 63, 39, .55) 55%, rgba(22, 63, 39, .25) 100%); }
.um-hero-inner { position: relative; z-index: 1; padding: 64px var(--pad-x) 44px; text-align: center; }
.um-hero h1 { color: #fff; font-size: 46px; text-shadow: 0 2px 8px rgba(0, 0, 0, .3); word-wrap: break-word; }
.um-hero .lead { font-size: 17px; font-weight: 500; letter-spacing: .02em; margin: 14px 0 0; color: rgba(255, 255, 255, .92); }
.um-hero .lead a, .um-hero a { color: #fff; text-decoration-color: rgba(255, 255, 255, .5); }
.um-hero .years { margin: 18px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600; }
.um-hero .years a, .um-hero .years strong {
  padding: 4px 11px; border-radius: 6px; text-decoration: none; color: #fff; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2);
}
.um-hero .years a:hover { background: rgba(255, 255, 255, .28); }
.um-hero .years strong { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.um-sublinks { margin: 28px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.um-sublinks li { margin: 0; }
.um-sublinks a {
  display: inline-block; padding: 7px 16px; font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; text-decoration: none;
  color: var(--ink); background: var(--ivory); border: 1px solid var(--ivory-dark); border-bottom-width: 3px; border-radius: 6px;
}
.um-sublinks a:hover { background: #fff; color: var(--red); transform: translateY(-1px); }
.um-hero.compact .um-hero-inner { padding: 40px var(--pad-x) 32px; }
.um-hero.compact h1 { font-size: 32px; }

/* ---- Content sections ---- */
.container-fluid, .section { padding: var(--pad-y) var(--pad-x); background: var(--paper); }
.container { padding: 0; }
.bg-grey { background: var(--ivory); }
.container-fluid .container-fluid { padding: 0; background: transparent; }
.container-fluid .container-fluid.bg-grey { background: transparent; }
.container-fluid > :last-child { margin-bottom: 0; }

/* ---- Small Bootstrap-3-compatible grid (organisers' texts) ---- */
.row { display: flex; flex-wrap: wrap; margin-left: -16px; margin-right: -16px; }
.row > * { padding-left: 16px; padding-right: 16px; min-width: 0; }
[class*="col-"] { flex: 0 0 100%; max-width: 100%; }
@media (min-width: 768px) {
  .col-sm-1 { flex-basis: 8.3333%; max-width: 8.3333%; }
  .col-sm-2 { flex-basis: 16.6667%; max-width: 16.6667%; }
  .col-sm-3 { flex-basis: 25%; max-width: 25%; }
  .col-sm-4 { flex-basis: 33.3333%; max-width: 33.3333%; }
  .col-sm-5 { flex-basis: 41.6667%; max-width: 41.6667%; }
  .col-sm-6 { flex-basis: 50%; max-width: 50%; }
  .col-sm-7 { flex-basis: 58.3333%; max-width: 58.3333%; }
  .col-sm-8 { flex-basis: 66.6667%; max-width: 66.6667%; }
  .col-sm-9 { flex-basis: 75%; max-width: 75%; }
  .col-sm-10 { flex-basis: 83.3333%; max-width: 83.3333%; }
  .col-sm-12 { flex-basis: 100%; max-width: 100%; }
  .col-sm-offset-1 { margin-left: 8.3333%; }
}
@media (min-width: 992px) {
  .col-md-4 { flex-basis: 33.3333%; max-width: 33.3333%; }
  .col-md-6 { flex-basis: 50%; max-width: 50%; }
  .col-md-8 { flex-basis: 66.6667%; max-width: 66.6667%; }
  .col-md-10 { flex-basis: 83.3333%; max-width: 83.3333%; }
  .col-md-offset-1 { margin-left: 8.3333%; }
}
.slideanim { visibility: visible; }
.row img[width="100%"], .col-sm-4 img, .col-sm-5 img, .col-sm-6 img { border-radius: 8px; box-shadow: 0 4px 0 var(--ivory-dark), 0 12px 30px rgba(0, 0, 0, .12); }

/* ---- Tables ---- */
.table-responsive, .scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table { border-collapse: collapse; border-spacing: 0; }
.table { width: 100%; max-width: 100%; margin-bottom: 20px; color: var(--text); font-size: 15px; }
.table th, .table td { padding: 9px 10px; line-height: 1.45; vertical-align: top; border-bottom: 1px solid var(--line); text-align: left; }
.table thead th, .table tr:first-child th {
  font: 700 11px/1.4 Montserrat, Lato, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--green-700);
  border-bottom: 2px solid var(--green-500); vertical-align: bottom;
}
.table tbody tr:nth-child(even) td { background: rgba(245, 239, 224, .45); }
.table-hover tbody tr:hover > td { background: var(--green-100); }
.table-sm th, .table-sm td { padding: 6px 8px; }
tr.info > td, tr.info > th, td.info { background: var(--green-100) !important; }
tr.success > td, td.success { background: #dff0d8 !important; }
tr.warning > td, td.warning { background: var(--gold-100) !important; }
.page_table { width: 100%; color: var(--text); font-size: 15px; }
.page_table th, .page_table td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.page_table th { font: 700 11px/1.4 Montserrat, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--green-700); }
.players th, .players td { white-space: nowrap; }
.players .flag { vertical-align: middle; }

/* ---- Alerts ---- */
.alert { padding: 14px 18px; margin-bottom: 20px; border: 1px solid transparent; border-left-width: 5px; border-radius: 8px; }
.alert-success { color: #245b2f; background: #e6f3e8; border-color: #bcdcc2; border-left-color: var(--green-500); }
.alert-info { color: #2d4f3a; background: var(--ivory); border-color: var(--ivory-dark); border-left-color: var(--gold); }
.alert-warning { color: #6b4d00; background: var(--gold-100); border-color: #ecd9a0; border-left-color: var(--gold); }
.alert-danger { color: var(--red-dark); background: #fbe9e9; border-color: #efc4c4; border-left-color: var(--red); }
.alert a { font-weight: 700; }
.alert form { display: inline; }
.alert p:last-child { margin-bottom: 0; }

/* ---- Buttons: little tiles ---- */
.btn {
  display: inline-block; padding: 10px 22px; margin: 0;
  font: 700 13px/1.4 Montserrat, Lato, sans-serif; letter-spacing: .12em; text-transform: uppercase; text-align: center;
  color: #fff; background: var(--red); border: 1px solid var(--red-dark); border-bottom-width: 4px; border-radius: 8px;
  cursor: pointer; text-decoration: none; vertical-align: middle; transition: transform .12s, background .2s, box-shadow .2s;
}
.btn:hover, .btn:focus { background: #d0333a; color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(193, 39, 45, .3); }
.btn:active { transform: translateY(2px); border-bottom-width: 2px; margin-bottom: 2px; }
.btn-lg { padding: 14px 34px; font-size: 15px; }
.btn-sm { padding: 5px 12px; font-size: 11px; letter-spacing: .08em; border-bottom-width: 3px; }
.btn-outline { background: var(--ivory); color: var(--ink); border-color: var(--ivory-dark); }
.btn-outline:hover, .btn-outline:focus { background: #fff; color: var(--red); box-shadow: 0 6px 16px rgba(0, 0, 0, .12); }
.btn-danger { background: var(--red); }
.btn-success { background: var(--green-700); border-color: var(--green-900); }
.btn-success:hover, .btn-success:focus { background: #27744a; box-shadow: 0 6px 16px rgba(31, 95, 58, .3); }
.badge {
  display: inline-block; padding: 3px 10px; font: 700 12px/1.3 Montserrat, sans-serif; letter-spacing: .05em; text-transform: none;
  color: #fff; background: var(--green-700); border-radius: 6px; vertical-align: middle;
}
.badge-success { background: var(--green-500); color: var(--ink); }
.badge-gold { background: var(--gold); color: var(--ink); }

/* ---- Forms ---- */
label, .form-label { display: inline-block; font: 700 12px/1.4 Montserrat, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--green-700); margin-bottom: 6px; }
.form-group { margin-bottom: 18px; }
.form-control {
  display: block; width: 100%; padding: 10px 14px; font: 400 16px/1.5 Lato, sans-serif; color: var(--ink);
  background: #fff; border: 1px solid var(--ivory-dark); border-radius: 8px; box-shadow: inset 0 2px 0 rgba(0, 0, 0, .03);
  transition: border-color .15s, box-shadow .15s;
}
.form-control::placeholder { color: #a6a69a; }
.form-control:focus { border-color: var(--green-500); outline: 0; box-shadow: 0 0 0 4px rgba(108, 175, 118, .25); }
textarea.form-control { resize: vertical; }
input[type="file"] { font: inherit; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.form-row > .form-group { flex: 1 1 240px; margin-bottom: 0; }
.required_legend { font-style: italic; }
.required_legend::before, .required::after { content: "* "; color: var(--red); }
.required::after { content: " *"; }
label.checkbox { font: 400 16px/1.5 Lato, sans-serif; text-transform: none; letter-spacing: 0; color: var(--text); display: block; padding-top: 6px; }
label.checkbox input { margin-right: 8px; }
.reg-form { max-width: 560px; }

/* ---- Lists of events (tournament list) ---- */
.event-list { list-style: none; margin: 0; padding: 0; }
.event-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 20px; padding: 12px 0; margin: 0; border-bottom: 1px solid var(--line); }
.event-list li a { font-weight: 700; text-decoration: none; }
.event-list li a:hover { text-decoration: underline; }
.event-list .when { color: var(--muted); font-size: 14px; white-space: nowrap; }
.event-cards { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 8px; }
.event-card {
  flex: 1 1 300px; max-width: 100%; display: flex; flex-direction: column; gap: 4px; padding: 26px 28px 24px; color: var(--text); text-decoration: none;
  background: linear-gradient(#fffdf8, var(--ivory)); border: 1px solid var(--ivory-dark); border-bottom-width: 6px; border-radius: 12px;
  position: relative; overflow: hidden; transition: transform .15s, box-shadow .2s;
}
.event-card::after {
  content: "中"; position: absolute; right: 14px; top: 2px; font: 400 92px/1 "Noto Sans CJK SC", "Microsoft YaHei", "PingFang SC", serif; color: rgba(193, 39, 45, .09); pointer-events: none;
}
.event-card:hover, .event-card:focus { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0, 0, 0, .14); color: var(--text); text-decoration: none; }
.event-card h3 { margin: 0 0 4px; font-size: 20px; }
.event-card .when { font: 700 12px/1.5 Montserrat, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.event-card .btn { align-self: flex-start; margin-top: 14px; }

/* ---- Footer ---- */
.um-footer {
  padding: 22px var(--pad-x); background: var(--green-900); color: rgba(255, 255, 255, .75);
  border-top: 4px solid var(--gold); font-size: 13px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px;
}
.um-footer a { color: #fff; text-decoration: none; }
.um-footer a:hover { color: var(--gold); }
.um-footer .sep { padding: 0 8px; color: var(--gold); }

/* ---- Anchors under the sticky navbar ---- */
[id] { scroll-margin-top: calc(var(--nav-h) + 12px); }

/* ---- Admin pages (tournaments) ---- */
.um-page.wide { max-width: 1400px; }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.admin-edit { background: var(--ivory); border: 1px solid var(--ivory-dark); border-radius: 10px; padding: 18px 22px 8px; margin-bottom: 22px; }
.admin-edit h3 { margin-top: 0; }
.admin-actions { margin: 16px 0 10px; }
.admin-table { font-size: 13px; }
.admin-table td.wrap { white-space: normal; min-width: 14em; max-width: 22em; }
.admin-table td, .admin-table th { white-space: nowrap; vertical-align: middle; }
.admin-table form { margin: 0; }
.nowrap { white-space: nowrap; }
.mono { font-family: Menlo, Consolas, monospace; font-size: 13px; }

/* ---- Phones ---- */
@media (max-width: 767px) {
  :root { --pad-x: 18px; --pad-y: 28px; }
  .um-page { margin: 0; border-radius: 0; box-shadow: none; }
  h1 { font-size: 30px; }
  h2 { font-size: 19px; gap: 10px; margin-bottom: 16px; }
  h2::before { width: 28px; height: 32px; font-size: 15px; }
  .um-hero-inner { padding: 44px 18px 30px; }
  .um-hero h1 { font-size: 30px; }
  .um-hero.compact h1 { font-size: 24px; }
  .um-hero .lead { font-size: 15px; }
  .um-hero::after { font-size: 200px; bottom: -50px; }
  .um-footer { flex-direction: column; text-align: center; }
  .btn-lg { width: 100%; }
}
@media (min-width: 768px) and (max-width: 1100px) {
  .um-page { margin: 24px 16px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .event-card, .um-nav ul a::after { transition: none; }
}
@media (min-width: 768px) and (max-width: 1480px) {
  .um-page.wide { margin-left: 24px; margin-right: 24px; }
}

/* ---- Home page (index.php) ---- */
/* Hero: shield logo + name over the table photo; a rack of the eight flower/season tiles along the bottom edge. */
.um-hero-home { overflow: visible; }
.um-hero-home .um-hero-inner {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "logo text" "links links";
  align-items: center; column-gap: 48px; row-gap: 8px; padding: 64px var(--pad-x) 96px; text-align: left;
}
.um-hero-home .um-hero-logo { grid-area: logo; height: 210px; width: auto; filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .45)); }
.um-hero-home h1 { grid-area: text; font-size: 60px; line-height: .98; letter-spacing: .02em; text-transform: uppercase; align-self: end; }
.um-hero-kicker { display: block; font-size: 13px; font-weight: 600; letter-spacing: .32em; margin-bottom: 14px; color: var(--gold); }
.um-hero-home .lead { grid-area: 2 / 2; max-width: 540px; margin-top: 6px; }
.um-hero-home .um-hero-cta { grid-area: 3 / 2; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.um-hero-home .um-sublinks { grid-area: 4 / 1 / 5 / 3; justify-content: flex-start; margin-top: 34px; }
.um-rack {
  position: absolute; left: 0; right: 0; bottom: -22px; z-index: 2; display: flex; justify-content: center; gap: 6px; pointer-events: none;
}
.um-rack img {
  width: 46px; height: auto; border-radius: 5px; box-shadow: 0 5px 0 var(--ivory-dark), 0 10px 18px rgba(0, 0, 0, .35);
  transform: rotate(var(--tilt, 0deg)); transform-origin: 50% 90%;
}
.um-rack img:nth-child(1) { --tilt: -7deg; } .um-rack img:nth-child(2) { --tilt: 3deg; } .um-rack img:nth-child(3) { --tilt: -2deg; }
.um-rack img:nth-child(4) { --tilt: 5deg; }  .um-rack img:nth-child(5) { --tilt: -4deg; } .um-rack img:nth-child(6) { --tilt: 2deg; }
.um-rack img:nth-child(7) { --tilt: -3deg; } .um-rack img:nth-child(8) { --tilt: 6deg; }

/* Upcoming tournament strip under the hero */
.um-next { padding: 44px var(--pad-x) 0; background: var(--paper); display: flex; flex-direction: column; gap: 12px; }
.um-next-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 16px 22px;
  background: linear-gradient(90deg, var(--gold-100), var(--paper) 60%); border: 1px solid #ecd9a0; border-left: 6px solid var(--gold); border-radius: 10px;
}
.um-tag { font: 700 11px/1.4 Montserrat, sans-serif; letter-spacing: .18em; text-transform: uppercase; color: var(--red); white-space: nowrap; }
.um-next-what { flex: 1 1 320px; display: flex; flex-direction: column; line-height: 1.4; }
.um-next-what strong { font-family: Montserrat, Lato, sans-serif; font-size: 18px; }
.um-next-what .when { color: var(--muted); font-size: 14px; }

/* About */
.um-actions { margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.um-photo { border-radius: 10px; box-shadow: 0 6px 0 var(--ivory-dark), 0 18px 40px rgba(0, 0, 0, .18); }
.um-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 36px 0 0; }
.um-facts > div {
  padding: 18px 20px 16px; text-align: center; background: linear-gradient(#fffdf8, var(--ivory));
  border: 1px solid var(--ivory-dark); border-bottom-width: 5px; border-radius: 10px;
}
.um-facts dt { font: 700 34px/1.1 Montserrat, sans-serif; color: var(--red); letter-spacing: -.01em; }
.um-facts dt[lang="zh"] { font-family: "Noto Sans CJK SC", "Microsoft YaHei", "PingFang SC", "Hiragino Sans", serif; font-weight: 400; font-size: 30px; letter-spacing: .12em; }
.um-facts dd { margin: 6px 0 0; font-size: 14px; line-height: 1.4; color: var(--muted); }

/* News */
.news-poster { display: block; width: 100%; max-width: 360px; border-radius: 10px; box-shadow: 0 6px 0 var(--ivory-dark), 0 18px 40px rgba(0, 0, 0, .18); transition: transform .15s; }
a:hover .news-poster { transform: translateY(-3px); }
.um-news-title { margin-top: 0; }
.um-news .event-list { margin-bottom: 0; }

/* Links: a grid of small tiles */
.um-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.um-links li { margin: 0; padding: 16px 20px 16px 24px; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--green-500); border-radius: 8px; }
.um-links li > a { display: block; font: 700 16px/1.3 Montserrat, Lato, sans-serif; text-decoration: none; margin-bottom: 4px; }
.um-links li > a::after { content: " \2197"; font-weight: 400; color: var(--muted); }
.um-links li > a[href^="/"]::after { content: " \2192"; }
.um-links li > span { display: block; font-size: 14px; color: var(--muted); }

/* Practice cards */
.um-intro { max-width: 640px; margin-bottom: 24px; }
.practice-cards { display: flex; flex-wrap: wrap; gap: 24px; text-align: left; }
.practice-card {
  flex: 1 1 260px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--ivory-dark); border-bottom-width: 5px; border-radius: 12px; overflow: hidden;
  transition: transform .15s, box-shadow .2s;
}
.practice-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0, 0, 0, .14); }
.practice-card > a { display: block; background: var(--green-100); border-bottom: 1px solid var(--line); }
.practice-card img { width: 100%; display: block; border-radius: 0; box-shadow: none; }
.practice-card .body { padding: 18px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.practice-card h4 { margin: 0 0 8px; }
.practice-card h4 a { text-decoration: none; }
.practice-card p { flex: 1; font-size: 15px; }
.practice-card .btn { align-self: flex-start; }

/* Footer credits line */
.um-footer .um-credits { flex-basis: 100%; font-size: 12px; color: rgba(255, 255, 255, .55); padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .12); }
.um-footer .um-credits a { color: rgba(255, 255, 255, .75); }

@media (max-width: 991px) {
  .um-hero-home .um-hero-logo { height: 160px; }
  .um-hero-home h1 { font-size: 46px; }
  .um-facts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .um-hero-home .um-hero-inner { grid-template-columns: 1fr; grid-template-areas: none; text-align: center; padding: 40px 18px 78px; }
  .um-hero-home .um-hero-logo { grid-area: auto; height: 120px; margin: 0 auto 6px; }
  .um-hero-home h1 { grid-area: auto; font-size: 38px; }
  .um-hero-home .lead, .um-hero-home .um-hero-cta, .um-hero-home .um-sublinks { grid-area: auto; justify-content: center; }
  .um-hero-home .lead { margin: 4px auto 0; }
  .um-hero-home .um-sublinks { margin-top: 24px; }
  .um-rack { gap: 4px; bottom: -16px; }
  .um-rack img { width: 34px; }
  .um-rack img:nth-child(n+7) { display: none; }
  .um-next { padding-top: 34px; }
  .um-next-item { padding: 14px 16px; }
  .um-next-item .btn { width: 100%; }
  .um-facts { grid-template-columns: 1fr 1fr; gap: 10px; }
  .um-facts > div { padding: 12px 10px; }
  .um-facts dt { font-size: 26px; }
  .um-facts dt[lang="zh"] { font-size: 22px; }
  .um-news .col-sm-4 { order: 2; margin-top: 20px; }
  .news-poster { max-width: 280px; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .practice-card, .news-poster { transition: none; }
}

/* Buttons inside photo/green banners keep their own text colour (the banner sets links to white) */
.um-hero .btn-outline, .um-hero .btn-outline:visited { color: var(--ink); }
.um-hero .btn-outline:hover, .um-hero .btn-outline:focus { color: var(--red); }
