/* =====================================================================
   UNO Flip — Tema "Neon Arcade" dua sisi
   Sisi terang ☀️ = siang cerah, sisi gelap 🌙 = malam neon.
   Catatan: skrip game mengganti document.body.className setiap render
   ("side-light" atau "dark side-dark"), jadi class efek tambahan dipasang
   di <html>, bukan di <body>.
   ===================================================================== */

:root {
	--font-display: "Fredoka", "Nunito", system-ui, sans-serif;
	--font-body: "Nunito", system-ui, sans-serif;

	/* Sisi terang (default) */
	--bg: #eaf4ff;
	--fg: #1b2140;
	--muted: #5a6386;
	--panel: rgba(255, 255, 255, 0.66);
	--panel-strong: rgba(255, 255, 255, 0.88);
	--line: rgba(27, 33, 64, 0.12);
	--accent: #ff5b3a;
	--accent-2: #ffb703;
	--accent-ink: #fff;
	--glow: rgba(255, 91, 58, 0.45);
	--felt-1: #3fb6a8;
	--felt-2: #1d7f86;
	--shadow: 0 10px 30px rgba(27, 33, 64, 0.14), 0 2px 6px rgba(27, 33, 64, 0.08);
	--radius: 18px;
	color-scheme: light;
}

body.dark {
	--bg: #120b26;
	--fg: #f3eeff;
	--muted: #b3a7d8;
	--panel: rgba(28, 16, 58, 0.58);
	--panel-strong: rgba(36, 22, 74, 0.9);
	--line: rgba(255, 255, 255, 0.12);
	--accent: #ff3d9a;
	--accent-2: #8b5cff;
	--accent-ink: #fff;
	--glow: rgba(255, 61, 154, 0.55);
	--felt-1: #3a1f78;
	--felt-2: #170b3a;
	--shadow: 0 10px 34px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04);
	color-scheme: dark;
}

/* ---------- Dasar ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	font-family: var(--font-body);
	max-width: 980px;
	margin: 0 auto;
	padding: 0 1rem 3rem;
	background: var(--bg);
	color: var(--fg);
	transition: background-color 0.6s, color 0.6s;
	min-height: 100vh;
	-webkit-tap-highlight-color: transparent;
}

/* Dua lapis latar (terang & gelap) yang saling crossfade saat FLIP. */
body::before,
body::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -2;
	background-size: cover;
	background-position: center;
	transition: opacity 1s ease;
	pointer-events: none;
}
body::before {
	background-image: linear-gradient(180deg, rgba(234, 244, 255, 0.35), rgba(234, 244, 255, 0.75)), url("img/bg-light.jpg");
	opacity: 1;
}
body::after {
	background-image: radial-gradient(ellipse at 50% 0%, rgba(18, 11, 38, 0.2), rgba(18, 11, 38, 0.82) 70%), url("img/bg-dark.jpg");
	opacity: 0;
}
body.dark::before { opacity: 0; }
body.dark::after { opacity: 1; }

input,
button,
select { font: inherit; padding: 0.55rem 0.8rem; margin: 0.25rem 0; }

input,
select {
	border-radius: 12px;
	border: 2px solid var(--line);
	background: var(--panel-strong);
	color: var(--fg);
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus,
select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
input { width: 100%; }
input[type="number"] { width: 5em; }
input::placeholder { color: var(--muted); }

button {
	cursor: pointer;
	border-radius: 999px;
	border: 2px solid var(--line);
	background: var(--panel-strong);
	color: var(--fg);
	font-weight: 700;
	transition: transform 0.15s cubic-bezier(0.3, 1.6, 0.6, 1), box-shadow 0.2s, background 0.2s, border-color 0.2s;
	box-shadow: 0 2px 0 var(--line);
}
@media (hover: hover) {
	button:not(:disabled):hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 6px 16px var(--glow); }
}
button:not(:disabled):active { transform: translateY(1px) scale(0.97); }
button.primary {
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	background-size: 200% 200%;
	color: var(--accent-ink);
	border-color: transparent;
	font-weight: 800;
	letter-spacing: 0.02em;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
	box-shadow: 0 6px 18px var(--glow);
	animation: gradientShift 6s ease infinite;
}
button:disabled { opacity: 0.5; cursor: default; }

h1,
h2,
h3 { font-family: var(--font-display); letter-spacing: 0.01em; }
h1 { margin: 0; }
.row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.row input { flex: 1; text-transform: uppercase; letter-spacing: 0.25em; font-weight: 800; }
.muted { color: var(--muted); font-size: 0.9em; }
.panel {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 0.9rem 1rem;
	margin: 0.75rem 0;
	box-shadow: var(--shadow);
	backdrop-filter: blur(14px) saturate(1.3);
	-webkit-backdrop-filter: blur(14px) saturate(1.3);
	transition: background 0.6s, border-color 0.6s;
}
.panel > strong:first-child { font-family: var(--font-display); font-size: 1.05rem; }
#game { display: none; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

/* ---------- Header ---------- */

