/*!
 * EWR Spelling Game 2.0.0
 * Semua gaya dibatasi di dalam .ewr-sg supaya ga bentrok dengan tema.
 */

.ewr-sg {
	--sg-bg: #101215;
	--sg-card: #171a1e;
	--sg-card2: #1e2126;
	--sg-line: #2a2e35;
	--sg-line2: #3a3f47;
	--sg-ink: #f2efe8;
	--sg-ink2: #b4b7bd;
	--sg-dim: #8a8f96;
	--sg-accent: #c9a45c;
	--sg-accent-ink: #101215;
	--sg-ok: #93c48b;
	--sg-ok-bg: rgba(147, 196, 139, 0.12);
	--sg-bad: #e8957f;
	--sg-bad-bg: rgba(232, 149, 127, 0.12);
	--sg-warn-bg: rgba(201, 164, 92, 0.12);
	--sg-shade: rgba(8, 9, 11, 0.72);
	--sg-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
	--sg-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

	position: relative;
	box-sizing: border-box;
	max-width: 680px;
	margin: 24px auto;
	padding: 32px 28px;
	border-radius: 24px;
	background: var(--sg-bg);
	color: var(--sg-ink);
	font-family: var(--sg-sans);
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
	-webkit-font-smoothing: antialiased;
}

.ewr-sg[data-theme="light"] {
	--sg-bg: #fbfaf7;
	--sg-card: #ffffff;
	--sg-card2: #f2f0eb;
	--sg-line: #e3e0d8;
	--sg-line2: #cfcbc1;
	--sg-ink: #17181b;
	--sg-ink2: #44474d;
	--sg-dim: #63676e;
	--sg-accent: #8a6822;
	--sg-accent-ink: #ffffff;
	--sg-ok: #2e7337;
	--sg-ok-bg: rgba(46, 115, 55, 0.09);
	--sg-bad: #b0432c;
	--sg-bad-bg: rgba(176, 67, 44, 0.08);
	--sg-warn-bg: rgba(138, 104, 34, 0.09);
	--sg-shade: rgba(251, 250, 247, 0.8);
	border: 1px solid var(--sg-line);
}

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

.ewr-sg.ewr-sg p,
.ewr-sg.ewr-sg h2,
.ewr-sg.ewr-sg ol,
.ewr-sg.ewr-sg ul,
.ewr-sg.ewr-sg li,
.ewr-sg.ewr-sg em,
.ewr-sg.ewr-sg b,
.ewr-sg.ewr-sg span,
.ewr-sg.ewr-sg label,
.ewr-sg.ewr-sg details,
.ewr-sg.ewr-sg summary {
	margin: 0;
	padding: 0;
	border: 0;
	list-style: none;
	background: none;
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	font-style: inherit;
	line-height: inherit;
	color: inherit;
	letter-spacing: inherit;
	text-transform: none;
	text-decoration: none;
	text-align: inherit;
	box-shadow: none;
}

.ewr-sg.ewr-sg b {
	font-weight: 700;
}

.ewr-sg.ewr-sg [hidden] {
	display: none !important;
}

