/**
 * Rummikub extension for phpBB - styles.
 * @copyright (c) 2026 Kevicar
 * @license GNU General Public License, version 2 (GPL-2.0)
 */

/* ---------- themes ---------- */
.rk-app, .rk-share {
	--felt1: #1f8a5b; --felt2: #0b4d33; --rail: #5b3a1e; --rail2: #3a2412;
	--accent: #ffb703; --accent2: #fb8500; --ink: #1d2433; --card: #ffffff;
	--muted: #6b7280; --line: rgba(0,0,0,.08); --ok: #2ec27e; --bad: #e5484d;
	--t-red: #d7263d; --t-blue: #1b6ec2; --t-orange: #ee8a00; --t-black: #1f2328;
	--tile1: #fffdf5; --tile2: #efe4c4; --tile-edge: #c8b78a;
	position: relative; font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif; color: var(--ink);
	margin: 10px auto 18px; max-width: 1180px; min-height: 420px; -webkit-tap-highlight-color: transparent;
}
.rk-theme-royal { --felt1: #2753a8; --felt2: #12275a; --rail: #2a2f45; --rail2: #171a28; --accent: #ffd166; --accent2: #ef476f; }
.rk-theme-wood { --felt1: #b07a45; --felt2: #6b4423; --rail: #3d2614; --rail2: #24160b; --accent: #ffcf56; --accent2: #e07a1f; }
.rk-theme-night { --felt1: #2b1d52; --felt2: #0d0a1f; --rail: #1b1535; --rail2: #07050f; --accent: #00e5ff; --accent2: #d946ef; }
.rk-theme-candy { --felt1: #f472b6; --felt2: #9d4edd; --rail: #5b2a86; --rail2: #3c1361; --accent: #fde047; --accent2: #22d3ee; }

.rk-app *, .rk-dragghost * { box-sizing: border-box; }
.rk-app, .rk-share, .rk-dragghost { --side1: #e2d6b6; --side2: #cdbd94; --side3: #b3a173; }
.rk-dragghost { --tile1: #fffdf6; --tile2: #efe6cf; --tile-edge: #c8b78a; --t-red: #d7263d; --t-blue: #1b6ec2; --t-orange: #ee8a00; --t-black: #1f2328; --accent: #e9c46a; --brass: #c9a227; }
.rk-app button { font-family: inherit; }

/* ---------- loading / generic ---------- */
.rk-loading { display: flex; align-items: center; justify-content: center; min-height: 360px; }
.rk-spinner { width: 54px; height: 54px; border-radius: 10px; background: linear-gradient(var(--tile1), var(--tile2)); box-shadow: 0 5px 0 var(--tile-edge), 0 12px 20px rgba(0,0,0,.25); animation: rk-flip 1.1s infinite ease-in-out; }
@keyframes rk-flip { 0% { transform: perspective(300px) rotateY(0); } 50% { transform: perspective(300px) rotateY(180deg); } 100% { transform: perspective(300px) rotateY(360deg); } }
.rk-panel { background: var(--card); border-radius: 14px; padding: 18px; box-shadow: 0 6px 24px rgba(0,0,0,.08); }
.rk-error { color: var(--bad); text-align: center; }
.rk-mini { font-size: 12px; color: var(--muted); }
.rk-h { margin: 22px 0 10px; font-size: 17px; color: var(--ink); border: 0; }
.rk-uname { font-weight: bold; }

.rk-btn { appearance: none; border: 0; border-radius: 999px; padding: 9px 16px; font-size: 14px; font-weight: bold; cursor: pointer; background: #eef1f6; color: var(--ink); box-shadow: 0 3px 0 rgba(0,0,0,.12); transition: transform .12s, box-shadow .12s, filter .12s; white-space: nowrap; }
.rk-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.rk-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.rk-btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.rk-btn-primary { background: linear-gradient(180deg, var(--accent), var(--accent2)); color: #2b1600; box-shadow: 0 4px 0 #b45309, 0 8px 16px rgba(251,133,0,.3); }
.rk-btn-draw { background: linear-gradient(180deg, #60a5fa, #2563eb); color: #fff; box-shadow: 0 4px 0 #1e40af, 0 8px 16px rgba(37,99,235,.3); }
.rk-btn-big { padding: 12px 22px; font-size: 16px; }
.rk-ghost { background: transparent; box-shadow: none; }
.rk-icon { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 16px; cursor: pointer; transition: transform .15s, background .15s; }
.rk-icon:hover { transform: scale(1.1); background: rgba(255,255,255,.3); }
.rk-input { border: 2px solid #e3e7ee; border-radius: 10px; padding: 9px 12px; font-size: 14px; width: 100%; background: #fff; color: var(--ink); }
.rk-input:focus { outline: none; border-color: var(--accent2); }
.rk-small { max-width: 110px; }

/* ---------- tiles ---------- */
.rk-tile { --w: clamp(30px, 3.9vw, 46px); position: relative; width: var(--w); height: calc(var(--w) * 1.36); flex: 0 0 auto; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--tile1) 0%, var(--tile2) 100%); box-shadow: 0 4px 0 var(--tile-edge), 0 7px 10px rgba(0,0,0,.28), inset 0 1px 0 #fff; cursor: grab; user-select: none; touch-action: none; transition: transform .16s cubic-bezier(.3,1.6,.6,1), box-shadow .16s; }
.rk-tile b { font: 900 calc(var(--w) * .52)/1 "Arial Black", "Trebuchet MS", sans-serif; letter-spacing: -1px; text-shadow: 0 1px 0 rgba(255,255,255,.8); }
.rk-tile i { width: calc(var(--w) * .28); height: calc(var(--w) * .28); margin-top: 4px; border-radius: 50%; border: 2px solid currentColor; opacity: .5; }
.rk-c0 { color: var(--t-red); } .rk-c1 { color: var(--t-blue); } .rk-c2 { color: var(--t-orange); } .rk-c3 { color: var(--t-black); }
.rk-j { background: linear-gradient(160deg, #fffdf5, #fde68a); }
.rk-joker { width: 80%; height: auto; }
.rk-tile:hover { transform: translateY(-5px); box-shadow: 0 6px 0 var(--tile-edge), 0 14px 18px rgba(0,0,0,.3), inset 0 1px 0 #fff; }
.rk-tile.sel { transform: translateY(-9px); box-shadow: 0 6px 0 var(--tile-edge), 0 0 0 3px var(--accent), 0 14px 20px rgba(0,0,0,.35); }
.rk-tile.dragging { opacity: .25; }
.rk-tile.fresh { box-shadow: 0 4px 0 var(--tile-edge), 0 0 0 2px rgba(255,255,255,.9), 0 0 16px var(--accent); }
.rk-tile.last { animation: rk-glow 1.6s ease-in-out 2; }
.rk-tile.new { animation: rk-new 1s ease-out; box-shadow: 0 4px 0 var(--tile-edge), 0 0 0 3px #60a5fa, 0 7px 10px rgba(0,0,0,.28); }
.rk-tile.tiny { --w: 22px; border-radius: 4px; box-shadow: 0 2px 0 var(--tile-edge); cursor: default; display: inline-flex; margin: 1px; }
.rk-tile.tiny i { display: none; }
.rk-anim .rk-tile.pop { animation: rk-pop .35s cubic-bezier(.3,1.7,.5,1); }
.rk-anim .rk-tile.deal { animation: rk-deal .5s calc(var(--i) * 45ms) both cubic-bezier(.2,1.3,.5,1); }
@keyframes rk-pop { from { transform: scale(.6) translateY(-20px); } to { transform: none; } }
@keyframes rk-deal { from { opacity: 0; transform: translateY(-160px) rotateX(70deg) rotateZ(-20deg); } to { opacity: 1; transform: none; } }
@keyframes rk-new { 0% { transform: translateY(-60px) scale(1.2); opacity: 0; } 60% { transform: translateY(4px); opacity: 1; } 100% { transform: none; } }
@keyframes rk-glow { 50% { box-shadow: 0 4px 0 var(--tile-edge), 0 0 0 3px #fff, 0 0 26px 6px var(--accent); transform: translateY(-4px); } }

.rk-dragghost { position: fixed; left: 0; top: 0; z-index: 99999; pointer-events: none; display: flex; gap: 3px; filter: drop-shadow(0 16px 18px rgba(0,0,0,.4)); }
.rk-dragghost .rk-tile { transform: scale(1.08); }

/* ---------- lobby ---------- */
.rk-hero { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 26px 22px; border-radius: 18px; color: #fff; background: radial-gradient(ellipse at 30% 20%, var(--felt1), var(--felt2)); box-shadow: inset 0 0 0 6px var(--rail), inset 0 0 0 9px var(--rail2), 0 14px 30px rgba(0,0,0,.25); }
.rk-hero h1 { margin: 0; color: #fff; font: 900 38px/1.05 "Arial Black", "Trebuchet MS", sans-serif; letter-spacing: 1px; text-shadow: 0 4px 0 rgba(0,0,0,.25); border: 0; }
.rk-hero p { margin: 6px 0 0; opacity: .9; font-size: 15px; }
.rk-hero-text { position: relative; z-index: 2; flex: 1 1 260px; max-width: 44%; }
.rk-hero-tools { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; z-index: 3; }
.rk-hero-tiles { position: absolute; inset: 0; pointer-events: none; perspective: 700px; }
.rk-float { position: absolute; opacity: .9; }
.rk-float .rk-tile { cursor: default; }
.rk-float.f0 { left: 47%; top: 10%; transform: rotate(-14deg); animation: rk-bob 5s ease-in-out infinite; }
.rk-float.f1 { left: 52%; top: 50%; transform: rotate(8deg); animation: rk-bob 6s ease-in-out infinite .5s; }
.rk-float.f2 { left: 57%; top: 6%; transform: rotate(18deg); animation: rk-bob 5.5s ease-in-out infinite 1s; }
.rk-float.f3 { left: 45%; top: 56%; transform: rotate(-10deg); animation: rk-bob 6.5s ease-in-out infinite 1.5s; }
.rk-float.f4 { left: 59%; top: 50%; transform: rotate(12deg); animation: rk-bob 7s ease-in-out infinite .8s; }
@keyframes rk-bob { 0%,100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -14px; rotate: 6deg; } }
.rk-me { position: relative; z-index: 2; margin-left: auto; display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-radius: 14px; background: rgba(0,0,0,.25); backdrop-filter: blur(4px); }
.rk-me > div { display: flex; flex-direction: column; gap: 2px; }
.rk-me .rk-mini { color: rgba(255,255,255,.8); }
.rk-me.guest { font-weight: bold; }
.rk-balance { font-weight: bold; color: var(--accent); }
.rk-avatar { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; font: bold 18px/1 sans-serif; color: #fff; background: linear-gradient(135deg, var(--accent2), #c2185b); box-shadow: 0 3px 8px rgba(0,0,0,.3); flex: 0 0 auto; }
.rk-avatar.bot { background: linear-gradient(135deg, #64748b, #334155); }

.rk-tabs { display: flex; gap: 6px; margin: 16px 0 14px; overflow-x: auto; padding-bottom: 4px; }
.rk-tabs button { border: 0; border-radius: 12px; padding: 10px 14px; background: #fff; color: var(--ink); font-weight: bold; font-size: 14px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.06); transition: transform .15s; }
.rk-tabs button:hover { transform: translateY(-2px); }
.rk-tabs button.active { background: linear-gradient(180deg, var(--felt1), var(--felt2)); color: #fff; }
.rk-count { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--bad); color: #fff; font-style: normal; font-size: 12px; }

.rk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.rk-card { position: relative; overflow: hidden; background: var(--card); border-radius: 16px; padding: 18px; box-shadow: 0 8px 24px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 8px; transition: transform .2s, box-shadow .2s; }
.rk-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,.12); }
.rk-card h3 { margin: 0; font-size: 19px; border: 0; color: var(--ink); }
.rk-card p { margin: 0; color: var(--muted); }
.rk-card label { font-size: 12px; font-weight: bold; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.rk-card .rk-btn-big { margin-top: auto; }
.rk-card-icon { position: absolute; right: 12px; top: 8px; font-size: 44px; opacity: .15; }
.rk-card-wide { margin-bottom: 14px; }
.rk-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.rk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rk-chip { border: 2px solid #e3e7ee; background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: bold; cursor: pointer; color: var(--ink); }
.rk-chip.on { border-color: var(--accent2); background: #fff4e0; }
.rk-form-row { display: flex; flex-wrap: wrap; gap: 8px; }
.rk-form-row .rk-input { flex: 1 1 160px; }

.rk-list { display: flex; flex-direction: column; gap: 8px; }
.rk-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; background: var(--card); border-radius: 12px; padding: 10px 14px; box-shadow: 0 3px 12px rgba(0,0,0,.05); }
.rk-row.hot { box-shadow: 0 0 0 2px var(--accent), 0 6px 18px rgba(251,133,0,.2); }
.rk-actions-inline { display: flex; gap: 6px; align-items: center; }
.rk-seats i { display: inline-block; width: 10px; height: 14px; margin-right: 2px; border-radius: 2px; background: #e3e7ee; }
.rk-seats i.on { background: var(--ok); }
.rk-empty { text-align: center; font-size: 40px; padding: 30px 10px; color: var(--muted); }
.rk-empty p { font-size: 15px; }
.rk-tourn .rk-ribbon { position: absolute; right: -34px; top: 14px; transform: rotate(35deg); background: var(--felt1); color: #fff; font-size: 11px; font-weight: bold; padding: 3px 40px; }
.rk-tourn.s1 .rk-ribbon { background: var(--accent2); }
.rk-tourn.s2 .rk-ribbon, .rk-tourn.s3 .rk-ribbon { background: #94a3b8; }
.rk-facts { list-style: none; margin: 4px 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; font-size: 13px; }

.rk-tablewrap { overflow-x: auto; }
.rk-rank { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.rk-rank th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--muted); padding: 4px 10px; }
.rk-rank td { background: var(--card); padding: 10px; }
.rk-rank td:first-child { border-radius: 10px 0 0 10px; font-size: 18px; }
.rk-rank td:last-child { border-radius: 0 10px 10px 0; }
.rk-rank tr.me td { background: #fff4e0; }
.rk-rank .pos { color: var(--ok); } .rk-rank .neg { color: var(--bad); }

/* ---------- game ---------- */
.rk-game { position: relative; border-radius: 18px; padding: 12px; background: radial-gradient(ellipse at 50% 30%, var(--felt1), var(--felt2) 75%); box-shadow: inset 0 0 0 7px var(--rail), inset 0 0 0 10px var(--rail2), 0 18px 40px rgba(0,0,0,.3); color: #fff; overflow: hidden; }
.rk-game:fullscreen { border-radius: 0; overflow: auto; }
.rk-topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; padding: 4px 6px 8px; }
.rk-topbar .rk-btn, .rk-game .rk-ghost { color: #fff; }
.rk-gtitle { font-weight: bold; opacity: .9; }
.rk-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; align-items: center; }
.rk-pool { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px; border-radius: 999px; background: rgba(0,0,0,.25); font-weight: bold; }
.rk-pool-stack { width: 18px; height: 22px; border-radius: 3px; background: linear-gradient(var(--tile1), var(--tile2)); box-shadow: 0 2px 0 var(--tile-edge), 0 4px 0 var(--tile1), 0 6px 0 var(--tile-edge); }

.rk-players { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 8px; }
.rk-player { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(0,0,0,.22); transition: transform .25s, background .25s; }
.rk-player .rk-uname, .rk-player strong { color: #fff !important; }
.rk-player .rk-mini { color: rgba(255,255,255,.75); }
.rk-pinfo { display: flex; flex-direction: column; line-height: 1.2; }
.rk-ring { padding: 3px; border-radius: 50%; background: rgba(255,255,255,.2); }
.rk-player.active { background: rgba(0,0,0,.4); transform: scale(1.05); }
.rk-player.active .rk-ring { background: conic-gradient(var(--accent) calc(var(--p) * 360deg), rgba(255,255,255,.15) 0); animation: rk-pulse 1.4s infinite; }
.rk-player.me { outline: 2px solid rgba(255,255,255,.4); }
.rk-player.out { opacity: .45; }
.rk-player.winner { background: linear-gradient(90deg, #f59f00, #ffd43b); }
.rk-player.winner strong, .rk-player.winner .rk-mini { color: #3b2100 !important; }
.rk-turnclock { font-weight: bold; font-variant-numeric: tabular-nums; padding: 2px 8px; border-radius: 8px; background: rgba(255,255,255,.15); }
.rk-turnclock.urgent { background: var(--bad); animation: rk-pulse .6s infinite; }
@keyframes rk-pulse { 50% { filter: brightness(1.3); } }

.rk-stage { perspective: 1100px; perspective-origin: 50% 0; padding: 0 4px; }
.rk-board { min-height: 230px; display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 16px 18px; padding: 20px 16px; border-radius: 14px; background: rgba(0,0,0,.12); box-shadow: inset 0 2px 18px rgba(0,0,0,.35); transform-origin: 50% 0; transition: transform .5s; }
.rk-3d .rk-board { transform: rotateX(12deg) scale(.92); transform-style: preserve-3d; }
.rk-board-empty { width: 100%; text-align: center; opacity: .6; font-style: italic; padding: 10px; }
.rk-set { position: relative; display: flex; flex-wrap: wrap; justify-content: center; max-width: 100%; gap: 3px; padding: 8px 8px 10px; border-radius: 10px; background: rgba(255,255,255,.08); border: 2px solid transparent; min-height: 80px; transition: background .2s, border-color .2s; }
.rk-set.ok { border-color: rgba(46,194,126,.0); }
.rk-set.bad { border-color: rgba(229,72,77,.9); background: rgba(229,72,77,.15); }
.rk-set.hover, .rk-newset.hover { background: rgba(255,255,255,.25); border-color: var(--accent); }
.rk-setval { position: absolute; top: -10px; right: -6px; min-width: 24px; padding: 1px 6px; border-radius: 10px; font-size: 11px; font-weight: bold; background: var(--ok); color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.rk-set.bad .rk-setval { background: var(--bad); }
.rk-set.shake { animation: rk-shake .45s; }
@keyframes rk-shake { 20%,60% { transform: translateX(-7px); } 40%,80% { transform: translateX(7px); } }
.rk-newset { display: flex; align-items: center; justify-content: center; min-width: 120px; min-height: 80px; border: 2px dashed rgba(255,255,255,.45); border-radius: 10px; color: rgba(255,255,255,.75); font-weight: bold; cursor: pointer; transition: background .2s, border-color .2s; }

.rk-hud { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; min-height: 40px; margin: 10px 0 4px; }
.rk-yourturn { padding: 6px 16px; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #2b1600; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; animation: rk-pulse 1.5s infinite; }
.rk-waitturn { opacity: .85; font-weight: bold; }
.rk-dots i { display: inline-block; width: 5px; height: 5px; margin-left: 3px; border-radius: 50%; background: #fff; animation: rk-dot 1.2s infinite; }
.rk-dots i:nth-child(2) { animation-delay: .2s; } .rk-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes rk-dot { 50% { transform: translateY(-5px); opacity: .4; } }
.rk-meld { position: relative; display: inline-block; width: 220px; height: 26px; border-radius: 999px; background: rgba(0,0,0,.3); overflow: hidden; }
.rk-meld span { position: relative; z-index: 2; display: block; text-align: center; font-size: 12px; line-height: 26px; font-weight: bold; }
.rk-meld i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #f59f00, #fb8500); transition: width .4s; }
.rk-meld i.done { background: linear-gradient(90deg, #2ec27e, #16a34a); }

.rk-rackwrap { perspective: 900px; margin-top: 6px; padding: 0 4px; }
.rk-rack { min-height: 150px; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 6px 4px; padding: 14px 14px 18px; border-radius: 12px; background: linear-gradient(180deg, #8a5a2b, #5b3a1e 70%, #3a2412); box-shadow: inset 0 3px 0 rgba(255,255,255,.2), inset 0 -6px 0 rgba(0,0,0,.3), 0 12px 24px rgba(0,0,0,.35); transform-origin: 50% 100%; }
.rk-3d .rk-rack { transform: rotateX(-7deg) scale(.95); }
.rk-rack.hover { box-shadow: inset 0 0 0 3px var(--accent), 0 12px 24px rgba(0,0,0,.35); }
.rk-spectator { width: 100%; text-align: center; padding: 40px; font-weight: bold; opacity: .8; }
.rk-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.rk-logbox { margin-top: 12px; background: rgba(0,0,0,.2); border-radius: 10px; padding: 6px 12px; }
.rk-logbox summary { cursor: pointer; font-weight: bold; }
.rk-log { max-height: 170px; overflow: auto; margin: 6px 0 0; padding-left: 0; list-style: none; font-size: 13px; }
.rk-log li { padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.rk-log time { opacity: .6; font-variant-numeric: tabular-nums; }

.rk-waiting { width: 100%; text-align: center; padding: 10px; }
.rk-waiting h2 { color: #fff; border: 0; }
.rk-seats-big { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 16px 0; }
.rk-seat { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 120px; padding: 14px; border-radius: 14px; background: rgba(0,0,0,.2); }
.rk-seat.taken { background: rgba(255,255,255,.15); animation: rk-pop .4s; }
.rk-empty-seat { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; border: 2px dashed rgba(255,255,255,.5); }
.rk-wait-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.rk-waiting .rk-mini { color: rgba(255,255,255,.75); margin-top: 12px; }

/* ---------- modal / toast ---------- */
.rk-modal-wrap { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10,15,25,.55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .25s; }
.rk-modal-wrap.show { opacity: 1; }
.rk-modal { position: relative; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; background: #fff; color: var(--ink); border-radius: 18px; padding: 22px; box-shadow: 0 30px 60px rgba(0,0,0,.35); transform: translateY(20px) scale(.96); transition: transform .3s cubic-bezier(.3,1.5,.6,1); }
.rk-modal-wrap.show .rk-modal { transform: none; }
.rk-modal.rk-wide { max-width: 900px; }
.rk-modal h2 { margin-top: 0; border: 0; color: var(--ink); }
.rk-modal-close { position: absolute; right: 10px; top: 8px; border: 0; background: none; font-size: 26px; cursor: pointer; color: var(--muted); }
.rk-help ul { padding-left: 20px; } .rk-help li { margin: 5px 0; }
.rk-result { text-align: center; }
.rk-result .rk-trophy { font-size: 64px; animation: rk-bounce 1s cubic-bezier(.3,1.8,.5,1); }
.rk-result.won h2 { background: linear-gradient(90deg, #f59f00, #e11d48); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 30px; }
.rk-result .rk-rank td { background: #f6f7fb; text-align: left; }
.rk-result .rk-card-actions { justify-content: center; margin-top: 12px; }
@keyframes rk-bounce { from { transform: scale(0) rotate(-30deg); } to { transform: none; } }
.rk-mini-tiles { max-width: 260px; }
.rk-toast { position: fixed; left: 50%; bottom: 24px; z-index: 100000; transform: translate(-50%, 140%); padding: 12px 20px; border-radius: 12px; background: #1f2937; color: #fff; font-weight: bold; box-shadow: 0 12px 30px rgba(0,0,0,.35); transition: transform .3s cubic-bezier(.3,1.5,.6,1); max-width: 90vw; text-align: center; }
.rk-toast.show { transform: translate(-50%, 0); }
.rk-toast.err { background: var(--bad); }
.rk-toast.ok { background: #16a34a; }
.rk-confetti { position: fixed; inset: 0; z-index: 100001; pointer-events: none; }

.rk-bracket { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 8px; }
.rk-round { min-width: 180px; display: flex; flex-direction: column; gap: 10px; justify-content: space-around; }
.rk-round h4 { margin: 0; text-align: center; color: var(--muted); }
.rk-match { border-radius: 10px; background: #f6f7fb; padding: 8px 10px; border-left: 4px solid #cbd5e1; }
.rk-match.live { border-left-color: var(--accent2); }
.rk-match div { padding: 2px 0; } .rk-match .win { font-weight: bold; } .rk-match .lose { opacity: .5; text-decoration: line-through; }
.rk-match a { font-size: 12px; }

/* ---------- share block ---------- */
.rk-share, .rk-share * { box-sizing: border-box; }
.rk-share { position: relative; min-height: 0; margin: 0 auto 20px; max-width: 1180px; padding: 24px 22px; border-radius: 18px; text-align: center; color: #fff; background: radial-gradient(ellipse at 30% 20%, var(--felt1), var(--felt2)); box-shadow: inset 0 0 0 6px var(--rail), inset 0 0 0 9px var(--rail2), 0 14px 30px rgba(0,0,0,.25); font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif; }
.rk-share-head { display: flex; flex-direction: column; gap: 6px; align-items: center; margin-bottom: 16px; }
.rk-share-icon { font-size: 36px; animation: rk-bob 4s infinite; }
.rk-share h3 { margin: 0; font: 900 22px/1.2 "Arial Black", "Trebuchet MS", sans-serif; border: 0; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.25); }
.rk-share p { margin: 3px 0 0; color: rgba(255,255,255,.85); }
.rk-share-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.rk-share-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; color: #fff !important; font-weight: bold; text-decoration: none !important; box-shadow: 0 3px 0 rgba(0,0,0,.3), 0 6px 14px rgba(0,0,0,.2); transition: transform .15s; }
.rk-share-btn:hover { transform: translateY(-2px) scale(1.03); }
.rk-sn-ico { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.22); font: bold 12px/1 Arial, sans-serif; }
.rk-sn-whatsapp { background: #25d366; } .rk-sn-whatsapp .rk-sn-ico::before { content: "✆"; }
.rk-sn-facebook { background: #1877f2; } .rk-sn-facebook .rk-sn-ico::before { content: "f"; font-size: 15px; }
.rk-sn-messenger { background: linear-gradient(45deg, #0099ff, #a033ff, #ff5280); } .rk-sn-messenger .rk-sn-ico::before { content: "ϟ"; }
.rk-sn-x { background: #111; } .rk-sn-x .rk-sn-ico::before { content: "𝕏"; }
.rk-sn-telegram { background: #229ed9; } .rk-sn-telegram .rk-sn-ico::before { content: "➤"; }
.rk-sn-linkedin { background: #0a66c2; } .rk-sn-linkedin .rk-sn-ico::before { content: "in"; }
.rk-sn-reddit { background: #ff4500; } .rk-sn-reddit .rk-sn-ico::before { content: "r"; }
.rk-sn-email { background: #6b7280; } .rk-sn-email .rk-sn-ico::before { content: "@"; }
.rk-sn-sms { background: #10b981; } .rk-sn-sms .rk-sn-ico::before { content: "✉"; }
.rk-sn-pm { background: #8b5cf6; } .rk-sn-pm .rk-sn-ico::before { content: "✎"; }
.rk-sn-copy { background: #334155; } .rk-sn-copy .rk-sn-ico::before { content: "⧉"; }
.rk-sn-native { background: #f59f00; } .rk-sn-native .rk-sn-ico::before { content: "⇪"; }
.rk-share-url { display: block; width: 100%; max-width: 520px; margin: 14px auto 0; padding: 8px 12px; border-radius: 10px; border: 2px solid rgba(255,255,255,.25); background: rgba(0,0,0,.25); color: #fff; font-size: 13px; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
	.rk-float { display: none; }
	.rk-hero-text { max-width: none; }
}
@media (max-width: 700px) {
	.rk-hero h1 { font-size: 28px; }
	.rk-float { display: none; }
	.rk-tile { --w: 36px; }
	.rk-board { padding: 10px; gap: 12px 10px; }
	.rk-3d .rk-board, .rk-3d .rk-rack { transform: none; }
	.rk-set { padding: 6px 5px 8px; min-height: 64px; }
	.rk-newset { min-width: 80px; min-height: 64px; }
	.rk-player { padding-right: 8px; }
	.rk-avatar { width: 32px; height: 32px; font-size: 14px; }
	.rk-btn-big { padding: 10px 16px; font-size: 14px; }
	.rk-facts { grid-template-columns: 1fr; }
	.rk-topbar { justify-content: center; }
	.rk-gtitle { display: none; }
	.rk-music { max-width: 120px; }
	.rk-hero-tools { position: static; width: 100%; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
	.rk-app *, .rk-app *::before { animation: none !important; transition: none !important; }
}

/* ---------- music picker ---------- */
.rk-music { appearance: none; height: 36px; max-width: 150px; padding: 0 28px 0 12px; border: 0; border-radius: 999px; background: rgba(255,255,255,.18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23fff'/%3E%3C/svg%3E") no-repeat right 11px center; color: #fff; font: bold 13px/36px inherit; cursor: pointer; }
.rk-music option { color: #1d2433; }
.rk-music.playing { box-shadow: 0 0 0 2px var(--accent); animation: rk-pulse 2s infinite; }

/* ---------- end of game, inside the table ---------- */
.rk-result-inline { width: 100%; max-width: 640px; margin: 0 auto 10px; padding: 20px 18px; border-radius: 16px; text-align: center; color: #fff; background: rgba(0,0,0,.32); box-shadow: 0 0 0 2px rgba(255,255,255,.12), 0 14px 30px rgba(0,0,0,.3); animation: rk-pop .45s cubic-bezier(.3,1.6,.5,1); }
.rk-result-inline.won { box-shadow: 0 0 0 3px var(--accent), 0 0 40px rgba(255,183,3,.35), 0 14px 30px rgba(0,0,0,.3); }
.rk-result-inline h2 { margin: 4px 0; color: #fff; border: 0; font: 900 28px/1.2 "Arial Black", "Trebuchet MS", sans-serif; text-shadow: 0 3px 0 rgba(0,0,0,.3); }
.rk-result-inline.won h2 { background: linear-gradient(90deg, #ffd43b, #ff922b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rk-result-inline p { margin: 0 0 10px; opacity: .85; }
.rk-result-inline .rk-rank th { color: rgba(255,255,255,.7); }
.rk-result-inline .rk-rank td { background: rgba(255,255,255,.1); color: #fff; text-align: left; }
.rk-result-inline .rk-rank tr.me td { background: rgba(255,183,3,.25); }
.rk-result-inline .rk-rank .pos { color: #69db7c; } .rk-result-inline .rk-rank .neg { color: #ff8787; }
.rk-result-inline .rk-uname { color: #fff !important; }
.rk-result-inline .rk-ghost { color: #fff; }
.rk-result-row { width: 100%; margin: 4px 0 14px; position: relative; z-index: 5; }

/* ======================================================================
   Version 2.0
   ====================================================================== */

/* ---------- felts (themes) and tile skins ---------- */
.rk-theme-emerald { --felt1: #1f8a5b; --felt2: #0b4d33; --rail: #5b3a1e; --rail2: #3a2412; --accent: #ffb703; --accent2: #fb8500; }
.rk-theme-bordeaux { --felt1: #8c1d2c; --felt2: #3d0912; --rail: #3d2614; --rail2: #24160b; --accent: #f2c14e; --accent2: #d4892a; }
.rk-theme-slate { --felt1: #4b5563; --felt2: #1f242c; --rail: #2b2b2b; --rail2: #121212; --accent: #e9c46a; --accent2: #c9952b; }
.rk-skin-ivory { --tile1: #fffdf6; --tile2: #efe6cf; --tile-edge: #c8b78a; --side1: #e2d6b6; --side2: #cdbd94; --side3: #b3a173; --t-red: #c8102e; --t-blue: #0b5cad; --t-orange: #e07a00; --t-black: #1c1c1c; --tile-gloss: rgba(255,255,255,.85); }
.rk-skin-pearl { --tile1: #ffffff; --tile2: #e6ebf2; --tile-edge: #b9c3d0; --side1: #dfe5ee; --side2: #c7d0dc; --side3: #aab5c4; --t-red: #d0153a; --t-blue: #1157b7; --t-orange: #e87d00; --t-black: #23262d; --tile-gloss: rgba(255,255,255,.95); }
.rk-skin-ebony { --tile1: #3b3b42; --tile2: #18181c; --tile-edge: #0b0b0d; --side1: #27272c; --side2: #1a1a1e; --side3: #0c0c0e; --t-red: #ff5d6e; --t-blue: #5fb0ff; --t-orange: #ffb547; --t-black: #f1efe9; --tile-gloss: rgba(255,255,255,.18); }
.rk-skin-marble { --tile1: #fbfbfa; --tile2: #e3e3e0; --tile-edge: #b8b8b4; --side1: #d9d9d5; --side2: #c4c4bf; --side3: #a8a8a3; --t-red: #b5122b; --t-blue: #0f4d97; --t-orange: #cf6f00; --t-black: #1e1e1e; --tile-gloss: rgba(255,255,255,.8); }
.rk-skin-gold { --tile1: #fffaf0; --tile2: #f1e3c0; --tile-edge: #b8892a; --side1: #e6c25a; --side2: #c99a2e; --side3: #9c7417; --t-red: #b0102a; --t-blue: #0d4f9a; --t-orange: #c76a00; --t-black: #1b1b1b; --tile-gloss: rgba(255,255,255,.9); }
.rk-skin-ebony .rk-tile b { text-shadow: 0 1px 0 rgba(0,0,0,.6); }
.rk-skin-marble .rk-tile { background-image: linear-gradient(118deg, transparent 38%, rgba(110,110,120,.16) 39.5%, transparent 41.5%), linear-gradient(62deg, transparent 63%, rgba(110,110,120,.12) 64%, transparent 65.5%), linear-gradient(160deg, var(--tile1), var(--tile2)); }
.rk-skin-gold .rk-tile { box-shadow: inset 0 0 0 2px #d4af37, 0 4px 0 var(--side2), 0 7px 10px rgba(0,0,0,.28); }
.rk-skin-pearl .rk-tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(125deg, rgba(255,190,225,.22), rgba(170,215,255,.22) 45%, rgba(190,255,215,.18)); mix-blend-mode: multiply; }

/* ---------- realistic look: felt, wood, resin tiles ---------- */
.rk-real {
	--noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
	--wood: repeating-linear-gradient(91deg, rgba(255,255,255,.035) 0 2px, transparent 2px 9px), repeating-linear-gradient(88deg, rgba(0,0,0,.09) 0 1px, transparent 1px 13px), repeating-linear-gradient(93deg, rgba(0,0,0,.05) 0 3px, transparent 3px 23px), linear-gradient(180deg, #7a4b2a 0%, #5a361d 45%, #3f2413 100%);
	--brass: #c9a227;
	--accent: #e9c46a; --accent2: #c9952b;
	font-family: "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
}
.rk-real.rk-theme-emerald, .rk-real .rk-theme-emerald { --felt1: #1b7a4c; --felt2: #093822; }
.rk-real .rk-game, .rk-real .rk-hero, .rk-share.rk-real {
	border: 13px solid transparent;
	background: var(--noise) padding-box, radial-gradient(ellipse at 50% 38%, transparent 35%, rgba(0,0,0,.42) 100%) padding-box, radial-gradient(ellipse at 50% 30%, var(--felt1), var(--felt2) 85%) padding-box, var(--wood) border-box;
	background-size: 180px 180px, auto, auto, auto;
	box-shadow: inset 0 0 0 1px rgba(201,162,39,.55), inset 0 0 0 3px rgba(0,0,0,.25), inset 0 10px 30px rgba(0,0,0,.35), 0 2px 0 #2a170b, 0 18px 40px rgba(0,0,0,.35);
}
.rk-real .rk-game { padding: 10px; border-radius: 22px; }
.rk-real .rk-hero, .rk-share.rk-real { border-radius: 20px; }
.rk-real .rk-hero h1, .rk-share.rk-real h3 { font-family: Georgia, "Times New Roman", serif; font-weight: bold; letter-spacing: 2px; text-transform: uppercase; background: linear-gradient(180deg, #fff3c4, #e9c46a 55%, #b8862b); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 2px 1px rgba(0,0,0,.45)); }
.rk-real .rk-hero p { font-style: italic; letter-spacing: .3px; }
.rk-real .rk-board { background: rgba(0,0,0,.10); box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), inset 0 6px 26px rgba(0,0,0,.35); border-radius: 16px; }
.rk-real .rk-set { background: rgba(0,0,0,.10); border-width: 1px; box-shadow: inset 0 1px 6px rgba(0,0,0,.25); }
.rk-real .rk-set.ok { border-color: rgba(255,255,255,.06); }
.rk-real .rk-setval { background: linear-gradient(180deg, #f3d98b, #c9952b); color: #2a1a00; font-weight: 800; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.rk-real .rk-newset { border: 1px dashed rgba(233,196,106,.5); color: rgba(255,240,200,.75); }

/* resin tiles with thickness, bevel and engraved figures */
.rk-real .rk-tile {
	border-radius: 7px;
	background:
		radial-gradient(130% 70% at 28% 8%, var(--tile-gloss, rgba(255,255,255,.85)), transparent 55%),
		linear-gradient(170deg, var(--tile1) 0%, var(--tile2) 100%);
	box-shadow:
		inset 0 1px 0 rgba(255,255,255,.9),
		inset 0 -2px 3px rgba(0,0,0,.10),
		inset 0 0 0 1px rgba(0,0,0,.07),
		0 1px 0 var(--side1), 0 2px 0 var(--side1), 0 3px 0 var(--side2), 0 4px 0 var(--side2), 0 5px 0 var(--side3),
		0 6px 1px rgba(0,0,0,.35), 0 10px 14px rgba(0,0,0,.30);
}
.rk-real .rk-tile b { font: 800 calc(var(--w) * .58)/1 "Bahnschrift", "DIN Alternate", "Arial Narrow", "Helvetica Neue", Arial, sans-serif; letter-spacing: -.5px; text-shadow: 0 1px 0 rgba(255,255,255,.75), 0 -1px 0 rgba(0,0,0,.28); }
.rk-real .rk-tile i { border-width: 1.5px; opacity: .45; box-shadow: inset 0 1px 1px rgba(0,0,0,.25), 0 1px 0 rgba(255,255,255,.6); }
.rk-real .rk-j { color: var(--t-red); background: radial-gradient(130% 70% at 28% 8%, var(--tile-gloss, rgba(255,255,255,.85)), transparent 55%), linear-gradient(170deg, var(--tile1), var(--tile2)); }
.rk-real .rk-joker-real { width: 74%; filter: drop-shadow(0 1px 0 rgba(255,255,255,.6)); }
.rk-real .rk-tile:hover { transform: translateY(-4px); box-shadow: inset 0 1px 0 rgba(255,255,255,.9), inset 0 0 0 1px rgba(0,0,0,.07), 0 1px 0 var(--side1), 0 2px 0 var(--side1), 0 3px 0 var(--side2), 0 4px 0 var(--side2), 0 5px 0 var(--side3), 0 9px 2px rgba(0,0,0,.25), 0 16px 20px rgba(0,0,0,.32); }
.rk-real .rk-tile.sel { transform: translateY(-8px); box-shadow: inset 0 1px 0 #fff, 0 0 0 2px var(--brass), 0 3px 0 var(--side2), 0 5px 0 var(--side3), 0 0 18px rgba(233,196,106,.65), 0 16px 20px rgba(0,0,0,.35); }
.rk-real .rk-tile.fresh { box-shadow: inset 0 1px 0 #fff, 0 0 0 2px rgba(233,196,106,.9), 0 3px 0 var(--side2), 0 5px 0 var(--side3), 0 0 14px rgba(233,196,106,.55); }
.rk-real .rk-tile.tiny { box-shadow: 0 1px 0 var(--side2), 0 2px 0 var(--side3); }

/* wooden rack with a ledge */
.rk-real .rk-rack { background: var(--wood); border-radius: 14px; box-shadow: inset 0 2px 0 rgba(255,255,255,.18), inset 0 -14px 0 rgba(0,0,0,.22), inset 0 -15px 0 rgba(255,255,255,.06), 0 3px 0 #24140a, 0 14px 26px rgba(0,0,0,.45); padding-bottom: 24px; }

/* classy controls */
.rk-real .rk-btn { border-radius: 10px; letter-spacing: .2px; }
.rk-real .rk-btn-primary { background: linear-gradient(180deg, #f3d98b, #d8a940 55%, #b8862b); color: #2a1a00; box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 3px 0 #7c5a14, 0 8px 16px rgba(0,0,0,.25); }
.rk-real .rk-btn-draw { background: linear-gradient(180deg, #2f4a6d, #1b2d45); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 3px 0 #0e1826, 0 8px 16px rgba(0,0,0,.25); }
.rk-real .rk-game .rk-btn:not(.rk-btn-primary):not(.rk-btn-draw):not(.rk-ghost) { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.rk-real .rk-yourturn { background: linear-gradient(180deg, #f3d98b, #c9952b); color: #2a1a00; border-radius: 8px; letter-spacing: 2px; }
.rk-real .rk-player { background: rgba(0,0,0,.28); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.rk-real .rk-player.active { box-shadow: inset 0 0 0 1px rgba(233,196,106,.6); }
.rk-real .rk-tabs button { border-radius: 10px; box-shadow: 0 1px 0 rgba(0,0,0,.08), inset 0 0 0 1px #e8e2d0; }
.rk-real .rk-tabs button.active { background: radial-gradient(ellipse at 50% 30%, var(--felt1), var(--felt2)); box-shadow: inset 0 -3px 0 var(--brass); }
.rk-real .rk-card, .rk-real .rk-row { box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 8px 22px rgba(30,20,0,.07); border: 1px solid #ece6d6; }
.rk-real .rk-card h3, .rk-real .rk-h { font-family: Georgia, "Times New Roman", serif; letter-spacing: .3px; }
.rk-real .rk-chip.on { border-color: var(--accent2); background: #fbf3dc; }
.rk-real .rk-avatar { background: linear-gradient(135deg, #c9952b, #7c5a14); box-shadow: 0 0 0 2px rgba(255,255,255,.6), 0 3px 8px rgba(0,0,0,.3); }

/* ---------- lobby additions ---------- */
.rk-hero .rk-me { margin-top: 34px; }
.rk-lvl { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 9px; background: linear-gradient(180deg, #f3d98b, #c9952b); color: #2a1a00; font-size: 12px; vertical-align: 1px; }
.rk-title { font-size: 12px; font-style: italic; color: rgba(255,255,255,.85); }
.rk-xpbar { position: relative; display: block; width: 100%; min-width: 120px; height: 6px; margin: 3px 0; border-radius: 6px; background: rgba(0,0,0,.25); overflow: hidden; }
.rk-xpbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, #e9c46a, #f4a261); transition: width .8s cubic-bezier(.2,.9,.3,1); }
.rk-xpbar.big { height: 12px; }
.rk-card .rk-xpbar, .rk-profile .rk-xpbar { background: #ece6d6; }
.rk-bonus { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; padding: 12px 16px; border-radius: 14px; color: #2a1a00; background: linear-gradient(100deg, #fff3cd, #ffe08a 60%, #f6c453); box-shadow: 0 6px 18px rgba(201,149,43,.25), inset 0 0 0 1px rgba(201,149,43,.4); animation: rk-pop .5s cubic-bezier(.3,1.6,.5,1); }
.rk-bonus > div { flex: 1; display: flex; flex-direction: column; }
.rk-bonus > div span { font-size: 13px; opacity: .85; }
.rk-bonus-gift { font-size: 34px; animation: rk-wiggle 2.4s ease-in-out infinite; }
@keyframes rk-wiggle { 0%,80%,100% { transform: none; } 85% { transform: rotate(-12deg) scale(1.1); } 90% { transform: rotate(10deg) scale(1.1); } 95% { transform: rotate(-6deg); } }
.rk-card-daily { background: linear-gradient(160deg, #fffaf0, #fff); }
.rk-card-daily::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, #f6c453, #f4a261); }
.rk-daily-top { margin: 4px 0; padding: 0; list-style: none; font-size: 13px; }
.rk-daily-top li { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed #eee4cc; }
.rk-daily-done { margin-top: auto; padding: 10px; border-radius: 10px; background: #eaf7ef; color: #146c43; font-weight: bold; text-align: center; }
.rk-live-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: #e03131; box-shadow: 0 0 0 0 rgba(224,49,49,.6); animation: rk-live 1.6s infinite; }
@keyframes rk-live { 70% { box-shadow: 0 0 0 8px rgba(224,49,49,0); } }
.rk-vs { margin: 0 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; }
.rk-live-turn { color: var(--accent2); }

.rk-prof-head { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 20px; }
.rk-lvl-ring { --p: 0; position: relative; flex: 0 0 auto; width: 96px; height: 96px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: conic-gradient(#e9c46a calc(var(--p) * 360deg), #ece6d6 0); }
.rk-lvl-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: radial-gradient(ellipse at 50% 30%, var(--felt1), var(--felt2)); box-shadow: inset 0 2px 8px rgba(0,0,0,.4); }
.rk-lvl-ring b, .rk-lvl-ring small { position: relative; color: #fff; }
.rk-lvl-ring b { font: bold 32px/1 Georgia, serif; color: #f3d98b; }
.rk-lvl-ring small { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; opacity: .85; }
.rk-prof-main { flex: 1 1 220px; }
.rk-prof-main h3 { margin-bottom: 6px; }
.rk-streak { display: flex; flex-direction: column; align-items: center; padding: 8px 16px; border-radius: 14px; background: #fff4e6; color: #9a3412; }
.rk-streak span { font-size: 26px; }
.rk-streak b { font: bold 26px/1 Georgia, serif; }
.rk-streak small { font-size: 11px; }
.rk-missions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.rk-mission { padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid #ece6d6; }
.rk-mission-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.rk-mission.done { background: #eaf7ef; border-color: #b7e4c7; }
.rk-mission.done .rk-xpbar i { background: linear-gradient(90deg, #2ec27e, #16a34a); }
.rk-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.rk-badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 12px 8px; border-radius: 14px; background: #f4f2ec; color: #8a8576; filter: grayscale(1); opacity: .6; transition: transform .2s; }
.rk-badge.on { filter: none; opacity: 1; color: var(--ink); background: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.rk-badge.on:hover { transform: translateY(-3px) rotate(-1deg); }
.rk-badge-ico { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; font-size: 26px; background: #e9e4d6; }
.rk-badge.on.t1 .rk-badge-ico { background: radial-gradient(circle at 35% 30%, #f3d2b0, #b87333); box-shadow: 0 0 0 3px #e7c39d; }
.rk-badge.on.t2 .rk-badge-ico { background: radial-gradient(circle at 35% 30%, #ffffff, #a9b4c2); box-shadow: 0 0 0 3px #dfe5ec; }
.rk-badge.on.t3 .rk-badge-ico { background: radial-gradient(circle at 35% 30%, #fff3c4, #d4a017); box-shadow: 0 0 0 3px #f3d98b, 0 0 16px rgba(212,160,23,.5); }
.rk-badge strong { font-size: 13px; }
.rk-badge small { font-size: 11px; line-height: 1.3; }

.rk-shop-intro { color: var(--muted); margin: 0 0 6px; }
.rk-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.rk-shop-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid #ece6d6; text-align: center; transition: transform .2s; }
.rk-shop-item:hover { transform: translateY(-3px); }
.rk-shop-item.on { box-shadow: 0 0 0 2px var(--accent2), 0 8px 20px rgba(201,149,43,.25); }
.rk-shop-item.locked { opacity: .65; }
.rk-swatch { width: 100%; height: 70px; border-radius: 10px; border: 7px solid transparent; background: radial-gradient(ellipse at 50% 30%, var(--felt1), var(--felt2)) padding-box, linear-gradient(180deg, #7a4b2a, #3f2413) border-box; box-shadow: inset 0 4px 12px rgba(0,0,0,.35); }
.rk-swatch-tiles { display: flex; justify-content: center; gap: 4px; padding: 10px 6px 12px; width: 100%; border-radius: 10px; background: radial-gradient(ellipse at 50% 30%, #1b7a4c, #093822); }
.rk-tile.mini { --w: 30px; cursor: default; }
.rk-equipped { color: #146c43; font-weight: bold; }
.rk-locked { color: var(--muted); font-weight: bold; font-size: 13px; }

/* ---------- in game additions ---------- */
.rk-btn-hint { background: linear-gradient(180deg, #fff3bf, #ffd43b); color: #5c3c00; }
.rk-btn-hint em { font-style: normal; display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: rgba(0,0,0,.12); }
.rk-tile.hint { animation: rk-hint 1.2s ease-in-out infinite; }
@keyframes rk-hint { 50% { transform: translateY(-7px); box-shadow: 0 0 0 3px #ffd43b, 0 0 22px 4px rgba(255,212,59,.75), 0 10px 14px rgba(0,0,0,.3); } }
.rk-emotebar { flex: 0 0 100%; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.rk-emote { min-width: 38px; height: 34px; padding: 0 8px; border: 0; border-radius: 17px; background: rgba(0,0,0,.25); color: #fff; font-size: 17px; font-weight: bold; cursor: pointer; transition: transform .15s, background .15s; }
.rk-emote:hover { transform: scale(1.18) rotate(-6deg); background: rgba(255,255,255,.2); }
.rk-bubble { position: absolute; z-index: 30; transform: translateX(-50%); padding: 6px 12px; border-radius: 16px; background: #fff; color: #1d2433; font-size: 22px; font-weight: bold; box-shadow: 0 8px 20px rgba(0,0,0,.35); pointer-events: none; animation: rk-bubble 2.8s ease forwards; }
.rk-bubble::before { content: ""; position: absolute; left: 50%; top: -6px; margin-left: -6px; border: 6px solid transparent; border-top: 0; border-bottom-color: #fff; }
@keyframes rk-bubble { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.4); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1.12); } 20% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -14px); } }
.rk-banner { position: absolute; left: 0; right: 0; top: 38%; z-index: 40; display: flex; justify-content: center; pointer-events: none; }
.rk-banner span { padding: 12px 34px; border-radius: 6px; color: #2a1a00; font: bold 26px/1.2 Georgia, "Times New Roman", serif; letter-spacing: 1px; text-align: center; background: linear-gradient(180deg, #fff3c4, #e9c46a 50%, #c9952b); box-shadow: 0 0 0 2px rgba(255,255,255,.5), 0 18px 40px rgba(0,0,0,.45); animation: rk-banner 2.3s cubic-bezier(.2,.9,.3,1) forwards; }
.rk-banner-joker span { background: linear-gradient(180deg, #ffd6dc, #ff8fa3 50%, #d6336c); color: #3b0014; }
.rk-banner-big span { background: linear-gradient(180deg, #d0ebff, #74c0fc 50%, #1c7ed6); color: #00264d; }
.rk-banner-win span { font-size: 44px; padding: 18px 50px; }
@keyframes rk-banner { 0% { opacity: 0; transform: scale(.3) rotate(-6deg); } 14% { opacity: 1; transform: scale(1.1) rotate(1deg); } 22% { transform: scale(1); } 78% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.06) translateY(-20px); } }
.rk-achieve-box { position: fixed; right: 16px; top: 16px; z-index: 100002; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.rk-achieve { display: flex; align-items: center; gap: 12px; min-width: 240px; max-width: 320px; padding: 12px 16px; border-radius: 14px; background: linear-gradient(135deg, #1f2937, #111827); color: #fff; box-shadow: 0 0 0 1px rgba(233,196,106,.6), 0 16px 34px rgba(0,0,0,.4); animation: rk-achieve-in .5s cubic-bezier(.3,1.5,.5,1); transition: opacity .5s, transform .5s; }
.rk-achieve.out { opacity: 0; transform: translateX(40px); }
.rk-achieve > div { display: flex; flex-direction: column; }
.rk-achieve strong { color: #f3d98b; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.rk-achieve-ico { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; font-size: 24px; background: radial-gradient(circle at 35% 30%, #fff3c4, #d4a017); box-shadow: 0 0 16px rgba(212,160,23,.6); }
@keyframes rk-achieve-in { from { opacity: 0; transform: translateX(80px) scale(.8); } }
.rk-coin { position: fixed; z-index: 100003; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3c4, #e0a800 60%, #9c6b00); box-shadow: 0 0 0 1px #b8860b; pointer-events: none; animation: rk-coin 1.1s cubic-bezier(.2,.8,.4,1) both; }
@keyframes rk-coin { 0% { transform: translate(0, 0) scale(.4); opacity: 1; } 60% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1) rotateY(540deg); opacity: 0; } }
.rk-gains { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 4px; }
.rk-gain { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.12); font-weight: bold; animation: rk-pop .5s cubic-bezier(.3,1.6,.5,1) both; }
.rk-gain:nth-child(2) { animation-delay: .15s; } .rk-gain:nth-child(3) { animation-delay: .3s; } .rk-gain:nth-child(4) { animation-delay: .45s; } .rk-gain:nth-child(5) { animation-delay: .6s; }
.rk-gain-xp { flex: 1 1 100%; justify-content: center; border-radius: 12px; }
.rk-gain-xp .rk-xpbar { max-width: 260px; background: rgba(0,0,0,.3); }
.rk-levelup { background: linear-gradient(90deg, #f3d98b, #c9952b); color: #2a1a00; }
.rk-gain-badge span { font-size: 20px; }
.rk-gain-badge { background: rgba(233,196,106,.22); box-shadow: inset 0 0 0 1px rgba(233,196,106,.6); }

@media (max-width: 700px) {
	.rk-real .rk-game, .rk-real .rk-hero, .rk-share.rk-real { border-width: 8px; }
	.rk-real .rk-game { padding: 6px; }
	.rk-hero .rk-me { margin-top: 0; }
	.rk-bonus { flex-wrap: wrap; }
	.rk-banner span { font-size: 19px; padding: 10px 18px; }
	.rk-banner-win span { font-size: 30px; }
	.rk-lvl-ring { width: 76px; height: 76px; }
	.rk-achieve-box { left: 12px; right: 12px; top: 10px; }
	.rk-achieve { max-width: none; }
}
.rk-tabs button { white-space: nowrap; }

/* ---------- rules, integrated in the lobby and in the game ---------- */
.rk-rules { font-size: 16px; line-height: 1.65; color: var(--ink); text-align: left; }
.rk-rules-card { padding: 22px 26px; }
.rk-rules-title { margin: 0 0 6px; font: bold 26px/1.2 Georgia, "Times New Roman", serif; color: var(--ink); border: 0; }
.rk-rule { padding: 14px 0; border-bottom: 1px solid #ece6d6; }
.rk-rule:last-child { border-bottom: 0; }
.rk-rule h3 { margin: 0 0 6px; font: bold 19px/1.3 Georgia, "Times New Roman", serif; color: var(--ink); border: 0; }
.rk-rule p { margin: 6px 0; color: inherit; font-size: inherit; }
.rk-rule ul { margin: 6px 0; padding-left: 22px; }
.rk-rule li { margin: 5px 0; }
.rk-rule-note { font-size: 15px; opacity: .8; font-style: italic; }
.rk-rule-ex { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 10px 0 14px; padding: 12px 14px; border-radius: 12px; background: radial-gradient(ellipse at 50% 30%, var(--felt1), var(--felt2)); width: max-content; max-width: 100%; }
.rk-tile.ex { --w: 40px; cursor: default; }
.rk-rule-eq { margin-left: 10px; color: #fff; font-weight: bold; font-size: 16px; }
.rk-rules kbd { display: inline-block; padding: 1px 7px; border-radius: 5px; background: #f1ede2; border: 1px solid #d8d0bb; font: bold 14px/1.4 inherit; }
.rk-rulesbox summary { font-size: 17px; }
.rk-rulesbox .rk-rules { max-width: 860px; margin: 6px auto 4px; color: #fff; }
.rk-rulesbox .rk-rule { border-color: rgba(255,255,255,.12); }
.rk-rulesbox .rk-rule h3 { color: #f3d98b; }
.rk-rulesbox .rk-rule-ex { background: rgba(0,0,0,.22); }
.rk-rulesbox kbd { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.3); }

/* ---------- larger, more readable text ---------- */
.rk-app { font-size: 16px; line-height: 1.45; }
.rk-mini { font-size: 14px; }
.rk-btn { font-size: 15px; padding: 10px 17px; }
.rk-btn-big { font-size: 17px; padding: 13px 24px; }
.rk-tabs button { font-size: 15px; padding: 11px 15px; }
.rk-card h3 { font-size: 21px; }
.rk-card p { font-size: 15.5px; }
.rk-card label { font-size: 13px; }
.rk-chip { font-size: 15px; }
.rk-input { font-size: 16px; }
.rk-row { font-size: 15.5px; }
.rk-h { font-size: 19px; }
.rk-facts { font-size: 14.5px; }
.rk-rank th { font-size: 13px; }
.rk-rank td { font-size: 15.5px; }
.rk-hero p { font-size: 17px; }
.rk-me strong { font-size: 17px; }
.rk-gtitle { font-size: 17px; }
.rk-pinfo strong { font-size: 16px; }
.rk-player .rk-mini { font-size: 13.5px; }
.rk-turnclock { font-size: 15px; }
.rk-pool { font-size: 16px; }
.rk-yourturn { font-size: 16px; }
.rk-waitturn { font-size: 16px; }
.rk-meld { height: 30px; width: 250px; }
.rk-meld span { font-size: 14px; line-height: 30px; }
.rk-setval { font-size: 12.5px; }
.rk-newset { font-size: 15px; }
.rk-board-empty { font-size: 16px; }
.rk-logbox summary { font-size: 16px; padding: 4px 0; }
.rk-log { font-size: 15px; max-height: 220px; }
.rk-log li { padding: 4px 0; }
.rk-toast { font-size: 16px; }
.rk-result-inline p { font-size: 16px; }
.rk-gain { font-size: 15.5px; }
.rk-badge strong { font-size: 14.5px; }
.rk-badge small { font-size: 13px; }
.rk-mission strong { font-size: 15.5px; }
.rk-shop-item strong { font-size: 15.5px; }
.rk-bonus strong { font-size: 17px; }
.rk-bonus > div span { font-size: 14.5px; }
.rk-daily-top { font-size: 15px; }
.rk-modal { font-size: 16px; }
.rk-tile { --w: clamp(34px, 4.3vw, 50px); }
.rk-real .rk-tile b { font-size: calc(var(--w) * .6); }
@media (max-width: 700px) {
	.rk-tile { --w: 38px; }
	.rk-rules { font-size: 15.5px; }
	.rk-rules-card { padding: 16px; }
	.rk-btn { font-size: 14.5px; padding: 9px 13px; }
	.rk-btn-big { font-size: 16px; }
}

/* 2.1: ranking pages, winners' dates */
.rk-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 12px 0 22px; text-align: center; }
.rk-pager .rk-btn[disabled] { opacity: .4; cursor: default; transform: none; }
.rk-pager-info { font-weight: bold; line-height: 1.35; }
.rk-recent .rk-row { gap: 10px; flex-wrap: wrap; }
.rk-recent .rk-when { white-space: nowrap; }
@media (max-width: 560px) { .rk-pager { gap: 8px; } .rk-pager .rk-btn { padding-left: 12px; padding-right: 12px; } }

/* 2.2: pause */
.rk-btn-pause { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); }
.rk-btn-pause em { font-style: normal; display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: rgba(0,0,0,.3); font-size: 13px; }
.rk-pause-row { width: 100%; margin: 4px 0 14px; position: relative; z-index: 5; }
.rk-pausebox { max-width: 520px; margin: 0 auto; padding: 22px 18px; border-radius: 16px; text-align: center; color: #fff; background: rgba(0,0,0,.4); box-shadow: 0 0 0 2px rgba(255,255,255,.16), 0 14px 30px rgba(0,0,0,.3); animation: rk-pop .4s cubic-bezier(.3,1.6,.5,1); }
.rk-pausebox h2 { margin: 2px 0 6px; color: #fff; border: 0; font: bold 28px/1.2 Georgia, "Times New Roman", serif; letter-spacing: 1px; }
.rk-pausebox p { margin: 0 0 10px; font-size: 17px; opacity: .9; }
.rk-pause-icon { font-size: 46px; line-height: 1; opacity: .9; }
.rk-pause-left { font-weight: bold; font-variant-numeric: tabular-nums; color: #ffe08a; }
.rk-paused .rk-board > *, .rk-paused .rk-rack .rk-tile { visibility: hidden; }
.rk-paused .rk-stage, .rk-paused .rk-rackwrap { pointer-events: none; opacity: .55; }
.rk-paused .rk-controls [data-act="submit"], .rk-paused .rk-controls [data-act="draw"], .rk-paused .rk-controls [data-act="reset"], .rk-paused .rk-controls [data-act="hint"], .rk-paused .rk-controls [data-act="sort"] { opacity: .4; pointer-events: none; }

/* 2.2.1: busy server notice */
.rk-net { position: sticky; top: 8px; z-index: 50; width: max-content; max-width: 92%; margin: 0 auto 8px; padding: 8px 16px; border-radius: 999px; background: rgba(0,0,0,.7); color: #ffe08a; font-weight: bold; font-size: 15px; box-shadow: 0 6px 16px rgba(0,0,0,.3); }
