/*
 * お知らせのベルと帯（ロードマップ 3-5。docs/news-design-2026-10.md、画面案 https://claude.ai/artifact/KM4wBnuAeNrP4NL2jej5p7）
 * header.php が、タイピングをする画面以外のページで読み込む。中身は js/tz-news.js が作る。
 * 見た目は対戦の画面案（2-2）と同じ「紺のガラス板＋角を斜めに落とした光る枠」。大事＝琥珀、緊急＝赤、一覧＝水色
 */

/* ---- ベル（位置は JS が「日本語」・ログインの並びの左に合わせる） ---- */
/* 重なり順は右上のほかの部品（.loginbtndiv など）と同じ 11。一覧を開いている間だけ、上のメニュー（49）より上に出す */
.tzNewsBell {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 11;
	visibility: hidden;
	line-height: 1;
	text-align: left;
}
.tzNewsBell.is-placed {
	visibility: visible;
}
.tzNewsBell.is-open {
	z-index: 60;
}
.tzNewsBell-btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 2px solid #ffd36a;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	color: #ffd36a;
	cursor: pointer;
	box-sizing: border-box;
}
.tzNewsBell-btn:hover,
.tzNewsBell-btn:focus-visible {
	background: #12305e;
}
.tzNewsBell-btn[aria-expanded="true"] {
	border-color: #5fd3f3;
	background: #12305e;
	color: #5fd3f3;
}
.tzNewsBell-btn svg {
	display: block;
}
.tzNewsBell-badge {
	position: absolute;
	top: -6px;
	right: -6px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	box-sizing: border-box;
	border: 2px solid #0a1630;
	border-radius: 10px;
	background: #e5322a;
	color: #fff;
	font-size: 12px;
	font-weight: 900;
	line-height: 16px;
	text-align: center;
}
.tzNewsBell-badge[hidden] {
	display: none;
}

/* ---- ベルの一覧 ---- */
.tzNewsPanel {
	position: absolute;
	top: 48px;
	right: 0;
	width: 440px;
	filter: drop-shadow(0 0 12px rgba(95, 211, 243, 0.45)) drop-shadow(0 10px 24px rgba(0, 0, 0, 0.6));
}
.tzNewsPanel[hidden] {
	display: none;
}
.tzNewsPanel-frame {
	padding: 2px;
	background: #5fd3f3;
	clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}
.tzNewsPanel-in {
	background: #0e1a33;
	color: #fff;
	clip-path: polygon(13px 0, 100% 0, 100% calc(100% - 13px), calc(100% - 13px) 100%, 0 100%, 0 13px);
}
.tzNewsPanel-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding: 14px 20px 10px;
}
.tzNewsPanel-title {
	font-size: 17px;
	font-weight: 900;
}
.tzNewsPanel-count {
	font-size: 12px;
	color: #9fb3d1;
}
.tzNewsPanel-list {
	margin: 0;
	padding: 0;
	list-style: none;
	max-height: 60vh;
	overflow-y: auto;
}
.tzNewsPanel-list li {
	margin: 0;
	padding: 0;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	list-style: none;
}
.tzNewsPanel-item {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 12px 20px;
	color: #dce5f5;
	text-decoration: none;
}
.tzNewsPanel-item:hover,
.tzNewsPanel-item:focus-visible {
	background: rgba(95, 211, 243, 0.14);
	color: #fff;
}
.tzNewsPanel-item.is-unread {
	background: rgba(95, 211, 243, 0.08);
	color: #fff;
	font-weight: 700;
}
.tzNewsPanel-dot {
	flex: none;
	width: 8px;
	height: 8px;
	margin-top: 7px;
	border-radius: 50%;
}
.tzNewsPanel-item.is-unread .tzNewsPanel-dot {
	background: #5fd3f3;
}
.tzNewsPanel-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}
.tzNewsPanel-meta {
	display: flex;
	gap: 8px;
	align-items: center;
	font-size: 12px;
	font-weight: 400;
	color: #9fb3d1;
}
.tzNewsPanel-text {
	font-size: 14px;
	line-height: 1.5;
	overflow-wrap: anywhere;
}
.tzNewsPanel-empty {
	padding: 16px 20px;
	font-size: 14px;
	color: #9fb3d1;
}
.tzNewsPanel-foot {
	padding: 4px 20px 10px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	text-align: right;
}
.tzNewsPanel-all {
	display: inline-block;
	padding: 10px 0;
	color: #5fd3f3;
	font-size: 14px;
	font-weight: 700;
	text-decoration: underline;
}
.tzNewsPanel-all:hover {
	color: #bfefff;
}

/* ---- 重要度の札 ---- */
.tzNews-tag {
	display: inline-block;
	padding: 1px 7px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 900;
	line-height: 1.5;
	white-space: nowrap;
}
.tzNews-tag.is-important {
	background: #f2a93b;
	color: #1a1205;
}
.tzNews-tag.is-urgent {
	background: #d93a2e;
	color: #fff;
}

