/*
 * Racing Royale — Release 6 home page ("Luxurious Edition", from the Stitch
 * design). Scoped under .rrh so nothing else on the site is affected.
 * Palette: obsidian #111415, racing green #004225, champagne gold #e9c349.
 */
.rrh {
    --rrh-bg: #111415; --rrh-bg-2: #0c0f10; --rrh-card: #191c1d; --rrh-card-2: #1d2021; --rrh-card-3: #282a2b;
    --rrh-line: #404942; --rrh-text: #e1e3e4; --rrh-muted: #c0c9c0; --rrh-dim: #8a938b;
    --rrh-gold: #e9c349; --rrh-gold-2: #d4af37; --rrh-gold-ink: #241a00;
    --rrh-green: #004225; --rrh-green-2: #0b5a35; --rrh-mint: #98d4ac;
    --rrh-red: #93000a; --rrh-red-text: #ffb4ab;
    --rrh-serif: "Playfair Display", Georgia, "Times New Roman", serif;
    --rrh-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--rrh-bg); color: var(--rrh-text); font-family: var(--rrh-sans);
}
.rrh *, .rrh *::before, .rrh *::after { box-sizing: border-box; }
.rrh a { color: inherit; text-decoration: none; }
.rrh-wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

/* Shared bits */
.rrh-eyebrow { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--rrh-gold); }
.rrh-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; border: 1px solid rgba(233,195,73,.35); background: rgba(233,195,73,.08); color: var(--rrh-gold); }
.rrh-chip--green { border-color: rgba(152,212,172,.35); background: rgba(0,66,37,.55); color: var(--rrh-mint); }
.rrh-chip--muted { border-color: var(--rrh-line); background: transparent; color: var(--rrh-dim); letter-spacing: .06em; }
.rrh-h2 { font-family: var(--rrh-serif); font-weight: 700; font-size: clamp(26px, 3.4vw, 34px); line-height: 1.15; margin: 6px 0 6px; color: #fff; }
.rrh-sub { color: var(--rrh-muted); font-size: 14px; margin: 0; }
.rrh-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.rrh-head--center { flex-direction: column; align-items: center; text-align: center; }
.rrh-section { padding: 46px 0; }

.rrh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 6px; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, filter .15s ease, background .15s ease; white-space: nowrap; }
.rrh-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.rrh-btn--gold { background: linear-gradient(180deg, #f0cf5c, var(--rrh-gold)); color: var(--rrh-gold-ink); }
.rrh-btn--dark { background: var(--rrh-card-3); color: var(--rrh-text); border-color: var(--rrh-line); }
.rrh-btn--green { background: var(--rrh-green); color: var(--rrh-mint); border-color: rgba(152,212,172,.35); }
.rrh-btn--mint { background: var(--rrh-mint); color: #00391f; }
.rrh-btn svg { width: 16px; height: 16px; flex: none; }

.rrh-divider { display: flex; align-items: center; gap: 14px; color: var(--rrh-gold); opacity: .8; }
.rrh-divider::before, .rrh-divider::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(233,195,73,.45) 40%, rgba(233,195,73,.45) 60%, transparent); }
.rrh-divider svg { width: 18px; height: 18px; }

/* Hero */
.rrh-hero { position: relative; min-height: 400px; display: flex; align-items: center; text-align: center; padding: 56px 0 48px; overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 120%, rgba(0,66,37,.55), transparent 60%),
        linear-gradient(180deg, rgba(12,15,16,.55) 0%, rgba(12,15,16,.75) 60%, var(--rrh-bg) 100%),
        var(--rrh-hero-image, none) center 40% / cover no-repeat, var(--rrh-bg-2); }