.ewr-sg.ewr-sg button,
.ewr-sg.ewr-sg a {
	all: unset;
	box-sizing: border-box;
	cursor: pointer;
	font-family: var(--sg-sans);
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

.ewr-sg.ewr-sg input {
	font-family: var(--sg-sans);
}

.ewr-sg.ewr-sg button:focus-visible,
.ewr-sg.ewr-sg a:focus-visible,
.ewr-sg.ewr-sg input:focus-visible,
.ewr-sg.ewr-sg summary:focus-visible {
	outline: 2px solid var(--sg-accent);
	outline-offset: 2px;
}

.ewr-sg.ewr-sg button[disabled] {
	cursor: default;
}

.ewr-sg.ewr-sg .ewr-sg__i {
	display: inline-flex;
	width: 1.1em;
	height: 1.1em;
	flex: none;
}

.ewr-sg.ewr-sg svg {
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ewr-sg.ewr-sg .ewr-sg__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.ewr-sg.ewr-sg .ewr-sg__screen {
	display: flex;
	flex-direction: column;
	gap: 20px;
	animation: ewr-sg-in 0.25s ease-out;
}

@keyframes ewr-sg-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}

/* ---------- teks umum ---------- */

.ewr-sg.ewr-sg .ewr-sg__eyebrow {
	font-size: 12px !important;
	font-weight: 700;
	letter-spacing: 0.14em !important;
	text-transform: uppercase !important;
	color: var(--sg-dim) !important;
}

.ewr-sg.ewr-sg .ewr-sg__title {
	font-family: var(--sg-serif) !important;
	font-weight: 400 !important;
	font-size: clamp(34px, 7vw, 48px) !important;
	line-height: 1.04 !important;
	color: var(--sg-ink) !important;
	margin-top: -8px !important;
}

.ewr-sg.ewr-sg .ewr-sg__title--win {
	color: var(--sg-accent) !important;
}

.ewr-sg.ewr-sg .ewr-sg__lead {
	font-size: 16px;
	color: var(--sg-ink2) !important;
}

.ewr-sg.ewr-sg .ewr-sg__note {
	font-size: 14px;
	color: var(--sg-dim) !important;
}

.ewr-sg.ewr-sg .ewr-sg__error {
	font-size: 14px;
	color: var(--sg-bad) !important;
}

.ewr-sg.ewr-sg .ewr-sg__error:empty,
.ewr-sg.ewr-sg .ewr-sg__note:empty {
	display: none;
}

.ewr-sg.ewr-sg .ewr-sg__meta {
	font-size: 13px;
	color: var(--sg-dim);
}

/* ---------- tombol ---------- */

.ewr-sg.ewr-sg .ewr-sg__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
}

.ewr-sg.ewr-sg .ewr-sg__actions--end,
.ewr-sg.ewr-sg .ewr-sg__actions--center {
	justify-content: center;
}

.ewr-sg.ewr-sg .ewr-sg__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 12px 20px;
	border-radius: 14px;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	transition: opacity 0.15s, transform 0.1s, background-color 0.15s;
}

.ewr-sg.ewr-sg .ewr-sg__btn:active {
	transform: translateY(1px);
}

.ewr-sg.ewr-sg .ewr-sg__btn--primary {
	background: var(--sg-accent);
	color: var(--sg-accent-ink);
	min-width: 140px;
}

.ewr-sg.ewr-sg .ewr-sg__btn--ghost {
	border: 1px solid var(--sg-line2);
	color: var(--sg-ink);
}

.ewr-sg.ewr-sg .ewr-sg__btn--quiet {
	color: var(--sg-dim);
	padding-left: 8px;
	padding-right: 8px;
}

.ewr-sg.ewr-sg .ewr-sg__btn--danger {
	background: var(--sg-bad);
	color: var(--sg-accent-ink);
}

.ewr-sg.ewr-sg .ewr-sg__btn[disabled] {
	opacity: 0.4;
}

.ewr-sg.ewr-sg [aria-busy="true"] {
	opacity: 0.6;
	pointer-events: none;
}

/* ---------- layar awal ---------- */

.ewr-sg.ewr-sg .ewr-sg__modes {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 4px;
	border-radius: 999px;
	background: var(--sg-card);
	border: 1px solid var(--sg-line);
	align-self: flex-start;
}

.ewr-sg.ewr-sg .ewr-sg__mode {
	display: inline-flex;
	align-items: center;
	min-height: 38px;
	padding: 8px 16px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	color: var(--sg-ink2);
}

.ewr-sg.ewr-sg .ewr-sg__mode.is-on {
	background: var(--sg-ink);
	color: var(--sg-bg);
}