#topbar {
	position: relative;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.9rem 0 0.4rem;
}
#topbar .brand { display: flex; align-items: center; gap: 0.6rem; }
#topbar .brand img {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.7), 0 6px 18px var(--glow);
	animation: spinSlow 18s linear infinite;
}
#topbar h1 {
	font-size: 1.9rem;
	font-weight: 700;
	background: linear-gradient(90deg, #ff4b4b, #ffb703, #2ec27e, #2f7bff, #ff3d9a, #8b5cff, #ff4b4b);
	background-size: 300% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	animation: gradientShift 8s linear infinite;
	filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.12));
}
#topbar .tools { position: relative; display: flex; gap: 0.4rem; }
#soundBtn { width: 44px; height: 44px; padding: 0; font-size: 1.2rem; display: grid; place-items: center; }

#soundPanel {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	width: 250px;
	padding: 0.9rem 1rem;
	border-radius: 16px;
	background: var(--panel-strong);
	border: 1px solid var(--line);
	box-shadow: var(--shadow);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	opacity: 0;
	transform: translateY(-6px) scale(0.97);
	pointer-events: none;
	transition: opacity 0.2s, transform 0.2s;
}
#soundPanel.open { opacity: 1; transform: none; pointer-events: auto; }
#soundPanel label { display: block; font-size: 0.85rem; font-weight: 700; margin: 0.35rem 0 0.1rem; }
#soundPanel input[type="range"] { width: 100%; padding: 0; accent-color: var(--accent); border: 0; background: transparent; box-shadow: none; }
#soundPanel .note { font-size: 0.75rem; color: var(--muted); margin-top: 0.5rem; line-height: 1.35; }
#soundPanel button { width: 100%; margin-top: 0.5rem; }

/* ---------- Lobby ---------- */

#lobby { max-width: 460px; margin: 0 auto; text-align: center; animation: riseIn 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
#lobby .hero { position: relative; margin: 0.5rem auto 0.25rem; width: min(300px, 70vw); aspect-ratio: 1; }
#lobby .hero::before {
	content: "";
	position: absolute;
	inset: 6%;
	border-radius: 50%;
	background: conic-gradient(from 0deg, #ff4b4b, #ffb703, #2ec27e, #2f7bff, #ff3d9a, #00c2b8, #ff8a00, #8b5cff, #ff4b4b);
	filter: blur(28px);
	opacity: 0.75;
	animation: spinSlow 10s linear infinite;
}
#lobby .hero img {
	position: relative;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.85), 0 20px 50px rgba(0, 0, 0, 0.35);
	animation: floaty 5s ease-in-out infinite;
}
#lobby .tagline { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; margin: 0.9rem 0 0.2rem; }
#lobby .lobby-card { text-align: left; padding: 1.2rem; }
#lobby .lobby-card label { font-weight: 800; font-size: 0.9rem; display: block; }
#lobby #create { width: 100%; padding: 0.8rem; font-size: 1.05rem; margin-top: 0.6rem; }
#lobby .divider { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.8rem; font-weight: 700; margin: 0.8rem 0 0.3rem; text-transform: uppercase; letter-spacing: 0.15em; }
#lobby .divider::before,
#lobby .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#lobby .features { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0.6rem 0 0; }
#lobby .features li { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.75rem; font-size: 0.82rem; font-weight: 700; backdrop-filter: blur(10px); }

/* ---------- Room header ---------- */

/* ---------- Game Header & Room Chip ---------- */

#gameHeader {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	padding: 0.4rem 0.2rem 0.8rem;
}
.room-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	background: var(--panel-strong);
	border: 1.5px solid var(--line);
	border-radius: 999px;
	padding: 0.25rem 0.75rem;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.room-title {
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	color: var(--muted);
}
#roomCode {
	font-family: var(--font-display);
	font-weight: 800;
	letter-spacing: 0.18em;
	font-size: 1.05rem;
	color: var(--accent);
}
.room-chip button {
	padding: 0.2rem 0.6rem;
	font-size: 0.78rem;
	border-radius: 999px;
	margin: 0;
}
#statusHUD {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-family: var(--font-display);
	font-size: 0.95rem;
	font-weight: 700;
}
#status { font-weight: 700; }
#timer { font-weight: 800; transition: color 0.2s; }
#timer.urgent { color: #ff3b3b; display: inline-block; animation: heartbeat 0.5s ease-in-out infinite; }

/* =====================================================================
   ARENA MEJA UNO (Tabletop Arena)
   ===================================================================== */

#arena {
	position: relative;
	background:
		radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.12), transparent 70%),
		radial-gradient(ellipse at center, var(--felt-1), var(--felt-2));
	border: 4px solid rgba(255, 255, 255, 0.35);
	border-radius: 28px;
	padding: 1rem 0.8rem 1.4rem;
	box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.4), var(--shadow);
	margin-bottom: 1.2rem;
	overflow: hidden;
	transition: background 0.6s, border-color 0.6s;
}
/* Jahitan tepi meja kasino */
#arena::before {
	content: "";
	position: absolute;
	inset: 8px;
	border-radius: 20px;
	border: 2px dashed rgba(255, 255, 255, 0.2);
	pointer-events: none;
}

/* ---------- Banner Giliran di Arena ---------- */