.rrh-hero h1 { font-family: var(--rrh-serif); font-weight: 700; font-size: clamp(34px, 5.4vw, 60px); line-height: 1.05; margin: 16px 0 12px; color: #fff; letter-spacing: -.01em; }
.rrh-hero h1 em { font-style: italic; color: var(--rrh-gold); }
.rrh-hero p { max-width: 560px; margin: 0 auto 22px; color: var(--rrh-muted); font-size: 15px; line-height: 1.6; }
.rrh-code { display: flex; gap: 8px; max-width: 460px; margin: 0 auto 14px; padding: 6px; border-radius: 10px; background: rgba(12,15,16,.75); border: 1px solid rgba(233,195,73,.25); backdrop-filter: blur(6px); }
.rrh-code input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 0; outline: 0; background: transparent; color: #fff; font-size: 16px; font-family: var(--rrh-sans); letter-spacing: .14em; text-transform: uppercase; }
.rrh-code input::placeholder { color: var(--rrh-dim); letter-spacing: .04em; text-transform: none; }
.rrh-hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.rrh-hero-error { color: var(--rrh-red-text); font-size: 13px; margin: -6px 0 12px; }

/* Event cards */
.rrh-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rrh-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 12px; background: linear-gradient(180deg, var(--rrh-card-2), var(--rrh-card)); border: 1px solid rgba(64,73,66,.8); box-shadow: 0 10px 30px rgba(0,0,0,.35); min-width: 0; }
.rrh-card-photo { margin: -16px -16px 0; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px 12px 0 0; background: #0c0f10; }
.rrh-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.rrh-card:hover .rrh-card-photo img { transform: scale(1.03); }
.rrh-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 22px; }
.rrh-card h3 { font-family: var(--rrh-serif); font-size: 20px; line-height: 1.2; margin: 0; color: #fff; }
.rrh-card .rrh-venue { color: var(--rrh-muted); font-size: 12.5px; margin-top: 3px; }
.rrh-box { border-radius: 8px; padding: 10px 12px; background: rgba(12,15,16,.65); border: 1px solid rgba(64,73,66,.7); }
.rrh-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rrh-k { font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--rrh-dim); }
.rrh-v { font-size: 13px; font-weight: 700; color: #fff; margin-top: 2px; }
.rrh-v--gold { color: var(--rrh-gold); }
.rrh-close { background: linear-gradient(180deg, rgba(147,0,10,.55), rgba(147,0,10,.35)); border-color: rgba(255,180,171,.35); }
.rrh-close-row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.rrh-close .rrh-k { color: #ffcfc8; }
.rrh-close .rrh-k::before { content: "●"; color: #ff5a4e; margin-right: 6px; }
.rrh-close .rrh-v { color: #fff; }
.rrh-countdown { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-weight: 700; font-size: 15px; color: #fff; background: rgba(0,0,0,.35); padding: 2px 8px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.rrh-underway { color: var(--rrh-gold); font-weight: 700; font-size: 13px; }
.rrh-pool { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rrh-pool-amount { font-family: var(--rrh-serif); font-size: 22px; font-weight: 700; color: var(--rrh-gold); white-space: nowrap; }
.rrh-pool-note { font-size: 11px; color: var(--rrh-dim); margin-top: 2px; }
.rrh-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.rrh-card-actions--one { grid-template-columns: 1fr; }
.rrh-card--free { border-color: rgba(152,212,172,.35); }
.rrh-empty { padding: 28px; text-align: center; border-radius: 12px; border: 1px dashed var(--rrh-line); color: var(--rrh-muted); }

/* How it works */
.rrh-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rrh-step { padding: 20px; border-radius: 12px; background: var(--rrh-card); border: 1px solid rgba(64,73,66,.8); display: flex; flex-direction: column; gap: 10px; }
.rrh-step-num { font-family: var(--rrh-serif); font-size: 28px; color: rgba(233,195,73,.45); }
.rrh-step h3 { font-family: var(--rrh-serif); font-size: 20px; margin: 0; color: #fff; }
.rrh-step p { margin: 0; color: var(--rrh-muted); font-size: 14px; line-height: 1.6; }
.rrh-step-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(64,73,66,.6); font-size: 11.5px; color: var(--rrh-gold); }

/* Stats */
.rrh-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 22px; border-radius: 14px; background: linear-gradient(180deg, var(--rrh-card-2), var(--rrh-card)); border: 1px solid rgba(64,73,66,.8); text-align: center; }
.rrh-stat-num { font-family: var(--rrh-serif); font-weight: 700; font-size: clamp(24px, 3.2vw, 34px); color: var(--rrh-gold); line-height: 1.1; margin-top: 6px; }
.rrh-stat-note { font-size: 12px; color: var(--rrh-muted); margin-top: 4px; }

/* Want to play */
.rrh-play { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px; border-radius: 14px; border: 1px solid rgba(152,212,172,.25); background: radial-gradient(ellipse at 100% 0%, rgba(233,195,73,.12), transparent 50%), linear-gradient(120deg, rgba(0,66,37,.9), rgba(17,20,21,.95) 70%); }
.rrh-play h2 { margin-top: 10px; }
.rrh-play p { margin: 0; color: var(--rrh-muted); max-width: 560px; line-height: 1.6; }
.rrh-play p strong { color: var(--rrh-gold); }

/* FAQ */
.rrh-faq { max-width: 760px; margin: 0 auto; display: grid; gap: 8px; }
.rrh-faq details { border-radius: 8px; background: var(--rrh-card); border: 1px solid rgba(64,73,66,.8); }
.rrh-faq summary { list-style: none; cursor: pointer; padding: 14px 16px; font-family: var(--rrh-serif); font-size: 15.5px; color: #fff; display: flex; justify-content: space-between; gap: 12px; }
.rrh-faq summary::-webkit-details-marker { display: none; }
.rrh-faq summary::after { content: "⌄"; color: var(--rrh-gold); transition: transform .2s ease; }
.rrh-faq details[open] summary::after { transform: rotate(180deg); }
.rrh-faq details p { margin: 0; padding: 0 16px 14px; color: var(--rrh-muted); font-size: 14px; line-height: 1.6; }

/* Phones & tablets */
@media (max-width: 980px) {
    .rrh-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .rrh-hero { min-height: 340px; padding: 40px 0 34px; }
    .rrh-hero p { font-size: 14px; }
    .rrh-section { padding: 34px 0; }
    .rrh-cards, .rrh-steps { grid-template-columns: minmax(0, 1fr); }
    .rrh-stats { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .rrh-play { flex-direction: column; align-items: stretch; text-align: left; padding: 20px; }
    .rrh-play .rrh-btn { width: 100%; }
    .rrh-head { align-items: flex-start; }
    .rrh-hero-actions .rrh-btn { flex: 1 1 auto; }
}

/* Release 9.1 — on desktop/tablet (English & other left-to-right languages)
   the first card (soonest closing) sits on the RIGHT. Phones keep it on top.
   Arabic/Urdu pages already flow right-to-left, so they need nothing. */
@media (min-width: 721px) {
    html[dir="ltr"] .rrh-cards { direction: rtl; }
    html[dir="ltr"] .rrh-cards > * { direction: ltr; }
}

/* Release 10 — finished events (greyed) and the "no code yet" link. */
.rrh-card--past { opacity: .72; filter: saturate(.25); }
.rrh-card--past:hover { opacity: .9; }
.rrh-card--past .rrh-card-photo img { filter: grayscale(1); }
.rrh-card--past .rrh-pool-amount { color: var(--rrh-muted); }
.rrh-nocode { display: block; text-align: center; font-size: 12.5px; color: var(--rrh-mint); text-decoration: underline; text-underline-offset: 3px; margin-top: -2px; }
.rrh-nocode:hover { color: var(--rrh-gold); }