.ewr-sg.ewr-sg .ewr-sg__levels {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ewr-sg.ewr-sg .ewr-sg__level {
	display: grid;
	grid-template-columns: 40px minmax(0, 1fr) auto;
	align-items: center;
	gap: 14px;
	width: 100%;
	padding: 16px 18px;
	border-radius: 18px;
	background: var(--sg-card);
	border: 1px solid var(--sg-line);
	transition: border-color 0.15s, transform 0.15s;
}

.ewr-sg.ewr-sg .ewr-sg__level:hover {
	border-color: var(--sg-line2);
	transform: translateY(-1px);
}

.ewr-sg.ewr-sg .ewr-sg__level-num {
	font-family: var(--sg-serif);
	font-size: 30px;
	line-height: 1;
	color: var(--sg-accent);
}

.ewr-sg.ewr-sg .ewr-sg__level-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.ewr-sg.ewr-sg .ewr-sg__level-name {
	font-size: 17px;
	font-weight: 700;
	color: var(--sg-ink);
}

.ewr-sg.ewr-sg .ewr-sg__level-desc {
	font-size: 14px;
	color: var(--sg-dim);
}

.ewr-sg.ewr-sg .ewr-sg__level-side {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
	text-align: right;
}

.ewr-sg.ewr-sg .ewr-sg__level-count {
	font-size: 12px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 999px;
	border: 1px solid var(--sg-line2);
	color: var(--sg-ink2);
	white-space: nowrap;
}

.ewr-sg.ewr-sg .ewr-sg__level-best {
	font-size: 12px;
	color: var(--sg-accent);
	white-space: nowrap;
}

.ewr-sg.ewr-sg .ewr-sg__rules {
	border-top: 1px solid var(--sg-line);
	padding-top: 14px;
	font-size: 14px;
	color: var(--sg-ink2);
}

.ewr-sg.ewr-sg .ewr-sg__rules summary {
	display: list-item;
	cursor: pointer;
	font-weight: 700;
	color: var(--sg-ink);
	list-style: disclosure-closed inside;
}

.ewr-sg.ewr-sg .ewr-sg__rules[open] summary {
	list-style-type: disclosure-open;
	margin-bottom: 8px;
}

.ewr-sg.ewr-sg .ewr-sg__rules ul {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ewr-sg.ewr-sg .ewr-sg__rules li {
	position: relative;
	padding-left: 16px;
}

.ewr-sg.ewr-sg .ewr-sg__rules li::before {
	content: "";
	position: absolute;
	left: 2px;
	top: 0.65em;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--sg-accent);
}

/* ---------- nyawa ---------- */

.ewr-sg.ewr-sg .ewr-sg__hp {
	display: inline-grid;
	grid-template-columns: repeat(var(--max, 5), minmax(0, 1fr));
	gap: 3px;
	width: 120px;
	height: 10px;
}

.ewr-sg.ewr-sg .ewr-sg__hp-seg {
	display: block;
	height: 100%;
	border-radius: 3px;
	background: var(--sg-line);
	transition: background-color 0.2s;
}

.ewr-sg.ewr-sg .ewr-sg__hp-seg.is-on {
	background: var(--sg-accent);
}

.ewr-sg.ewr-sg .ewr-sg__hp.is-low .ewr-sg__hp-seg.is-on {
	background: var(--sg-bad);
}

.ewr-sg.ewr-sg .ewr-sg__hp.is-hit {
	animation: ewr-sg-shake 0.4s ease;
}

/* ---------- layar main ---------- */

.ewr-sg.ewr-sg .ewr-sg__hud {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}

.ewr-sg.ewr-sg .ewr-sg__hud-life {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.ewr-sg.ewr-sg .ewr-sg__hud-label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--sg-dim);
}

.ewr-sg.ewr-sg .ewr-sg__points {
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--sg-card);
	border: 1px solid var(--sg-line);
	font-size: 14px;
	color: var(--sg-ink2);
}

.ewr-sg.ewr-sg .ewr-sg__points b {
	color: var(--sg-ink);
}

.ewr-sg.ewr-sg .ewr-sg__stop {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-left: auto;
	min-height: 38px;
	padding: 6px 14px;
	border-radius: 12px;
	border: 1px solid var(--sg-line2);
	font-size: 14px;
	font-weight: 700;
	color: var(--sg-ink);
}

.ewr-sg.ewr-sg .ewr-sg__versus {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: start;
	gap: 12px;
}