#turnBanner {
	position: relative;
	z-index: 10;
	border-radius: 14px;
	padding: 0.65rem 1rem;
	margin: 0.2rem auto 0.8rem;
	max-width: 580px;
	text-align: center;
	background: var(--panel-strong);
	border: 2px solid var(--line);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	transition: background 0.4s, border-color 0.4s, transform 0.2s;
}
#turnBanner.mine {
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: #fff;
	border-color: rgba(255, 255, 255, 0.8);
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
	animation: gradientShift 4s ease infinite, bannerGlow 1.5s ease-in-out infinite;
	transform: scale(1.02);
}
#turnBanner .big { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; }
#turnBanner .recent { font-size: 0.86em; opacity: 0.9; margin-top: 0.2rem; }
#turnBanner button { margin: 0.45rem 0.35rem 0 0; }
#turnBanner.mine button:not(#unoBtn):not(.catch-btn) { background: #fff; color: #1b2140; border-color: transparent; font-weight: 800; }
#turnBanner:empty { display: none; }

.uno-call-notice {
	background: rgba(255, 235, 59, 0.2);
	border: 1.5px dashed #ffe14d;
	color: #fff;
	padding: 0.4rem 0.85rem;
	border-radius: 12px;
	font-weight: 800;
	font-size: 0.88rem;
	margin: 0.45rem auto 0.2rem;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
	animation: pulseNotice 1.8s ease-in-out infinite;
	max-width: 90%;
}
@keyframes pulseNotice {
	0%, 100% { opacity: 0.92; transform: scale(1); }
	50% { opacity: 1; transform: scale(1.02); }
}

#unoBtn {
	background: radial-gradient(circle at 35% 30%, #fff775, #ffb300 60%, #e65100) !important;
	color: #c4000f !important;
	font-family: var(--font-display);
	font-weight: 900;
	font-size: 1.15rem;
	letter-spacing: 0.05em;
	border: 3.5px solid #ffffff !important;
	text-shadow: 1px 1px 0 #fff !important;
	padding: 0.55rem 1.6rem;
	border-radius: 999px;
	box-shadow: 0 0 0 3px #c4000f, 0 10px 28px rgba(255, 179, 0, 0.9) !important;
	animation: wobble 0.9s ease-in-out infinite;
	cursor: pointer;
	margin-top: 0.4rem;
	display: inline-block;
	transition: transform 0.15s, box-shadow 0.15s;
}
#unoBtn:hover {
	transform: scale(1.08);
	box-shadow: 0 0 0 4px #c4000f, 0 12px 34px rgba(255, 179, 0, 1) !important;
}
#unoBtn:active {
	transform: scale(0.96);
}

.catch-btn {
	background: linear-gradient(135deg, #ff1744, #d50000) !important;
	color: #ffffff !important;
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 0.85rem;
	letter-spacing: 0.02em;
	padding: 0.4rem 0.95rem;
	border-radius: 999px;
	border: 2px solid #ffffff !important;
	box-shadow: 0 4px 14px rgba(213, 0, 0, 0.5), 0 0 16px rgba(255, 23, 68, 0.8) !important;
	cursor: pointer;
	animation: wobble 0.8s ease-in-out infinite;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
	transition: transform 0.15s, box-shadow 0.15s;
	margin-top: 0.35rem;
}
.catch-btn:hover {
	transform: scale(1.08) translateY(-2px);
	box-shadow: 0 6px 20px rgba(213, 0, 0, 0.7), 0 0 24px rgba(255, 23, 68, 1) !important;
}
.catch-btn:active {
	transform: scale(0.96);
}

/* ---------- Kursi Pemain Lawan (#players) ---------- */

#players {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 0.4rem 0 1rem;
	position: relative;
	z-index: 5;
}
.player-seat {
	display: flex;
	flex-direction: column;
	align-items: center;
	background: rgba(18, 11, 38, 0.45);
	border: 2px solid rgba(255, 255, 255, 0.25);
	border-radius: 18px;
	padding: 0.55rem 0.75rem;
	min-width: 130px;
	max-width: 175px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	color: #fff;
	transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.player-seat.turn {
	border-color: #ffe14d;
	box-shadow: 0 0 0 3px #ffe14d, 0 0 24px rgba(255, 225, 77, 0.65);
	transform: translateY(-4px) scale(1.04);
	animation: turnGlow 1.6s ease-in-out infinite;
	background: rgba(35, 20, 65, 0.75);
}
.player-seat.offline { opacity: 0.45; filter: grayscale(0.7); }
.player-seat.is-me { border-color: rgba(255, 255, 255, 0.45); }

/* Avatar Lingkaran */
.player-avatar {
	position: relative;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	display: grid;
	place-items: center;
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35), inset 0 2px 3px rgba(255, 255, 255, 0.4);
	border: 2.5px solid #fff;
}
.avatar-letter {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 1.25rem;
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.host-crown {
	position: absolute;
	top: -12px;
	right: -6px;
	font-size: 1.05rem;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
.player-meta {
	text-align: center;
	margin-top: 0.35rem;
	width: 100%;
}
.player-name {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 0.95rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.player-stat {
	font-size: 0.76rem;
	color: rgba(255, 255, 255, 0.8);
	font-weight: 600;
}

/* Kipas Kartu Belakang Lawan di UNO Flip (Warna dan Angka Terlihat Jelas!) */
.backs-fan {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 0.5rem;
	padding: 2px;
	max-width: 220px;
}
.backs-fan .card.mini {
	margin-left: -12px;
	transition: transform 0.2s cubic-bezier(0.2, 1.4, 0.4, 1), z-index 0.15s, box-shadow 0.2s;
	box-shadow: -2px 0 6px rgba(0, 0, 0, 0.45);
	cursor: pointer;
}
.backs-fan .card.mini:first-child { margin-left: 0; }
@media (hover: hover) {
	.backs-fan .card.mini:hover {
		transform: translateY(-10px) scale(1.35) rotate(-3deg);
		z-index: 10;
		box-shadow: 0 8px 18px rgba(0, 0, 0, 0.6), 0 0 0 2px #fff;
	}
}
.catch-btn {
	padding: 0.25rem 0.65rem;
	font-size: 0.78rem;
	margin-top: 0.4rem;
	background: #c4000f;
	color: #fff;
	border-color: transparent;
	animation: wobble 1.1s ease-in-out infinite;
}

/* ---------- Meja Tengah (#table) ---------- */

#table {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: clamp(1.2rem, 5vw, 3.5rem);
	padding: 1.8rem 1rem;
	background: rgba(0, 0, 0, 0.22);
	border-radius: 24px;
	border: 2px solid rgba(255, 255, 255, 0.2);
	margin: 0.8rem auto;
	max-width: 540px;
	box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.4);
	color: #fff;
}
#table .pile {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
}

