/* =========================
	 GRM Stamp Rally フロントエンド共通スタイル
	 ・テーマ側の影響を受けにくいよう、クラス名は
	   grmsr- で統一している
========================= */

.grmsr-notice {
	padding: 12px 16px;
	margin: 0 0 16px;
	border-radius: 6px;
	font-size: 16px;
	line-height: 1.6;
}

.grmsr-notice-success {
	background: #eefaf0;
	border: 1px solid #6f9485;
	color: #234a3a;
}

.grmsr-notice-error {
	background: #fdecec;
	border: 1px solid #d63638;
	color: #7a1c1e;
}

.grmsr-notice-warning {
	background: #fff8e5;
	border: 1px solid #f59e0b;
	color: #7a5300;
}

.grmsr-notice-info {
	background: #eef4fb;
	border: 1px solid #2271b1;
	color: #17395c;
}

.grmsr-notice ul {
	margin: 0;
	padding-left: 1.2em;
}

/* テーマ側の a { text-decoration: underline; } が
	 プラグイン側の各リンクに対して優先されてしまうため、
	 本プラグインの表示範囲内のリンクには下線を出さないよう
	 !important で明示的に上書きする */
.grmsr-notice a,
.grmsr-form a,
.grmsr-stamp-book a,
.grmsr-rally-discover a,
.grmsr-my-rallies a,
.grmsr-rally-chip-label a,
.grmsr-rally-chip-list a {
	text-decoration: none !important;
}

.grmsr-btn {
	display: inline-block;
	padding: 10px 20px;
	border-radius: 6px;
	background: #6f9485;
	color: #fff !important;
	text-decoration: none !important;
	font-size: 16px;
	border: none;
	cursor: pointer;
}

.grmsr-btn-outline {
	background: transparent;
	border: 1px solid #6f9485;
	color: #6f9485 !important;
}

.grmsr-stamp-book {
	max-width: 480px;
	margin: 0 auto;
}

/* /stamp/ を直接開いたときの一覧表示：複数ラリーが並ぶ場合の余白 */
.grmsr-my-rallies .grmsr-stamp-book {
	margin-bottom: 16px;
}

.grmsr-my-rallies .grmsr-stamp-book:last-child {
	margin-bottom: 0;
}

/* 開催中のラリーへのショートカット（カテゴリーチップ風） */
.grmsr-rally-chip-label {
	max-width: 480px;
	margin: 0 auto 8px;
	font-size: 15px;
	font-weight: bold;
	color: #999;
}