.ewr-sg.ewr-sg .ewr-sg__player {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.ewr-sg.ewr-sg .ewr-sg__player.is-opp {
	align-items: flex-end;
	text-align: right;
}

.ewr-sg.ewr-sg .ewr-sg__player .ewr-sg__hp {
	width: 100%;
	max-width: 160px;
}

.ewr-sg.ewr-sg .ewr-sg__player.is-opp .ewr-sg__hp {
	direction: rtl;
}

.ewr-sg.ewr-sg .ewr-sg__pname {
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 14px;
	font-weight: 700;
	color: var(--sg-ink);
}

.ewr-sg.ewr-sg .ewr-sg__pscore {
	font-size: 13px;
	color: var(--sg-ink2);
}

.ewr-sg.ewr-sg .ewr-sg__pscore b {
	color: var(--sg-ink);
}

.ewr-sg.ewr-sg .ewr-sg__pstatus {
	font-size: 12px;
	color: var(--sg-bad);
}

.ewr-sg.ewr-sg .ewr-sg__pstatus:empty {
	display: none;
}

.ewr-sg.ewr-sg .ewr-sg__timer {
	min-width: 72px;
	padding: 6px 12px;
	border-radius: 12px;
	background: var(--sg-card);
	border: 1px solid var(--sg-line);
	font-size: 20px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	text-align: center;
	color: var(--sg-ink);
}

.ewr-sg.ewr-sg .ewr-sg__timer.is-low {
	color: var(--sg-bad);
	border-color: var(--sg-bad);
}

.ewr-sg.ewr-sg .ewr-sg__card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
	padding: 26px 22px 20px;
	border-radius: 22px;
	background: var(--sg-card);
	border: 1px solid var(--sg-line);
	text-align: center;
}

.ewr-sg.ewr-sg .ewr-sg__card .ewr-sg__eyebrow {
	margin-bottom: -8px;
}

.ewr-sg.ewr-sg .ewr-sg__sentence {
	max-width: 30em;
	font-family: var(--sg-serif);
	font-size: 24px;
	line-height: 1.4;
	color: var(--sg-ink2) !important;
}

.ewr-sg.ewr-sg .ewr-sg__blank {
	display: inline-block;
	width: calc(var(--len, 5) * 0.55em + 0.6em);
	height: 0.9em;
	margin: 0 2px;
	border-bottom: 2px solid var(--sg-accent);
	vertical-align: baseline;
}

.ewr-sg.ewr-sg .ewr-sg__fill {
	font-weight: 400;
	color: var(--sg-accent);
	border-bottom: 2px solid var(--sg-accent);
}

.ewr-sg.ewr-sg .ewr-sg__boxes {
	--gap: 6px;
	display: flex;
	flex-wrap: nowrap;
	justify-content: center;
	gap: var(--gap);
	width: 100%;
}

.ewr-sg.ewr-sg .ewr-sg__box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 1 auto;
	width: calc((100% - (var(--n) - 1) * var(--gap)) / var(--n));
	max-width: 46px;
	min-width: 0;
	height: 54px;
	border-radius: 12px;
	border: 2px solid var(--sg-line2);
	background: transparent;
	color: var(--sg-ink);
	font-size: 24px;
	font-weight: 700;
	line-height: 1;
	text-align: center;
	transition: border-color 0.15s, background-color 0.15s;
}

.ewr-sg.ewr-sg .ewr-sg__box.is-shown {
	border-color: transparent;
	background: var(--sg-card2);
	color: var(--sg-ink2);
}

.ewr-sg.ewr-sg .ewr-sg__box.is-sep {
	border-color: transparent;
	color: var(--sg-dim);
	max-width: 18px;
}

.ewr-sg.ewr-sg .ewr-sg__box.is-empty {
	border-style: dashed;
}

.ewr-sg.ewr-sg .ewr-sg__box.is-active {
	border-style: solid;
	border-color: var(--sg-accent);
	background: var(--sg-warn-bg);
}

.ewr-sg.ewr-sg .ewr-sg__box.is-got {
	border-color: var(--sg-ok);
	background: var(--sg-ok-bg);
	color: var(--sg-ink);
}

.ewr-sg.ewr-sg .ewr-sg__box.is-revealed {
	border-color: var(--sg-bad);
	background: var(--sg-bad-bg);
	color: var(--sg-bad);
}

.ewr-sg.ewr-sg .ewr-sg__box.is-wrong {
	border-color: var(--sg-bad);
	animation: ewr-sg-shake 0.4s ease;
}

@keyframes ewr-sg-shake {
	0%, 100% { transform: none; }
	20% { transform: translateX(-4px); }
	40% { transform: translateX(4px); }
	60% { transform: translateX(-3px); }
	80% { transform: translateX(2px); }
}