/* Tumpukan Ambil (#drawPile) - Tumpukan 3D Kartu Tertutup */
#drawPile {
	cursor: default;
	position: relative;
	border-radius: 12px;
	transition: transform 0.2s;
}
#drawPile .card {
	box-shadow:
		1.5px 1.5px 0 #fff, 3px 3px 0 rgba(0, 0, 0, 0.3),
		4.5px 4.5px 0 #fff, 6px 6px 0 rgba(0, 0, 0, 0.3),
		7.5px 7.5px 0 #fff, 9px 9px 0 rgba(0, 0, 0, 0.35),
		0 12px 24px rgba(0, 0, 0, 0.45);
}
#drawPile.can {
	cursor: pointer;
	animation: pilePulse 1.3s ease-in-out infinite;
}
#drawPile.can::after {
	content: "AMBIL";
	position: absolute;
	bottom: -10px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--accent);
	color: #fff;
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 0.65rem;
	letter-spacing: 0.1em;
	padding: 0.1rem 0.55rem;
	border-radius: 999px;
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
	pointer-events: none;
}
#drawPile.can .card { transform: translateY(-4px) rotate(-3deg); }
@media (hover: hover) {
	#drawPile.can:hover .card { transform: translateY(-10px) rotate(-6deg) scale(1.06); }
}

/* Tumpukan Buang (#discard) */
#discard {
	position: relative;
}
#discard::before {
	content: "";
	position: absolute;
	inset: -16px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.45), transparent 65%);
	filter: blur(8px);
	z-index: -1;
}
#discard .card {
	transform: rotate(4deg);
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5), 0 16px 32px rgba(0, 0, 0, 0.5);
}

/* Kompas Arah & Warna Tengah */
#tableInfo {
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	font-weight: 700;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
#direction {
	font-size: 2.6rem;
	line-height: 1;
	width: 62px;
	height: 62px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	border: 2px solid rgba(255, 255, 255, 0.4);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
	animation: spinSlow 6s linear infinite;
}
#direction.dir-ccw { animation-direction: reverse; }
#sideLabel {
	font-size: 0.8rem;
	letter-spacing: 0.05em;
	opacity: 0.9;
}
#colorInfo {
	background: rgba(0, 0, 0, 0.35);
	padding: 0.25rem 0.75rem;
	border-radius: 999px;
	font-size: 0.85rem;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	border: 1px solid rgba(255, 255, 255, 0.2);
}
#colorDot {
	display: inline-block;
	width: 1.15em;
	height: 1.15em;
	border-radius: 50%;
	background: var(--c);
	border: 2px solid #fff;
	box-shadow: 0 0 12px var(--c);
	animation: dotGlow 1.6s ease-in-out infinite;
}

/* =====================================================================
   DESAIN KARTU UNO ASLI (Authentic UNO Cards)
   ===================================================================== */

.card {
	--c: #555;
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	width: 66px;
	height: 100px;
	padding: 4px 6px;
	border-radius: 12px;
	border: 3.5px solid #ffffff;
	background: var(--c);
	color: var(--c);
	font-family: var(--font-display);
	font-weight: 800;
	user-select: none;
	flex: none;
	text-align: center;
	line-height: 1;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.15);
	transition: transform 0.2s cubic-bezier(0.3, 1.5, 0.6, 1), box-shadow 0.2s, opacity 0.2s, filter 0.2s;
}

/* Kilau Kaca Mengkilap Khas Kartu Game */
.card::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 40%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.18) 100%);
	z-index: 5;
}