/* ---- 帯（header#top の直後） ---- */
.tzNewsBanner {
	position: relative;
	z-index: 5;
	box-sizing: border-box;
	width: calc(100% - 24px);
	max-width: 1100px;
	margin: 12px auto 4px;
	filter: drop-shadow(0 0 10px rgba(242, 169, 59, 0.55));
	text-align: left;
}
.tzNewsBanner.is-urgent {
	filter: drop-shadow(0 0 12px rgba(255, 91, 79, 0.6));
}
.tzNewsBanner-frame {
	padding: 2px;
	background: #f2a93b;
	clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}
.tzNewsBanner.is-urgent .tzNewsBanner-frame {
	background: #ff5b4f;
}
.tzNewsBanner-in {
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 44px;
	padding: 8px 10px 8px 22px;
	background: #0e1a33;
	color: #fff;
	clip-path: polygon(13px 0, 100% 0, 100% calc(100% - 13px), calc(100% - 13px) 100%, 0 100%, 0 13px);
}
.tzNewsBanner.is-urgent .tzNewsBanner-in {
	padding-right: 24px;
	background: #1a0f1c;
}
.tzNewsBanner-icon {
	flex: none;
	color: #ff7a6f;
}
.tzNewsBanner-meta {
	flex: none;
	display: flex;
	align-items: center;
	gap: 10px;
}
.tzNewsBanner .tzNews-tag {
	padding: 3px 10px;
	font-size: 13px;
}
.tzNewsBanner-date {
	color: #b7c6e0;
	font-size: 13px;
}
.tzNewsBanner-text {
	flex: 1;
	min-width: 0;
	margin: 0;
	padding: 0;
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.5;
	overflow-wrap: anywhere;
}
.tzNewsBanner-link {
	flex: none;
	padding: 10px 4px;
	color: #ffc766;
	font-size: 14px;
	font-weight: 700;
	text-decoration: underline;
	white-space: nowrap;
}
.tzNewsBanner-link:hover {
	color: #ffe0a3;
}
.tzNewsBanner.is-urgent .tzNewsBanner-link {
	color: #ffb0a8;
}
.tzNewsBanner.is-urgent .tzNewsBanner-link:hover {
	color: #ffd6d1;
}
.tzNewsBanner-close {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: none;
	background: transparent;
	color: #c9d4ea;
	cursor: pointer;
}
.tzNewsBanner-close:hover,
.tzNewsBanner-close:focus-visible {
	color: #fff;
}
.tz-arena-mode .tzNewsBanner {
	display: none;
}

/* 画面の下に重ねる帯（ステージ選択・記号&プログラミング・コロシアム。header.php の dock）。
   ページを押し下げず、初めての人向けの暗い幕（#stfadeLayer、10）と上のメニュー（49〜51）より上に出す */
.tzNewsBanner.is-dock {
	position: fixed;
	left: 50%;
	bottom: 16px;
	z-index: 70;
	width: calc(100% - 24px);
	max-width: 760px;
	margin: 0;
	transform: translateX(-50%);
	filter: drop-shadow(0 0 10px rgba(242, 169, 59, 0.55)) drop-shadow(0 10px 22px rgba(0, 0, 0, 0.55));
	animation: tzNewsDockIn 0.35s ease-out;
}
.tzNewsBanner.is-dock.is-urgent {
	filter: drop-shadow(0 0 12px rgba(255, 91, 79, 0.6)) drop-shadow(0 10px 22px rgba(0, 0, 0, 0.55));
}
.tzNewsBanner.is-dock .tzNewsBanner-text {
	font-size: 15px;
}
@keyframes tzNewsDockIn {
	from { opacity: 0; transform: translate(-50%, 16px); }
	to { opacity: 1; transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) {
	.tzNewsBanner.is-dock {
		animation: none;
	}
}

/* ---- スマホ（テーマの rwd.css と同じ区切り） ---- */
@media screen and (max-width: 736px) {
	/* 上の黒い帯（.global-nav 50、「日本語」51）の上に出す */
	.tzNewsBell {
		z-index: 52;
	}
	.tzNewsBell.is-open {
		z-index: 60;
	}
	.tzNewsPanel {
		position: fixed;
		top: 48px;
		left: 12px;
		right: 12px;
		width: auto;
	}
	.tzNewsPanel-list {
		max-height: calc(100vh - 180px);
	}
	.tzNewsBanner-in {
		flex-wrap: wrap;
		gap: 4px 10px;
		padding: 4px 4px 8px 16px;
	}
	.tzNewsBanner.is-urgent .tzNewsBanner-in {
		padding: 10px 14px 8px 16px;
	}
	.tzNewsBanner-meta {
		flex: 1 1 auto;
	}
	.tzNewsBanner-close {
		order: 2;
	}
	.tzNewsBanner-text {
		order: 3;
		flex: 1 1 100%;
		padding-right: 10px;
		font-size: 15px;
	}
	.tzNewsBanner-link {
		order: 4;
		margin-left: auto;
		padding: 6px 10px 2px;
	}
	.tzNewsBanner.is-urgent .tzNewsBanner-icon {
		order: 0;
	}
	.tzNewsBanner.is-dock {
		bottom: 10px;
	}
}