.ewr-sg.ewr-sg .ewr-sg__live {
	min-height: 21px;
	font-size: 14px;
	color: var(--sg-dim) !important;
}

.ewr-sg.ewr-sg .ewr-sg__live.is-bad {
	color: var(--sg-bad) !important;
	font-weight: 600;
}

.ewr-sg.ewr-sg .ewr-sg__live.is-info {
	color: var(--sg-ink) !important;
	font-weight: 600;
}

.ewr-sg.ewr-sg .ewr-sg__pad {
	--cols: 9;
	--kgap: 6px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--kgap);
}

.ewr-sg.ewr-sg .ewr-sg__key {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 calc((100% - (var(--cols) - 1) * var(--kgap)) / var(--cols));
	height: 48px;
	border-radius: 12px;
	background: var(--sg-card2);
	border: 1px solid var(--sg-line2);
	box-shadow: 0 2px 0 var(--sg-line2);
	color: var(--sg-ink);
	font-size: 18px;
	font-weight: 700;
	transition: transform 0.08s, opacity 0.15s, background-color 0.15s;
	user-select: none;
}

.ewr-sg.ewr-sg .ewr-sg__key:active {
	transform: translateY(2px);
	box-shadow: none;
}

.ewr-sg.ewr-sg .ewr-sg__key.is-ok {
	background: var(--sg-ok-bg);
	border-color: var(--sg-ok);
}

.ewr-sg.ewr-sg .ewr-sg__key.is-tried {
	opacity: 0.25;
	box-shadow: none;
	text-decoration: line-through;
	cursor: default;
}