/* Oval Putih Miring di Tengah Khas Kartu UNO */
.card-inner {
	position: absolute;
	inset: 13% 8%;
	border-radius: 50%;
	background: #ffffff;
	transform: rotate(-28deg);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.18);
	z-index: 1;
}
.card.wild .card-inner {
	background: #141124;
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

/* Nilai Besar di Tengah (Italic Tebal Khas UNO) */
.center-val {
	font-size: 2rem;
	font-style: italic;
	font-weight: 900;
	color: var(--c);
	transform: rotate(28deg); /* Luruskan kembali teks dari kemiringan oval */
	text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.22), -1px -1px 0 rgba(255, 255, 255, 0.5);
	letter-spacing: -0.05em;
}
.card.wild .center-val {
	color: #ffffff;
	text-shadow: 0 0 14px var(--glow), 2px 2px 0 rgba(0, 0, 0, 0.5);
}

/* Nilai Sudut Kiri Atas & Kanan Bawah */
.corner {
	position: relative;
	z-index: 2;
	font-size: 0.72rem;
	font-weight: 900;
	color: #ffffff;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
	line-height: 1;
}
.corner.tl { align-self: flex-start; }
.corner.br { align-self: flex-end; transform: rotate(180deg); }

/* Kartu Besar (Tumpukan Buang) */
.card.big {
	width: 100px;
	height: 150px;
	padding: 6px 8px;
	border-width: 5px;
	border-radius: 16px;
}
.card.big .center-val { font-size: 3.2rem; }
.card.big .corner { font-size: 1rem; }

/* Kartu dengan Teks Panjang ("FLIP", "WILD", dll) */
.card.small .center-val { font-size: 1.15rem; }
.card.big.small .center-val { font-size: 1.75rem; }

/* Kartu Terbuka di Rekap Ronde (.card.revealed) */
.card.revealed {
	width: 44px;
	height: 66px;
	padding: 2px 3px;
	border-width: 2.5px;
	border-radius: 8px;
}
.card.revealed .center-val { font-size: 1.25rem; }
.card.revealed .corner { font-size: 0.55rem; }
.card.revealed.small .center-val { font-size: 0.75rem; }

/* Warna Kartu */
.c-red { --c: #e53935; } .c-yellow { --c: #f6b600; } .c-green { --c: #2eaa55; } .c-blue { --c: #2f6fe4; }
.c-pink { --c: #ff3d9a; } .c-teal { --c: #00b3a7; } .c-orange { --c: #ff7a00; } .c-purple { --c: #8a47d6; }
.side-light { --w1: #e53935; --w2: #f6b600; --w3: #2eaa55; --w4: #2f6fe4; }
.side-dark { --w1: #ff3d9a; --w2: #00b3a7; --w3: #ff7a00; --w4: #8a47d6; }

/* Kartu Wild (4 Warna) */
.card.wild {
	background: conic-gradient(var(--w1) 0 25%, var(--w2) 0 50%, var(--w3) 0 75%, var(--w4) 0);
	color: #ffffff;
}

/* ---------- Punggung Kartu / Kartu Tertutup (.card-back) ---------- */

.card.card-back {
	background: #141124;
	border-color: #ffffff;
	color: #ffffff;
	padding: 0;
	justify-content: center;
}
.card.card-back .card-inner,
.card.card-back .corner { display: none; }

.card-back-oval {
	width: 82%;
	height: 70%;
	border-radius: 50%;
	transform: rotate(-28deg);
	background: linear-gradient(135deg, #e53935, #ff9800);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 0 0 2.5px #ffffff, 0 3px 6px rgba(0, 0, 0, 0.45);
}
.side-dark .card-back-oval,
.card-back.side-dark .card-back-oval {
	background: linear-gradient(135deg, #ff3d9a, #8a47d6);
}
.card-back-logo {
	font-family: var(--font-display);
	font-weight: 900;
	font-style: italic;
	font-size: 1.15rem;
	color: #ffe14d;
	text-shadow: 1px 1px 0 #c4000f, 2px 2px 0 rgba(0, 0, 0, 0.5);
	letter-spacing: -0.04em;
	transform: rotate(28deg);
}

/* Mini Card untuk Sisi Belakang Kartu Lawan di UNO Flip (Tampilkan Warna & Angka Jelas!) */
.card.mini {
	width: 34px;
	height: 50px;
	padding: 2px;
	border-radius: 7px;
	border: 2px solid #ffffff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	user-select: none;
}
.card.mini .card-inner {
	position: absolute;
	inset: 8% 6%;
	border-radius: 50%;
	background: #ffffff;
	transform: rotate(-28deg);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: inset 0 -1.5px 3px rgba(0, 0, 0, 0.15);
	z-index: 1;
}
.card.mini.wild .card-inner {
	background: #141124;
}
.card.mini .center-val {
	font-size: 1.05rem;
	font-style: italic;
	font-weight: 900;
	color: var(--c);
	transform: rotate(28deg);
	letter-spacing: -0.05em;
	text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
	line-height: 1;
}
.card.mini.wild .center-val {
	color: #ffffff;
	text-shadow: 0 0 8px var(--glow);
}
.card.mini.small .center-val {
	font-size: 0.65rem;
}

.card.mini.card-back {
	padding: 0;
}
.card.mini.card-back .card-back-oval {
	width: 85%;
	height: 74%;
	box-shadow: 0 0 0 1px #fff;
}
.card.mini.card-back .card-back-logo {
	font-size: 0.65rem;
	text-shadow: none;
}

/* ---------- Tangan Pemain Sendiri (#me) ---------- */

#me {
	position: relative;
	background: rgba(18, 11, 38, 0.4);
	border: 2px solid rgba(255, 255, 255, 0.2);
	border-radius: 20px;
	padding: 0.65rem 0.8rem 0.4rem;
	margin-top: 0.8rem;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.hand-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	flex-wrap: wrap;
	padding: 0 0.4rem;
}
#handTitle {
	font-family: var(--font-display);
	font-size: 1.15rem;
	color: #fff;
}
#hint {
	font-size: 0.84rem;
	color: rgba(255, 255, 255, 0.82);
}

/* Kipas Kartu di Tangan */
#hand {
	display: flex;
	justify-content: center;
	align-items: flex-end;
	flex-wrap: nowrap;
	overflow-x: auto;
	overflow-y: visible;
	padding: 1.4rem 0.5rem 0.8rem;
	min-height: 125px;
	perspective: 1000px;
}
#hand .card {
	margin-left: -20px;
	cursor: default;
	opacity: 0.5;
	filter: saturate(0.65);
	transition: transform 0.22s cubic-bezier(0.2, 1.4, 0.4, 1), box-shadow 0.2s, z-index 0.2s, opacity 0.2s, filter 0.2s;
	flex-shrink: 0;
}
#hand .card:first-child { margin-left: 0; }
#hand .card.playable {
	cursor: pointer;
	opacity: 1;
	filter: none;
	transform: translateY(-14px);
	box-shadow: 0 0 0 3px #ffffff, 0 0 20px var(--c), 0 12px 22px rgba(0, 0, 0, 0.4);
	z-index: 1;
	animation: playableBob 2.2s ease-in-out infinite;
}
#hand .card.playable.wild {
	box-shadow: 0 0 0 3px #ffffff, 0 0 22px var(--glow), 0 12px 22px rgba(0, 0, 0, 0.4);
}
@media (hover: hover) {
	#hand .card.playable:hover {
		transform: translateY(-30px) scale(1.15) rotate(-2deg);
		box-shadow: 0 0 0 4px #ffffff, 0 0 32px var(--c), 0 18px 30px rgba(0, 0, 0, 0.5);
		z-index: 10;
		animation: none;
	}
}
#hand .card.playable:active { transform: translateY(-8px) scale(0.98); }
#hand .card.drawn { outline: 3.5px dashed #ffe14d; outline-offset: 3px; }
#hand.waiting .card { opacity: 0.9; filter: none; transform: none; animation: none; }

