/* mypage.css - マイページ専用スタイル */

/* ===== デッキ画像モーダル ===== */
.deck-image-overlay {
	position: fixed;
	inset: 0;
	z-index: 99998;
	background: rgba(0,0,0,0.75);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.deck-image-box {
	background: #fff;
	border-radius: 12px;
	max-width: 95vw;
	max-height: 95vh;
	width: 1100px;
	display: flex;
	flex-direction: column;
	box-shadow: 0 10px 40px rgba(0,0,0,0.5);
	overflow: hidden;
}
.deck-image-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 18px;
	background: #2c3e50;
	color: #fff;
	font-size: 14px;
	font-weight: bold;
}
.deck-image-close {
	background: #e74c3c;
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 6px 12px;
	cursor: pointer;
	font-size: 13px;
}
.deck-image-close:hover { background: #c0392b; }
.deck-image-frame {
	flex: 1;
	width: 100%;
	min-height: 600px;
	border: none;
	background: #fff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
	font-family: 'Hiragino Sans', 'Meiryo', 'Segoe UI', sans-serif;
	background: #f5f6fa;
	color: #333;
	min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.mypage-wrap {
	max-width: 960px;
	margin: 0 auto;
	padding: 0 16px 40px;
}

/* ===== ヘッダー（スティッキー：常に上に固定） ===== */
.mypage-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: linear-gradient(135deg, #ff6b6b, #feca57);
	padding: 14px 24px;
	margin: 0 -16px 24px;
	box-shadow: 0 2px 12px rgba(0,0,0,0.15);
	position: sticky;
	top: 0;
	z-index: 900;
	backdrop-filter: blur(6px);
}
/* bodyのパディング調整（margin: 0 -16px が働くように） */
body.mypage-body { padding-top: 0; }
.mypage-header .logo a {
	font-size: 20px;
	font-weight: bold;
	color: #fff;
	text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.mypage-header .nav {
	display: flex;
	gap: 8px;
}
.nav-link {
	padding: 8px 16px;
	background: rgba(255,255,255,0.2);
	color: #fff;
	border-radius: 20px;
	font-size: 13px;
	font-weight: bold;
	transition: background 0.2s;
}
.nav-link:hover { background: rgba(255,255,255,0.35); }
.nav-link.active { background: #fff; color: #ff6b6b; }
.nav-link.logout { background: rgba(0,0,0,0.2); }
.nav-link.logout:hover { background: rgba(0,0,0,0.35); }

/* ===== ユーザー情報 ===== */
.user-info { margin-bottom: 28px; }
.user-info h1 {
	font-size: 22px;
	color: #333;
	margin-bottom: 16px;
	padding-bottom: 8px;
	border-bottom: 3px solid #ff6b6b;
}
.info-box {
	background: #fff;
	border-radius: 12px;
	padding: 20px 24px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.info-row {
	display: flex;
	align-items: center;
	padding: 10px 0;
	border-bottom: 1px dashed #eee;
}
.info-row:last-child { border-bottom: none; }
.info-row label {
	width: 140px;
	font-size: 13px;
	color: #888;
}
.info-row .info-value {
	flex: 1;
	font-size: 15px;
	color: #333;
	font-weight: bold;
}
.btn-edit {
	padding: 4px 12px;
	background: #f1f2f6;
	border: 1px solid #ddd;
	border-radius: 6px;
	cursor: pointer;
	font-size: 12px;
	color: #555;
}
.btn-edit:hover { background: #e4e6ef; }

/* ===== デッキセクション ===== */
.decks-section { }
.decks-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
	padding-bottom: 8px;
	border-bottom: 3px solid #ff6b6b;
}
.decks-section h2 {
	font-size: 20px;
	color: #333;
}
.deck-counter {
	font-size: 14px;
	color: #888;
	background: #fff;
	padding: 4px 12px;
	border-radius: 12px;
	border: 1px solid #eee;
}
.deck-counter span:first-child {
	color: #ff6b6b;
	font-weight: bold;
}

.decks-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.loading, .empty-state {
	text-align: center;
	padding: 40px 20px;
	color: #888;
	background: #fff;
	border-radius: 12px;
}
.empty-state { font-size: 14px; line-height: 1.8; }

.deck-card {
	background: #fff;
	border-radius: 12px;
	padding: 16px 20px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.06);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	transition: transform 0.15s, box-shadow 0.15s;
}
.deck-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.deck-main { flex: 1; min-width: 0; }
.deck-name {
	font-size: 16px;
	font-weight: bold;
	color: #333;
	margin-bottom: 6px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	cursor: pointer;
	transition: color 0.15s;
}
.deck-name:hover {
	color: #ff6b6b;
}
.deck-name-edit {
	font-size: 12px;
	opacity: 0.5;
	margin-left: 6px;
	transition: opacity 0.15s;
}
.deck-name:hover .deck-name-edit {
	opacity: 1;
}
.deck-name.editing {
	cursor: text;
	overflow: visible;
	white-space: normal;
	padding: 0;
	margin-bottom: 4px;
}
.deck-name-input {
	font-size: 15px;
	font-weight: bold;
	color: #333;
	width: 100%;
	padding: 6px 10px;
	border: 1px solid #ff6b6b;
	border-radius: 6px;
	background: #fff;
	outline: none;
	box-sizing: border-box;
	font-family: inherit;
	box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.12);
	transition: box-shadow 0.15s;
}
.deck-name-input:focus {
	box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}
.deck-meta {
	display: flex;
	gap: 12px;
	font-size: 12px;
	color: #888;
}
.deck-code {
	font-family: 'Consolas', 'Monaco', monospace;
	background: #f5f6fa;
	padding: 2px 8px;
	border-radius: 4px;
	color: #555;
}

.deck-actions {
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
	justify-content: flex-end;
}
.action-btn {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	padding: 6px 4px;
	background: #f5f6fa;
	border: 1px solid #e4e6ef;
	border-radius: 10px;
	cursor: pointer;
	font-size: 20px;
	color: #555;
	transition: all 0.15s;
	text-decoration: none;
}
.action-btn span {
	font-size: 10px;
	margin-top: 2px;
	color: #666;
}
.action-btn:hover {
	background: #fff;
	transform: translateY(-2px);
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.action-play:hover { background: #e8f5e9; border-color: #4caf50; }
.action-rename:hover { background: #fff3e0; border-color: #ff9800; }
.action-edit:hover { background: #fff8e1; border-color: #ffc107; }
.action-print:hover { background: #e3f2fd; border-color: #2196f3; }
.action-image:hover { background: #f3e5f5; border-color: #9c27b0; }
.action-text:hover { background: #e0f2f1; border-color: #009688; }
.action-share:hover { background: #fce4ec; border-color: #e91e63; }
.action-delete:hover { background: #ffebee; border-color: #f44336; color: #f44336; }

/* ===== モーダル ===== */
.modal-overlay {
	display: none;
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(0,0,0,0.5);
	z-index: 1000;
	justify-content: center;
	align-items: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
	background: #fff;
	border-radius: 12px;
	padding: 24px;
	max-width: 480px;
	width: 90%;
}
.modal-box h3 {
	font-size: 18px;
	color: #333;
	margin-bottom: 12px;
}
.modal-box p {
	color: #555;
	margin-bottom: 16px;
}
.modal-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	margin-top: 16px;
}
.btn {
	padding: 10px 20px;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	font-weight: bold;
}
.btn-primary { background: #ff6b6b; color: #fff; }
.btn-primary:hover { background: #ff5252; }
.btn-secondary { background: #e4e6ef; color: #555; }
.btn-secondary:hover { background: #d4d6df; }
.btn-danger { background: #f44336; color: #fff; }
.btn-danger:hover { background: #e53935; }

/* ===== ログインエラー ===== */
.login-error {
	max-width: 480px;
	margin: 80px auto;
	text-align: center;
	padding: 32px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.login-error h2 { margin-bottom: 16px; color: #333; }
.login-error a { display: inline-block; margin-top: 16px; }

/* ===== トースト ===== */
.toast {
	position: fixed;
	bottom: 24px;
	right: 24px;
	padding: 14px 20px;
	background: #333;
	color: #fff;
	border-radius: 8px;
	font-size: 14px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.3);
	transform: translateY(100px);
	opacity: 0;
	transition: all 0.3s;
	z-index: 2000;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ===== レスポンシブ ===== */
@media (max-width: 640px) {
	.mypage-header { flex-direction: column; gap: 12px; }
	.deck-card { flex-direction: column; align-items: stretch; }
	.deck-actions { justify-content: center; }
	.info-row { flex-wrap: wrap; }
	.info-row label { width: 100%; }
}