.ewr-sg.ewr-sg .ewr-sg__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.ewr-sg.ewr-sg .ewr-sg__foot .ewr-sg__meta,
.ewr-sg.ewr-sg .ewr-sg__foot .ewr-sg__btn--quiet {
	flex: 0 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ewr-sg.ewr-sg .ewr-sg__skip {
	flex: none;
	margin-left: auto;
	min-height: 42px;
	padding: 8px 14px;
	font-size: 14px;
}

.ewr-sg.ewr-sg .ewr-sg__cost {
	font-weight: 600;
	color: var(--sg-bad);
}

/* ---------- jawaban dan cara baca ---------- */

.ewr-sg.ewr-sg .ewr-sg__reveal {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 20px 18px;
	border-radius: 18px;
	background: var(--sg-card);
	border: 1px solid var(--sg-line);
	text-align: center;
	overflow: hidden;
	animation: ewr-sg-in 0.2s ease-out;
}

.ewr-sg.ewr-sg .ewr-sg__verdict {
	display: inline-flex;
	align-items: baseline;
	gap: 8px;
	font-size: 14px;
	color: var(--sg-dim) !important;
}

.ewr-sg.ewr-sg .ewr-sg__verdict b {
	font-size: 15px;
	color: var(--sg-ok);
}

.ewr-sg.ewr-sg .ewr-sg__reveal.is-skip .ewr-sg__verdict b,
.ewr-sg.ewr-sg .ewr-sg__reveal.is-ko .ewr-sg__verdict b {
	color: var(--sg-bad);
}

.ewr-sg.ewr-sg .ewr-sg__word {
	font-family: var(--sg-serif);
	font-size: 40px;
	line-height: 1.1;
	color: var(--sg-ink) !important;
}

.ewr-sg.ewr-sg .ewr-sg__pron {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: baseline;
	gap: 6px 14px;
	font-size: 16px;
}

.ewr-sg.ewr-sg .ewr-sg__ipa {
	color: var(--sg-ink2);
	font-family: "Charis SIL", "Doulos SIL", "Gentium Plus", "Lucida Sans Unicode", "Segoe UI", system-ui, sans-serif;
}

.ewr-sg.ewr-sg .ewr-sg__say {
	color: var(--sg-ink);
}

.ewr-sg.ewr-sg .ewr-sg__say-label {
	color: var(--sg-dim);
}

.ewr-sg.ewr-sg .ewr-sg__say b {
	letter-spacing: 0.03em;
	color: var(--sg-accent);
}

.ewr-sg.ewr-sg .ewr-sg__reveal .ewr-sg__actions {
	margin-top: 8px;
	justify-content: center;
}

.ewr-sg.ewr-sg .ewr-sg__auto {
	position: absolute;
	left: 0;
	bottom: 0;
	height: 3px;
	width: 100%;
	background: var(--sg-accent);
	transform-origin: left center;
	animation: ewr-sg-auto var(--ms, 2500ms) linear forwards;
}

@keyframes ewr-sg-auto {
	from { transform: scaleX(0); }
	to { transform: scaleX(1); }
}

/* ---------- lembar konfirmasi ---------- */

.ewr-sg.ewr-sg .ewr-sg__sheet {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	border-radius: inherit;
	background: var(--sg-shade);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	animation: ewr-sg-in 0.15s ease-out;
}

.ewr-sg.ewr-sg .ewr-sg__sheet-box {
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 100%;
	max-width: 400px;
	padding: 22px;
	border-radius: 18px;
	background: var(--sg-card);
	border: 1px solid var(--sg-line2);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.ewr-sg.ewr-sg .ewr-sg__sheet-title {
	font-family: var(--sg-serif);
	font-size: 28px;
	line-height: 1.1;
	color: var(--sg-ink) !important;
}

.ewr-sg.ewr-sg .ewr-sg__sheet-text {
	font-size: 15px;
	color: var(--sg-ink2) !important;
}

.ewr-sg.ewr-sg .ewr-sg__sheet .ewr-sg__actions {
	margin-top: 6px;
}

/* ---------- hasil ---------- */

.ewr-sg.ewr-sg .ewr-sg__score {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 26px 20px;
	border-radius: 22px;
	background: var(--sg-card);
	border: 1px solid var(--sg-line);
	text-align: center;
}

.ewr-sg.ewr-sg .ewr-sg__chip {
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--sg-warn-bg);
	color: var(--sg-accent);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ewr-sg.ewr-sg .ewr-sg__big {
	font-family: var(--sg-serif);
	font-size: 64px;
	line-height: 1;
	color: var(--sg-ink) !important;
}

.ewr-sg.ewr-sg .ewr-sg__big span {
	font-family: var(--sg-sans);
	font-size: 16px;
	color: var(--sg-dim);
}

.ewr-sg.ewr-sg .ewr-sg__stats {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 28px;
}

.ewr-sg.ewr-sg .ewr-sg__stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	font-size: 13px;
	color: var(--sg-dim);
}

.ewr-sg.ewr-sg .ewr-sg__stat b {
	font-size: 20px;
	color: var(--sg-ink);
}

.ewr-sg.ewr-sg .ewr-sg__vs-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.ewr-sg.ewr-sg .ewr-sg__vs-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 20px 14px;
	border-radius: 18px;
	background: var(--sg-card);
	border: 1px solid var(--sg-line);
	text-align: center;
	min-width: 0;
}

.ewr-sg.ewr-sg .ewr-sg__vs-card .ewr-sg__big {
	font-size: 48px;
}

.ewr-sg.ewr-sg .ewr-sg__review {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ewr-sg.ewr-sg .ewr-sg__words {
	display: flex;
	flex-direction: column;
	border-top: 1px solid var(--sg-line);
}

.ewr-sg.ewr-sg .ewr-sg__words li {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto;
	gap: 12px;
	align-items: baseline;
	padding: 12px 0;
	border-bottom: 1px solid var(--sg-line);
	font-size: 14px;
}

.ewr-sg.ewr-sg .ewr-sg__wl-word {
	font-family: var(--sg-serif);
	font-size: 24px;
	line-height: 1.15;
	color: var(--sg-ink);
	overflow-wrap: anywhere;
}

.ewr-sg.ewr-sg .ewr-sg__wl-pron {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 10px;
	color: var(--sg-ink2);
}

.ewr-sg.ewr-sg .ewr-sg__wl-pron b {
	color: var(--sg-accent);
	letter-spacing: 0.03em;
}

.ewr-sg.ewr-sg .ewr-sg__wl-tag {
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
	color: var(--sg-ink2);
}

.ewr-sg.ewr-sg .is-perfect .ewr-sg__wl-tag {
	color: var(--sg-ok);
}

.ewr-sg.ewr-sg .is-skip .ewr-sg__wl-tag,
.ewr-sg.ewr-sg .is-ko .ewr-sg__wl-tag {
	color: var(--sg-bad);
}

.ewr-sg.ewr-sg .is-open .ewr-sg__wl-tag {
	color: var(--sg-dim);
}

.ewr-sg.ewr-sg .ewr-sg__cta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	padding: 16px 18px;
	border-radius: 16px;
	border: 1px solid var(--sg-line);
	color: var(--sg-ink2);
	font-size: 15px;
}