/* =====================================================================
   DOCK BAWAH UNTUK CHAT, KEJADIAN & ATURAN (#gameDock)
   ===================================================================== */

#gameDock {
	border-radius: 20px;
	padding: 0.6rem 0.8rem;
	margin-top: 1rem;
	background: var(--panel);
	border: 1px solid var(--line);
	box-shadow: var(--shadow);
}
.dock-nav {
	display: flex;
	gap: 0.4rem;
	border-bottom: 1px solid var(--line);
	padding-bottom: 0.4rem;
	margin-bottom: 0.6rem;
}
.dock-tab {
	background: transparent;
	border: none;
	border-radius: 999px;
	padding: 0.35rem 0.85rem;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--muted);
	box-shadow: none;
}
.dock-tab.active {
	background: var(--panel-strong);
	color: var(--fg);
	border: 1.5px solid var(--line);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.dock-pane { display: none; }
.dock-pane.active { display: block; animation: fadeIn 0.25s ease both; }

.rules-list dt { font-weight: 800; font-family: var(--font-display); margin-top: 0.6rem; color: var(--fg); }
.rules-list dd { margin: 0.15rem 0 0 1rem; color: var(--muted); font-size: 0.92rem; }

/* Box Khusus Aturan Kartu Terakhir */
.uno-rule-box {
	background: linear-gradient(135deg, rgba(255, 61, 154, 0.14), rgba(255, 183, 3, 0.14));
	border: 2px solid var(--accent);
	border-radius: 18px;
	padding: 1.1rem 1.25rem;
	margin-bottom: 1.2rem;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
.uno-rule-header {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	flex-wrap: wrap;
	margin-bottom: 0.6rem;
}
.uno-rule-badge {
	background: #ff1744;
	color: #fff;
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 0.74rem;
	letter-spacing: 0.06em;
	padding: 0.25rem 0.7rem;
	border-radius: 999px;
	box-shadow: 0 2px 8px rgba(255, 23, 68, 0.4);
}
.uno-rule-header h4 {
	margin: 0;
	font-family: var(--font-display);
	font-size: 1.2rem;
	color: var(--fg);
}
.uno-rule-box p {
	margin: 0.35rem 0 0.65rem;
	font-size: 0.94rem;
	line-height: 1.55;
	color: var(--fg);
}
.uno-rule-box ul {
	margin: 0;
	padding-left: 1.25rem;
	font-size: 0.9rem;
	color: var(--muted);
	line-height: 1.55;
}
.uno-rule-box li {
	margin-bottom: 0.35rem;
}

/* =====================================================================
   PILIH WARNA KARTU WILD (Modal Terpusat di Tengah Layar)
   ===================================================================== */

#colorPicker {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: none; /* diubah jadi 'flex' oleh JavaScript saat pendingWild aktif */
	align-items: center;
	justify-content: center;
	background: rgba(8, 4, 20, 0.78);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	animation: fadeIn 0.22s ease-out;
	padding: 1rem;
}

#colorPicker .box {
	position: relative;
	width: min(390px, 92vw);
	background: radial-gradient(ellipse at 50% 0%, var(--panel-strong), var(--panel));
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-radius: 28px;
	padding: 1.8rem 1.4rem 1.4rem;
	text-align: center;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65), 0 0 40px var(--glow);
	animation: popIn 0.3s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.wild-emblem {
	font-size: 2.4rem;
	margin-bottom: 0.2rem;
	animation: wobble 1.6s ease-in-out infinite;
}

