/* SRAM 速聯森浪祭 抽獎看板 */
:root {
	--wood-dark: #5b2d12;
	--wood: #8a4a1f;
	--wood-light: #b8692c;
	--cream: #fff6dc;
	--cream-2: #fbe9bd;
	--leaf: #3f7d22;
	--leaf-light: #8cc63f;
	--orange: #ee7a1c;
	--ink: #3a2412;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; overflow-x: hidden; overflow-x: clip; max-width: 100%; }

body.sram-board {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	color: var(--ink);
	font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", "Heiti TC", sans-serif;
	background: #cfe6e4 var(--sram-bg) center top / cover fixed no-repeat;
	overflow-x: hidden;
	position: relative;
}

/* 兩側樹木與樹冠，固定在畫面上當外框 */
.sram-trees {
	position: fixed;
	inset: 0;
	background: var(--sram-trees) center top / 100% auto no-repeat;
	pointer-events: none;
	z-index: 0;
	opacity: .95;
}

/* 透明光點遮罩：在背景／樹之上、標題與表格之下 */
.sram-light {
	position: fixed;
	inset: 0;
	background: var(--sram-light) center / cover no-repeat;
	mix-blend-mode: screen; /* 圖檔以黑底設計：黑色變透明、亮部發光（同 PS「濾色」） */
	pointer-events: none;
	z-index: 1;
}

/* ---------- 頂部標題 ---------- */
.sram-header {
	position: relative;
	z-index: 2;
	text-align: center;
	padding-top: clamp(24px, 6vw, 96px);
}

.sram-bunting-wrap {
	position: absolute;
	inset: 0 0 auto 0;
	height: 100%;
	overflow: hidden;
	pointer-events: none;
	z-index: -1;
}

.sram-bunting {
	position: absolute;
	top: clamp(-60px, -3vw, 0px);
	left: 50%;
	width: max(100%, min(120vw, 2200px));
	transform: translateX(-50%);
	pointer-events: none;
	z-index: -1;
}

.sram-title {
	margin: 0 auto;
	width: min(72vw, 820px);
	line-height: 0;
}

.sram-title img {
	width: 100%;
	height: auto;
	filter: drop-shadow(0 8px 14px rgba(40, 20, 0, .35));
	animation: sram-sway 6s ease-in-out infinite;
	transform-origin: 50% 0;
}

@keyframes sram-sway {
	0%, 100% { transform: rotate(-.6deg); }
	50% { transform: rotate(.6deg); }
}

/* ---------- 中間表格（隨內容無限延長） ---------- */
.sram-main {
	position: relative;
	z-index: 2;
	flex: 1 0 auto;
	width: min(92vw, 1180px);
	margin: clamp(12px, 2vw, 32px) auto clamp(24px, 3vw, 48px);
}

.sram-table-wrap {
	background: var(--wood);
	border: 6px solid var(--wood-dark);
	border-radius: 22px;
	padding: 10px;
	box-shadow:
		0 0 0 4px var(--leaf-light),
		0 18px 40px rgba(40, 20, 0, .35);
	animation: sram-in .5s ease-out;
}

.sram-table-wrap[hidden] { display: none; }

@keyframes sram-in {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: none; }
}

.sram-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	background: var(--cream);
	border-radius: 14px;
	overflow: hidden;
	table-layout: fixed;
	font-size: clamp(16px, 1.45vw, 26px);
}

.sram-table thead th {
	background: linear-gradient(180deg, var(--leaf) 0%, #2f6418 100%);
	color: #fff7d6;
	font-size: 1.15em;
	font-weight: 900;
	letter-spacing: .2em;
	padding: .7em 1em;
	text-align: left;
	text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
	position: sticky;
	top: 0;
	z-index: 1;
}

.sram-table th.col-item,
.sram-table td.col-item { width: 46%; }

.sram-table th + th,
.sram-table td + td { border-left: 3px dashed rgba(138, 74, 31, .35); }

.sram-table tbody tr:nth-child(even) td { background: var(--cream-2); }

.sram-table td {
	padding: .65em 1em;
	vertical-align: middle;
	border-top: 2px solid rgba(138, 74, 31, .18);
}

.sram-item {
	display: flex;
	align-items: center;
	gap: .6em;
	font-weight: 700;
}

.sram-no {
	flex: none;
	display: inline-grid;
	place-items: center;
	min-width: 2em;
	height: 2em;
	padding: 0 .4em;
	border-radius: 1em;
	background: var(--orange);
	color: #fff;
	font-size: .85em;
	font-weight: 900;
	box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18);
}