/* ---------- lobi duel ---------- */

.ewr-sg.ewr-sg .ewr-sg__top {
	display: flex;
	align-items: center;
	margin-bottom: -6px;
}

.ewr-sg.ewr-sg .ewr-sg__exit {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 36px;
	padding: 6px 10px 6px 4px;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	color: var(--sg-ink2);
}

.ewr-sg.ewr-sg .ewr-sg__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 13px;
	font-weight: 700;
	color: var(--sg-ink2);
}

.ewr-sg.ewr-sg .ewr-sg__input {
	all: unset;
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	padding: 12px 16px;
	border-radius: 14px;
	background: var(--sg-card);
	border: 1px solid var(--sg-line2);
	color: var(--sg-ink);
	font-family: var(--sg-sans);
	font-size: 16px;
	font-weight: 600;
}

.ewr-sg.ewr-sg .ewr-sg__input:focus {
	border-color: var(--sg-accent);
}

.ewr-sg.ewr-sg .ewr-sg__input::placeholder {
	color: var(--sg-dim);
	font-weight: 400;
}

.ewr-sg.ewr-sg .ewr-sg__input--code {
	width: 140px;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	text-align: center;
}

.ewr-sg.ewr-sg .ewr-sg__options {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ewr-sg.ewr-sg .ewr-sg__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 14px;
	padding: 18px;
	border-radius: 18px;
	background: var(--sg-card);
	border: 1px solid var(--sg-line);
}

.ewr-sg.ewr-sg .ewr-sg__option-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1 1 240px;
	min-width: 0;
}

.ewr-sg.ewr-sg .ewr-sg__option-title {
	font-size: 16px;
	font-weight: 700;
	color: var(--sg-ink) !important;
}

.ewr-sg.ewr-sg .ewr-sg__option-desc {
	font-size: 14px;
	color: var(--sg-dim) !important;
}

.ewr-sg.ewr-sg .ewr-sg__code-row {
	display: flex;
	gap: 8px;
}

.ewr-sg.ewr-sg .ewr-sg__code-row .ewr-sg__btn {
	flex: none;
	min-width: 0;
}

/* ---------- menunggu dan hitung mundur ---------- */

.ewr-sg.ewr-sg .ewr-sg__room {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	padding: 26px 20px;
	border-radius: 22px;
	background: var(--sg-card);
	border: 1px solid var(--sg-line);
	text-align: center;
}

.ewr-sg.ewr-sg .ewr-sg__code {
	font-size: clamp(34px, 9vw, 52px);
	font-weight: 700;
	letter-spacing: 0.22em;
	line-height: 1;
	padding-left: 0.22em;
	color: var(--sg-accent) !important;
	font-variant-numeric: tabular-nums;
}

.ewr-sg.ewr-sg .ewr-sg__copied {
	min-height: 18px;
	font-size: 13px;
	color: var(--sg-ok);
}

.ewr-sg.ewr-sg .ewr-sg__wait {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 15px;
	font-weight: 600;
	color: var(--sg-ink2) !important;
	font-variant-numeric: tabular-nums;
}

.ewr-sg.ewr-sg .ewr-sg__dots {
	position: relative;
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--sg-accent);
	animation: ewr-sg-pulse 1.2s ease-in-out infinite;
}

@keyframes ewr-sg-pulse {
	0%, 100% { opacity: 0.25; transform: scale(0.8); }
	50% { opacity: 1; transform: scale(1); }
}

.ewr-sg.ewr-sg .ewr-sg__countdown {
	align-items: center;
	text-align: center;
}

.ewr-sg.ewr-sg .ewr-sg__vs {
	display: flex;
	align-items: baseline;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px 14px;
	font-size: 20px;
	font-weight: 700;
}