#colorPicker .box strong {
	display: block;
	font-family: var(--font-display);
	font-size: 1.35rem;
	font-weight: 800;
	color: #fff;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
	letter-spacing: 0.04em;
	margin-bottom: 0.3rem;
}

.wild-sub {
	font-size: 0.88rem;
	color: var(--muted);
	margin: 0 0 1.2rem;
	line-height: 1.4;
}

#colorButtons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
	margin: 1.2rem auto 1.5rem;
	max-width: 290px;
}

#colorButtons button {
	background: var(--c);
	aspect-ratio: 1.25;
	border-radius: 18px;
	border: 3.5px solid #ffffff;
	font-family: var(--font-display);
	font-size: 1.15rem;
	font-weight: 800;
	text-transform: capitalize;
	color: #ffffff;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
	cursor: pointer;
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
	transition: transform 0.16s cubic-bezier(0.2, 1.4, 0.4, 1), box-shadow 0.16s, filter 0.16s;
}

@media (hover: hover) {
	#colorButtons button:hover {
		transform: scale(1.08) translateY(-4px);
		box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45), 0 0 24px var(--c);
		filter: brightness(1.08);
	}
}

#colorButtons button:active {
	transform: scale(0.95);
}

#cancelWild {
	background: transparent;
	color: var(--muted);
	border: 1.5px solid var(--line);
	border-radius: 999px;
	padding: 0.55rem 1.8rem;
	font-weight: 700;
	font-size: 0.92rem;
	cursor: pointer;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

@media (hover: hover) {
	#cancelWild:hover {
		background: rgba(255, 255, 255, 0.15);
		color: #fff;
		border-color: rgba(255, 255, 255, 0.4);
	}
}


/* =====================================================================
   Lapisan efek (dibuat oleh assets/fx.js)
   ===================================================================== */

#fxLayer { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
#fxConfetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 55; }
.fx-ghost { position: fixed; margin: 0; z-index: 51; will-change: transform; pointer-events: none; }
.fx-hidden { visibility: hidden !important; }

