/**
 * ペタンク得点表・スコア計算 - 専用スタイル
 */

/* ===== タブ ===== */
.pt-tabs {
	display: flex;
	gap: 8px;
	padding: 20px 20px 0;
}

.pt-tab {
	flex: 1;
	padding: 12px 10px;
	font-family: var(--font-display);
	font-size: 14px;
	font-weight: 700;
	color: var(--color-text-secondary);
	background: var(--color-bg);
	border: 2px solid var(--color-border);
	border-radius: var(--radius);
	cursor: pointer;
	transition: all 0.2s ease;
}

.pt-tab:hover {
	border-color: var(--color-primary);
}

.pt-tab.active {
	color: var(--color-white);
	background: var(--color-primary);
	border-color: var(--color-primary);
}

.pt-panel {
	padding: 20px;
}

/* ===== 設定 ===== */
.pt-settings {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 20px;
}

.pt-setting-item:last-child {
	grid-column: 1 / -1;
}

.pt-label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	color: var(--color-text-secondary);
	margin-bottom: 6px;
}

.pt-input,
.pt-select,
.pt-textarea {
	width: 100%;
	padding: 10px 12px;
	font-family: inherit;
	font-size: 14px;
	color: var(--color-text);
	background: var(--color-white);
	border: 2px solid var(--color-border);
	border-radius: var(--radius);
}

.pt-input:focus,
.pt-select:focus,
.pt-textarea:focus {
	outline: none;
	border-color: var(--color-primary);
}

.pt-textarea {
	resize: vertical;
	line-height: 1.8;
}

/* ===== スコアボード ===== */
.pt-scoreboard {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	padding: 18px 10px;
	background: var(--color-bg);
	border-radius: var(--radius);
	margin-bottom: 14px;
}

.pt-score-side {
	flex: 1;
	max-width: 180px;
	text-align: center;
}

.pt-score-name {
	font-family: var(--font-display);
	font-size: 13px;
	font-weight: 700;
	margin-bottom: 4px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pt-score-name--a { color: var(--color-primary); }
.pt-score-name--b { color: var(--color-accent); }

.pt-score-value {
	font-family: var(--font-display);
	font-size: 52px;
	font-weight: 700;
	color: var(--color-text);
	line-height: 1.1;
}

.pt-score-divider {
	font-size: 24px;
	color: var(--color-text-muted);
}

/* ===== 勝利バナー ===== */
.pt-win-banner {
	padding: 14px 16px;
	text-align: center;
	font-family: var(--font-display);
	font-size: 16px;
	font-weight: 700;
	color: #2e7d32;
	background: rgba(127, 176, 105, 0.15);
	border: 2px solid #7FB069;
	border-radius: var(--radius);
	margin-bottom: 14px;
}

/* ===== 得点ボタン ===== */
.pt-entry {
	margin-bottom: 20px;
}

.pt-entry-hint {
	font-size: 12px;
	color: var(--color-text-muted);
	margin: 0 0 12px;
}

.pt-entry-group {
	margin-bottom: 12px;
}

.pt-entry-label {
	font-size: 12px;
	font-weight: 700;
	margin-bottom: 6px;
}

.pt-entry-label--a { color: var(--color-primary); }
.pt-entry-label--b { color: var(--color-accent); }

.pt-score-btns {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 6px;
}

.pt-score-btn {
	padding: 12px 0;
	font-family: var(--font-display);
	font-size: 15px;
	font-weight: 700;
	color: var(--color-white);
	border: none;
	border-radius: var(--radius);
	cursor: pointer;
	transition: opacity 0.15s ease, transform 0.1s ease;
}

.pt-score-btn:active {
	transform: scale(0.96);
}

.pt-score-btn--a { background: var(--color-primary); }
.pt-score-btn--a:hover { background: var(--color-primary-dark); }
.pt-score-btn--b { background: var(--color-accent); }
.pt-score-btn--b:hover { background: var(--color-accent-hover); }

.pt-score-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
	transform: none;
}

/* ===== テーブル共通 ===== */
.pt-history-title {
	font-family: var(--font-display);
	font-size: 14px;
	font-weight: 700;
	color: var(--color-text);
	margin: 18px 0 10px;
}

.pt-table-wrap {
	overflow-x: auto;
}

.pt-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.pt-table th {
	padding: 8px 10px;
	font-weight: 700;
	color: var(--color-text-secondary);
	background: var(--color-bg);
	border-bottom: 2px solid var(--color-border);
	text-align: center;
	white-space: nowrap;
}

.pt-table td {
	padding: 8px 10px;
	color: var(--color-text);
	border-bottom: 1px solid var(--color-border);
	text-align: center;
	white-space: nowrap;
}

.pt-cell-a { color: var(--color-primary); font-weight: 700; }
.pt-cell-b { color: var(--color-accent); font-weight: 700; }

.pt-history-empty td {
	color: var(--color-text-muted);
	font-size: 12px;
	padding: 16px 10px;
}

.pt-standings-name {
	text-align: left;
	font-weight: 500;
	max-width: 160px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pt-rank {
	font-weight: 700;
}

.pt-rank-first td {
	background: rgba(127, 176, 105, 0.1);
}

/* ===== リーグ：対戦カード ===== */
.pt-league-setup {
	margin-bottom: 8px;
}

.pt-fixture {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 6px;
	border-bottom: 1px solid var(--color-border);
}

.pt-fixture-no {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 700;
	color: var(--color-text-secondary);
	background: var(--color-bg);
	border-radius: 50%;
}

.pt-fixture-team {
	flex: 1;
	font-size: 13px;
	font-weight: 500;
	color: var(--color-text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pt-fixture-team--home {
	text-align: right;
}

.pt-fixture-vs {
	color: var(--color-text-muted);
	font-size: 12px;
}

.pt-score-input {
	width: 52px;
	padding: 8px 6px;
	font-family: inherit;
	font-size: 14px;
	text-align: center;
	color: var(--color-text);
	background: var(--color-white);
	border: 2px solid var(--color-border);
	border-radius: var(--radius);
}

.pt-score-input:focus {
	outline: none;
	border-color: var(--color-primary);
}

/* ===== レスポンシブ ===== */
@media (max-width: 480px) {
	.pt-score-btns {
		grid-template-columns: repeat(3, 1fr);
	}

	.pt-score-value {
		font-size: 42px;
	}

	.pt-fixture {
		flex-wrap: wrap;
	}
}