.grmsr-rally-chip-list {
	list-style: none !important;
	max-width: 480px;
	margin: 0 auto 48px;
	padding: 0 !important;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.grmsr-rally-chip-list li {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.grmsr-rally-chip {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 999px;
	background: #eef4eb;
	color: #5c8271;
	font-size: 13px;
	font-weight: bold;
	text-decoration: none !important;
	border: 1px solid #d9e5d2;
}

.grmsr-rally-chip:hover {
	background: #e2edde;
}

/* パソコンなど横幅が十分ある場合は、複数のラリーを
	 縦に並べず横並び（2列固定）で表示する。
	 チップ一覧・カードとも同じ幅いっぱいに揃え、
	 カードは常に2分の1幅（中央寄せの余白なし）にする。
	 ラリーが奇数件で最後の1件だけ余る場合は、その1件だけ
	 2列分の幅（フル幅）で表示する */
@media (min-width: 700px) {

	.grmsr-rally-chip-label,
	.grmsr-rally-chip-list {
		max-width: none !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	.grmsr-my-rallies.grmsr-my-rallies {
		display: grid !important;
		grid-template-columns: repeat(2, 1fr) !important;
		align-items: start !important;
		gap: 24px !important;
	}

	.grmsr-my-rallies.grmsr-my-rallies .grmsr-rally-chip-label,
	.grmsr-my-rallies.grmsr-my-rallies .grmsr-rally-chip-list {
		grid-column: 1 / -1 !important;
	}

	.grmsr-my-rallies.grmsr-my-rallies .grmsr-rally-chip-list {
		margin-bottom: 32px !important;
	}

	.grmsr-my-rallies.grmsr-my-rallies .grmsr-stamp-book {
		max-width: none !important;
		margin: 0 !important;
		width: auto !important;
		display: block !important;
	}

	/* 実機で確認したところ、:last-child:nth-child(odd) は
	   直前に並ぶチップ一覧（ul）も子要素として数えてしまうため、
	   ラリーが2件（偶数）でもチップ一覧の分だけ位置がずれて
	   奇数番目と誤判定され、2件目が誤ってフル幅になっていた。
	   :nth-of-type は同じタグ名（div）の兄弟だけを数えるため、
	   chip-list（ul）やchip-label（p）を数に含めず、
	   ラリーカード（div）だけを正しく数えられる */
	.grmsr-my-rallies.grmsr-my-rallies .grmsr-stamp-book:last-of-type:nth-of-type(odd) {
		grid-column: 1 / -1 !important;
	}
}

/* まだ参加していない開催中ラリーの発見用カード */
.grmsr-rally-discover {
	padding: 16px;
	background: #fbfaf7;
	border: 1px solid #e8e5de;
	border-radius: 12px;
}

.grmsr-discover-notice {
	font-size: 14px;
	color: #666;
	margin: 0 0 12px;
}

.grmsr-discover-stores-label {
	font-size: 13px;
	font-weight: bold;
	color: #234a3a;
	margin: 0 0 6px;
}

.grmsr-discover-store-list {
	margin: 0;
	padding-left: 1.2em;
	font-size: 13px;
	color: #555;
}

.grmsr-rally-title {
	margin-top: 0 !important;
	font-size: 20px;
	margin-bottom: 12px;
}

.grmsr-store-list {
	list-style: none !important;
	margin: 0 0 20px !important;
	padding: 16px !important;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
	gap: 18px 10px;
	background: #fbfaf7 !important;
	border: 1px solid #e8e5de !important;
	border-radius: 12px;
}

.grmsr-store-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	text-align: center;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* ▼ 未取得：スタンプを押す前の、台紙にある空の丸枠 */
.grmsr-stamp-mark {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	border: 2px dashed #cfcabf;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	box-sizing: border-box;
}

/* ▼ 取得済み：実際にスタンプを押したような二重丸＋インクにじみ風の見た目 */
.grmsr-store-item.is-stamped .grmsr-stamp-mark {
	border: 2px solid #5c8271;
	background:
		radial-gradient(circle at 50% 50%, rgba(111, 148, 133, 0.12) 0%, rgba(111, 148, 133, 0.12) 65%, transparent 66%),
		#fff;
	box-shadow:
		inset 0 0 0 3px #fff,
		inset 0 0 0 5px #5c8271;
}

.grmsr-stamp-mark-text {
	display: inline-block;
	color: #5c8271;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.03em;
	line-height: 1;
	transform: rotate(-10deg);
}

.grmsr-store-name {
	font-size: 13px;
	line-height: 1.4;
	color: #999;
}

.grmsr-store-item.is-stamped .grmsr-store-name {
	color: #234a3a;
	font-weight: bold;
}

.grmsr-progress {
	max-width: 320px;
	margin: 0 auto;
	height: 8px;
	border-radius: 999px;
	background: #e8e5de;
	overflow: hidden;
}

.grmsr-progress-bar {
	height: 100%;
	background: #6f9485;
	border-radius: 999px;
	transition: width 0.3s ease;
}

.grmsr-count {
	font-size: 18px;
	font-weight: bold;
	text-align: center;
	margin: 10px 0 16px;
}

.grmsr-form {
	max-width: 480px;
	margin: 0 auto;
}

.grmsr-form label {
	display: block;
	font-size: 15px;
	margin-bottom: 4px;
}

.grmsr-form input[type="text"],
.grmsr-form input[type="email"],
.grmsr-form input[type="password"],
.grmsr-form textarea {
	width: 100%;
	padding: 8px 10px;
	font-size: 16px;
	border: 1px solid #ccc;
	border-radius: 4px;
	box-sizing: border-box;
}

.grmsr-inline-option {
	display: inline-block;
	margin-right: 12px;
	font-weight: normal;
}

.grmsr-survey-question {
	margin-bottom: 16px;
}

.grmsr-badge {
	display: inline-block;
	margin-left: 6px;
	padding: 2px 8px;
	font-size: 11px;
	border-radius: 10px;
	background: #eee;
	color: #666;
}

.grmsr-btn-small {
	padding: 6px 14px;
	font-size: 13px;
}

/* =========================================
	 リピート型：スタンプ帳（店舗ごとの来店回数・景品進捗）
========================================= */
.grmsr-repeat-store-list {
	list-style: none !important;
	margin: 0 0 20px !important;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.grmsr-repeat-store-item {
	list-style: none !important;
	margin: 0 !important;
	padding: 14px 16px !important;
	background: #fbfaf7 !important;
	border: 1px solid #e8e5de !important;
	border-radius: 12px;
}

.grmsr-repeat-store-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 8px;
}

.grmsr-repeat-store-head .grmsr-store-name {
	font-size: 15px;
	font-weight: bold;
	color: #234a3a;
}

.grmsr-repeat-visit-count {
	font-size: 13px;
	color: #5c8271;
	font-weight: bold;
	white-space: nowrap;
}

.grmsr-repeat-prize-list {
	list-style: none !important;
	margin: 8px 0 0 !important;
	padding: 10px 0 0 !important;
	border-top: 1px dashed #e0ddd4;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.grmsr-repeat-prize {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.grmsr-repeat-prize-photo {
	width: 36px;
	height: 36px;
	object-fit: cover;
	border-radius: 6px;
	flex-shrink: 0;
}

.grmsr-repeat-prize-name {
	font-size: 14px;
	font-weight: bold;
	flex: 1 1 auto;
}

.grmsr-repeat-prize-progress {
	font-size: 12px;
	color: #999;
}

.grmsr-repeat-prize .grmsr-progress {
	flex: 1 1 140px;
	max-width: none;
	margin: 0;
}

.grmsr-repeat-prize.is-eligible .grmsr-repeat-prize-name {
	color: #5c8271;
}

.grmsr-repeat-prize.is-ordered .grmsr-repeat-prize-name {
	color: #666;
}

/* =========================================
	 紹介ページ（[grm_stamp_intro]）
========================================= */
.grmsr-intro {
	width: 100%;
	max-width: none;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 40px;
}

.grmsr-intro-rally {
	padding: 20px;
	background: #fbfaf7;
	border: 1px solid #e8e5de;
	border-radius: 12px;
}

.grmsr-intro-rally-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.grmsr-intro-rally-title {
	margin: 0 !important;
	font-size: 22px;
}

.grmsr-intro-period {
	font-size: 13px;
	color: #666;
	margin: 0 0 12px;
}

.grmsr-intro-notice {
	font-size: 15px;
	line-height: 1.7;
	margin: 0 0 16px;
}

/* テーマ側の .grm-page-content p { font-weight:300, margin-bottom:24px } が
	 詳細度の関係で優先されてしまうため、!important で明示的に上書きする
	 （景品タイトル等と同じ理由） */
.grmsr-intro-stores-label,
.grmsr-intro-prizes-label {
	font-size: 14px !important;
	font-weight: bold !important;
	color: #234a3a;
	line-height: 1.4 !important;
	margin: 0 0 8px !important;
}

/* 「景品」ラベルは、直前の対象施設ボックスとの間をもう少し開ける */
.grmsr-intro-prizes-label {
	margin-top: 16px !important;
}

.grmsr-intro-store-list {
	margin: 0 0 20px !important;
	padding: 14px 16px !important;
	list-style: none !important;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 6px 16px;
	font-size: 14px;
	color: #333;
	background: #fff !important;
	border: 1px solid #e8e5de !important;
	border-radius: 8px;
}

.grmsr-intro-store-list li {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.grmsr-intro-prize-list {
	list-style: none !important;
	margin: 0 0 20px !important;
	padding: 0 !important;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
}

@media (max-width: 600px) {
	.grmsr-intro-prize-list {
		grid-template-columns: 1fr;
	}
}

.grmsr-intro-prize {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	list-style: none !important;
	margin: 0 !important;
	padding: 12px !important;
	background: #fff !important;
	border: 1px solid #e8e5de !important;
	border-radius: 10px;
}

.grmsr-intro-prize-photo {
	width: 88px;
	height: 88px;
	object-fit: cover;
	border-radius: 8px;
	flex-shrink: 0;
}

.grmsr-intro-prize-info {
	min-width: 0;
}

/* テーマ側の .grm-page-content p { font-size / font-weight / margin / line-height }
	 が、クラス+要素セレクタとしてこちらの単一クラスより詳細度が高く、
	 !important なしでは太字・文字サイズ・行間・余白がすべて
	 テーマ側の値（font-weight:300, font-size:14px, margin-bottom:24px, line-height:1.8）
	 に上書きされてしまうため、!important で明示的に指定する */
.grmsr-intro-prize-name {
	font-size: 17px !important;
	font-weight: 600 !important;
	color: #234a3a;
	line-height: 1.3 !important;
	margin: 0 0 2px !important;
}

.grmsr-intro-prize-desc {
	font-size: 13px !important;
	color: #555;
	line-height: 1.4 !important;
	margin: 0 0 4px !important;
}

.grmsr-intro-prize-requirement {
	font-size: 12px !important;
	color: #5c8271;
	font-weight: bold !important;
	line-height: 1.3 !important;
	margin: 0 !important;
}

.grmsr-intro-cta {
	margin: 0;
	text-align: center;
}