.fx-burst {
	position: fixed;
	left: 50%;
	top: 42%;
	transform: translate(-50%, -50%);
	font-family: var(--font-display);
	font-weight: 700;
	font-size: clamp(2.4rem, 9vw, 5rem);
	color: #fff;
	white-space: nowrap;
	text-align: center;
	line-height: 1.05;
	text-shadow: 0 4px 0 rgba(0, 0, 0, 0.25), 0 0 30px var(--burst-glow, rgba(255, 91, 58, 0.9));
	-webkit-text-stroke: 2px rgba(0, 0, 0, 0.25);
	animation: burst 1.6s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.fx-burst small { display: block; font-size: 0.38em; -webkit-text-stroke: 0; letter-spacing: 0.04em; margin-top: 0.2em; }
.fx-burst.uno { color: #ffe14d; --burst-glow: #ff2b2b; -webkit-text-stroke: 3px #c4000f; font-size: clamp(3rem, 14vw, 7rem); }
.fx-burst.alert { color: #fff; --burst-glow: #ff2b2b; }
.fx-burst.win { color: #ffe14d; --burst-glow: #ffb300; }
.fx-burst.soft { font-size: clamp(1.8rem, 6vw, 3rem); }

.fx-float {
	position: fixed;
	transform: translate(-50%, -50%);
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 2rem;
	color: #fff;
	text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 0 16px #ff2b2b;
	animation: floatUp 1.3s ease-out both;
}
.fx-float.ok { font-size: 1rem; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 12px var(--glow); }
.fx-float.stamp { font-size: 3rem; text-shadow: 0 0 18px var(--glow); animation: stamp 1.1s cubic-bezier(0.2, 1.4, 0.4, 1) both; }

.fx-ring { position: fixed; border-radius: 50%; border: 4px solid var(--ring, #fff); transform: translate(-50%, -50%); animation: ring 0.7s ease-out both; }

.fx-vignette { position: fixed; inset: 0; box-shadow: inset 0 0 120px 30px rgba(255, 0, 40, 0.55); animation: fadeOut 0.9s ease-out both; }

/* Transisi FLIP layar penuh */
.fx-flip { position: fixed; inset: 0; display: grid; place-items: center; perspective: 1200px; background: rgba(5, 2, 15, 0.35); animation: fadeOut 1.9s ease-in both; }
.fx-flip .flipcard { width: min(220px, 45vw); aspect-ratio: 2 / 3; position: relative; transform-style: preserve-3d; animation: bigFlip 1.5s cubic-bezier(0.5, 0, 0.3, 1) both; }
.fx-flip .face { position: absolute; inset: 0; border-radius: 22px; border: 8px solid #fff; backface-visibility: hidden; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 3rem; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.3); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.fx-flip .face.light { background: conic-gradient(#e53935 0 25%, #f6b600 0 50%, #2eaa55 0 75%, #2f6fe4 0); }
.fx-flip .face.dark { background: conic-gradient(#ff3d9a 0 25%, #00b3a7 0 50%, #ff7a00 0 75%, #8a47d6 0); transform: rotateY(180deg); }
.fx-flip .face span { background: rgba(10, 6, 26, 0.85); border-radius: 50%; padding: 1.6rem 1rem; transform: rotate(-20deg); }
.fx-flip .caption { position: absolute; bottom: 14%; left: 0; right: 0; text-align: center; font-family: var(--font-display); font-size: clamp(1.4rem, 5vw, 2.2rem); color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7); animation: riseIn 0.6s 0.6s both; }

/* Kelas efek pada elemen yang sudah ada */
.fx-shake { animation: shake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important; }
.fx-spin { animation: spinOnce 0.8s cubic-bezier(0.3, 1.4, 0.5, 1) both !important; }
.fx-pop { animation: popIn 0.45s cubic-bezier(0.2, 1.5, 0.4, 1) both !important; }
html.fx-flipping .card:not(.mini) { animation: cardFlipIn 0.7s cubic-bezier(0.3, 1.3, 0.5, 1) both !important; }
html.fx-flipping .card.mini { animation: cardFlipIn 0.5s ease both !important; }

/* ---------- Keyframes ---------- */

@keyframes gradientShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes spinOnce { from { transform: rotate(0) scale(1.3); } to { transform: rotate(-360deg) scale(1); } }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -20px) scale(0.9); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes pilePulse { 0%, 100% { filter: drop-shadow(0 0 0 transparent); } 50% { filter: drop-shadow(0 0 14px #fff); } }
@keyframes playableBob { 0%, 100% { transform: translateY(-8px); } 50% { transform: translateY(-12px); } }
@keyframes turnGlow { 0%, 100% { box-shadow: 0 0 0 3px var(--glow), 0 10px 28px var(--glow); } 50% { box-shadow: 0 0 0 5px var(--glow), 0 10px 40px var(--glow); } }
@keyframes bannerGlow { 0%, 100% { box-shadow: 0 6px 20px var(--glow); } 50% { box-shadow: 0 6px 34px var(--glow), 0 0 0 4px rgba(255, 255, 255, 0.35); } }
@keyframes dotGlow { 50% { box-shadow: 0 0 22px var(--c); } }
@keyframes wobble { 0%, 100% { transform: rotate(-3deg) scale(1); } 50% { transform: rotate(3deg) scale(1.06); } }
@keyframes heartbeat { 50% { transform: scale(1.18); } }
@keyframes burst {
	0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2) rotate(-12deg); }
	18% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(3deg); }
	28% { transform: translate(-50%, -50%) scale(1) rotate(0); }
	78% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
	100% { opacity: 0; transform: translate(-50%, -60%) scale(0.9); }
}
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }
@keyframes stamp { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.4) rotate(-25deg); } 30% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-12deg); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1) rotate(-12deg); } }
@keyframes ring { from { width: 20px; height: 20px; opacity: 1; } to { width: 220px; height: 220px; opacity: 0; } }
@keyframes shake {
	10%, 90% { transform: translate3d(-2px, 0, 0); }
	20%, 80% { transform: translate3d(4px, 0, 0); }
	30%, 50%, 70% { transform: translate3d(-7px, 0, 0) rotate(-1deg); }
	40%, 60% { transform: translate3d(7px, 0, 0) rotate(1deg); }
}
@keyframes bigFlip {
	0% { transform: scale(0.3) rotateY(0) rotateZ(-20deg); opacity: 0; }
	20% { transform: scale(1) rotateY(0) rotateZ(-6deg); opacity: 1; }
	70% { transform: scale(1.1) rotateY(180deg) rotateZ(4deg); }
	100% { transform: scale(1) rotateY(180deg) rotateZ(0); }
}
@keyframes cardFlipIn { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }

/* ---------- Responsif & aksesibilitas ---------- */

@media (max-width: 560px) {
	body { padding: 0 0.6rem 2rem; }
	#topbar h1 { font-size: 1.5rem; }
	#topbar .brand img { width: 38px; height: 38px; }
	.card { width: 50px; height: 75px; font-size: 1.1rem; }
	.card.big { width: 80px; height: 120px; font-size: 1.7rem; }
	#direction { width: 52px; height: 52px; font-size: 2rem; }
	#players { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