.ewr-sg.ewr-sg .ewr-sg__vs-x {
	font-family: var(--sg-serif);
	font-weight: 400;
	font-style: italic;
	color: var(--sg-dim);
}

.ewr-sg.ewr-sg .ewr-sg__count {
	font-family: var(--sg-serif);
	font-size: 110px;
	line-height: 1;
	color: var(--sg-accent) !important;
	font-variant-numeric: tabular-nums;
}

/* ---------- layar kecil ---------- */

@media (max-width: 520px) {
	.ewr-sg {
		padding: 22px 16px;
		border-radius: 18px;
		margin: 16px auto;
	}

	.ewr-sg.ewr-sg .ewr-sg__card {
		padding: 20px 12px 16px;
		gap: 16px;
	}

	.ewr-sg.ewr-sg .ewr-sg__sentence {
		font-size: 21px;
	}

	.ewr-sg.ewr-sg .ewr-sg__boxes {
		--gap: 4px;
	}

	.ewr-sg.ewr-sg .ewr-sg__box {
		height: 46px;
		border-radius: 10px;
		font-size: 20px;
	}

	.ewr-sg.ewr-sg .ewr-sg__pad {
		--cols: 7;
		--kgap: 5px;
	}

	.ewr-sg.ewr-sg .ewr-sg__hud {
		gap: 10px;
		flex-wrap: nowrap;
	}

	.ewr-sg.ewr-sg .ewr-sg__hud-label {
		display: none;
	}

	.ewr-sg.ewr-sg .ewr-sg__stop {
		padding: 6px 12px;
	}

	.ewr-sg.ewr-sg .ewr-sg__stats {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 8px;
		width: 100%;
	}

	.ewr-sg.ewr-sg .ewr-sg__key {
		height: 46px;
		font-size: 17px;
	}

	.ewr-sg.ewr-sg .ewr-sg__level {
		grid-template-columns: 30px minmax(0, 1fr);
		padding: 14px 16px;
		gap: 12px;
	}

	.ewr-sg.ewr-sg .ewr-sg__level-side {
		grid-column: 2;
		flex-direction: row;
		align-items: center;
		gap: 10px;
	}

	.ewr-sg.ewr-sg .ewr-sg__hp {
		width: 96px;
	}

	.ewr-sg.ewr-sg .ewr-sg__timer {
		min-width: 60px;
		padding: 5px 8px;
		font-size: 17px;
	}

	.ewr-sg.ewr-sg .ewr-sg__word {
		font-size: 34px;
	}

	.ewr-sg.ewr-sg .ewr-sg__actions {
		justify-content: stretch;
	}

	.ewr-sg.ewr-sg .ewr-sg__actions .ewr-sg__btn {
		flex: 1 1 auto;
	}

	.ewr-sg.ewr-sg .ewr-sg__words li {
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.ewr-sg.ewr-sg .ewr-sg__wl-pron {
		grid-column: 1 / -1;
		grid-row: 2;
	}

	.ewr-sg.ewr-sg .ewr-sg__vs-card .ewr-sg__big {
		font-size: 38px;
	}

	.ewr-sg.ewr-sg .ewr-sg__code-row {
		width: 100%;
	}

	.ewr-sg.ewr-sg .ewr-sg__input--code {
		flex: 1 1 auto;
		width: auto;
		min-width: 0;
		padding-left: 8px;
		padding-right: 8px;
		letter-spacing: 0.12em;
	}

	.ewr-sg.ewr-sg .ewr-sg__option > .ewr-sg__btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ewr-sg.ewr-sg .ewr-sg__screen,
	.ewr-sg.ewr-sg .ewr-sg__level,
	.ewr-sg.ewr-sg .ewr-sg__reveal,
	.ewr-sg.ewr-sg .ewr-sg__sheet,
	.ewr-sg.ewr-sg .ewr-sg__box,
	.ewr-sg.ewr-sg .ewr-sg__hp,
	.ewr-sg.ewr-sg .ewr-sg__dots {
		animation: none;
		transition: none;
	}

	.ewr-sg.ewr-sg .ewr-sg__auto {
		animation-name: none;
		transform: scaleX(1);
	}
}