.sram-name { flex: 1 1 auto; min-width: 0; line-height: 1.35; overflow-wrap: anywhere; }

.sram-qty {
	flex: none;
	color: var(--wood);
	font-size: .8em;
	font-weight: 700;
	opacity: .8;
}

.sram-table td.col-winners { line-height: 1; }

.sram-chip {
	display: inline-block;
	margin: .18em .3em .18em 0;
	padding: .32em .7em;
	border-radius: 999px;
	background: #fff;
	border: 2px solid var(--leaf-light);
	color: var(--leaf);
	font-weight: 900;
	font-variant-numeric: tabular-nums;
	letter-spacing: .05em;
}

.sram-chip.is-new { animation: sram-pop 1.6s ease-out; }

@keyframes sram-pop {
	0% { transform: scale(.3); background: var(--orange); color: #fff; border-color: var(--orange); }
	25% { transform: scale(1.25); background: var(--orange); color: #fff; border-color: var(--orange); }
	60% { transform: scale(1); background: var(--orange); color: #fff; border-color: var(--orange); }
	100% { transform: scale(1); }
}

/* ---------- 底部動物 ---------- */
.sram-footer {
	position: relative;
	z-index: 1;
	flex: none;
	pointer-events: none;
}

.sram-animals {
	position: relative;
	z-index: 1;
	display: flex;
	justify-content: center;
	align-items: flex-end;
	gap: clamp(8px, 6vw, 140px);
	padding: 0 2vw;
	margin-bottom: -9vw;
}

.sram-animal {
	flex: 0 1 auto;
	min-width: 0;
	max-width: 22%;
	object-fit: contain;
	height: clamp(64px, 22vw, 380px);
	width: auto;
	filter: drop-shadow(0 6px 6px rgba(30, 40, 10, .3));
	animation: sram-bob 2.4s ease-in-out infinite;
	transform-origin: 50% 100%;
}

.sram-animal--fox-banjo { animation-delay: -.3s; }
.sram-animal--bear { animation-delay: -1.1s; height: clamp(58px, 20vw, 345px); }
.sram-animal--hedgehog { animation-delay: -.6s; height: clamp(60px, 20vw, 350px); }
.sram-animal--fox { animation-delay: -1.6s; height: clamp(54px, 18vw, 320px); }
.sram-animal--deer { animation-delay: -.9s; height: clamp(72px, 25vw, 430px); }

@keyframes sram-bob {
	0%, 100% { transform: translateY(0) rotate(0); }
	50% { transform: translateY(-6px) rotate(-1deg); }
}

.sram-ground {
	position: relative;
	z-index: 0;
	aspect-ratio: 2366 / 442;
	background: var(--sram-ground) center bottom / 100% 100% no-repeat;
}

/* ---------- 未開放時：Coming Soon 木牌 ---------- */
.sram-soon {
	display: flex;
	justify-content: center;
	padding: clamp(8px, 2vw, 32px) 0 clamp(16px, 3vw, 48px);
}

.sram-soon[hidden] { display: none; }

.sram-soon__sign {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .15em;
	padding: .55em 1.4em .6em;
	font-size: clamp(30px, 6vw, 92px);
	background:
		repeating-linear-gradient(180deg, rgba(0, 0, 0, 0) 0 .5em, rgba(60, 25, 5, .12) .5em .54em),
		linear-gradient(180deg, var(--wood-light) 0%, var(--wood) 100%);
	border: .09em solid var(--wood-dark);
	border-radius: .35em;
	box-shadow:
		0 0 0 .06em var(--leaf-light),
		inset 0 .08em 0 rgba(255, 220, 160, .35),
		0 .25em .5em rgba(40, 20, 0, .35);
	transform-origin: 50% -1.2em;
	animation: sram-swing 4s ease-in-out infinite, sram-in .6s ease-out;
}

/* 吊繩 */
.sram-soon__sign::before,
.sram-soon__sign::after {
	content: "";
	position: absolute;
	top: -1.2em;
	width: .08em;
	height: 1.2em;
	background: #e8c79a;
	border-radius: .04em;
}
.sram-soon__sign::before { left: 18%; transform: rotate(14deg); transform-origin: bottom; }
.sram-soon__sign::after { right: 18%; transform: rotate(-14deg); transform-origin: bottom; }

.sram-soon__zh {
	color: #fff2c8;
	font-weight: 900;
	letter-spacing: .12em;
	line-height: 1.1;
	text-shadow: 0 .05em 0 var(--wood-dark), 0 .08em .1em rgba(0, 0, 0, .35);
}

.sram-soon__en {
	padding: .15em .8em;
	border-radius: 999px;
	background: var(--leaf);
	color: #fff;
	font-size: .32em;
	font-weight: 900;
	letter-spacing: .35em;
	box-shadow: inset 0 -.12em 0 rgba(0, 0, 0, .2);
}

.sram-soon__leaf {
	position: absolute;
	top: -.28em;
	width: .7em;
	height: .42em;
	background: linear-gradient(135deg, var(--leaf-light), var(--leaf));
	border-radius: 0 100% 0 100%;
}
.sram-soon__leaf--l { left: -.25em; transform: rotate(-25deg); }
.sram-soon__leaf--r { right: -.25em; transform: scaleX(-1) rotate(-25deg); }

@keyframes sram-swing {
	0%, 100% { transform: rotate(-1.5deg); }
	50% { transform: rotate(1.5deg); }
}

@media (prefers-reduced-motion: reduce) {
	.sram-title img, .sram-animal, .sram-chip.is-new, .sram-table-wrap, .sram-soon__sign { animation: none; }
}

/* ---------- 平板／手機：彩帶不超出畫面，避免撐寬 layout viewport 讓 fixed 元素變寬 ---------- */
@media (max-width: 1024px) {
	.sram-bunting { left: 0; width: 100%; transform: none; }
}

/* ---------- 手機 ---------- */
@media (max-width: 640px) {
	.sram-header { padding-top: 40px; }
	.sram-title { width: 88vw; }
	.sram-main { width: 94vw; }
	.sram-table-wrap { border-width: 4px; border-radius: 14px; padding: 5px; box-shadow: 0 0 0 3px var(--leaf-light), 0 10px 20px rgba(40, 20, 0, .3); }
	.sram-table { font-size: 14px; border-radius: 10px; }
	.sram-table thead th { padding: .6em .7em; letter-spacing: .1em; font-size: 1.05em; }
	.sram-table td { padding: .55em .6em; }
	.sram-table th.col-item, .sram-table td.col-item { width: 48%; }
	.sram-item { gap: .45em; }
	.sram-qty { display: none; }
	/* 中獎名單一列固定 3 個（號碼皆為 4 位數，如 0001） */
	.sram-table td.col-winners { padding-left: 7px; padding-right: 7px; font-size: 0; }
	.sram-chip { width: calc((100% - .6em) / 3); margin: .12em .3em .12em 0; padding: .3em 0; text-align: center; letter-spacing: 0; font-size: 14px; }
	.sram-chip:nth-child(3n) { margin-right: 0; }
	.sram-animals { gap: 3.5vw; padding: 0 3vw; }
	.sram-animal { max-width: none; height: 20vw; }
	.sram-animal--bear { height: 18.5vw; }
	.sram-animal--hedgehog { height: 18.5vw; }
	.sram-animal--fox { height: 16.5vw; }
	.sram-animal--deer { height: 23vw; }
}
