/**
 * PriMob スタイルシート (bubblish UI 準拠)
 */

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

html, body {
	height: 100%;
	font-family: 'Kosugi Maru', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
	background-color: var(--sub-color);
	color: #333;
}

body.editor-active {
	overflow: hidden;
	position: fixed;
	width: 100%;
	height: 100%;
}

:root {
	--main-color: #636363;
	--sub-color: #ece9e3;
	--link-color: #e07145;
	--hover-color: #ffb866;
	--accent-color: #007bff;
}

/* 初期画面ラッパー */
.landing-wrapper {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background-color: var(--sub-color);
}

/* ======== ドロップゾーン (3 ペイン) ======== */

.drop-zone {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	background-color: var(--sub-color);
	padding: 20px;
	gap: 24px;
}

.landing-header {
	text-align: center;
}

.landing-title {
	font-size: 32px;
	font-weight: 700;
	color: var(--main-color);
	margin-bottom: 8px;
	letter-spacing: 2px;
}

.landing-subtitle {
	font-size: 14px;
	color: var(--main-color);
	opacity: 0.8;
}

.landing-upload-area {
	flex: 0 0 auto;
}

.upload-box {
	border: 3px dashed var(--main-color);
	border-radius: 16px;
	padding: 40px 60px;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.2s ease, background-color 0.2s ease;
	background-color: rgba(255, 255, 255, 0.5);
}

.upload-box:hover,
.upload-box.dragover {
	border-color: var(--link-color);
	background-color: rgba(224, 113, 69, 0.1);
}

.upload-icon {
	font-size: 64px;
	margin-bottom: 16px;
	opacity: 0.7;
}

.upload-text {
	font-size: 20px;
	font-weight: 700;
	color: var(--main-color);
	margin-bottom: 8px;
}

.upload-subtext {
	font-size: 14px;
	color: #888;
}

.upload-notice {
	font-size: 12px;
	color: #999;
	margin-top: 16px;
}

/* メッセージペイン */
.landing-message {
	text-align: left;
	color: var(--main-color);
	font-size: 14px;
	line-height: 1.8;
	max-width: 560px;
	width: 100%;
}

.landing-message ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.landing-message li {
	margin: 8px 0;
	padding-left: 1.5em;
	position: relative;
}

.landing-message li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.5em;
	width: 6px;
	height: 6px;
	background-color: var(--link-color);
	border-radius: 50%;
}

.landing-message .sub-list {
	margin-top: 4px;
	margin-left: 0;
}

.landing-message .sub-list li {
	font-size: 13px;
	color: var(--main-color);
	opacity: 0.85;
}

.landing-message .sub-list li::before {
	background-color: var(--main-color);
	opacity: 0.6;
	width: 4px;
	height: 4px;
}

.landing-message a {
	color: var(--link-color);
	text-decoration: none;
}

.landing-message a:hover {
	color: var(--hover-color);
	text-decoration: underline;
}

.landing-message .welcome-qr {
	font-size: 16px;
	font-weight: bold;
	color: var(--link-color);
	margin-bottom: 16px;
	text-align: center;
}

/* ======== エディター（画像読み込み後） ======== */

.editor-wrapper {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: #2a2a2a;
	overflow: hidden;
}

.canvas-container {
	width: 100%;
	height: 100%;
	overflow: hidden;
	position: relative;
	touch-action: none;
	cursor: grab;
}

.canvas-container.tool-eraser,
.canvas-container.tool-brush {
	cursor: crosshair;
}

.canvas-container.dragging {
	cursor: grabbing;
}

.display-canvas {
	position: absolute;
	top: 0;
	left: 0;
	will-change: transform;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* ======== ツールバー (左上オーバーレイ) ======== */

.toolbar {
	position: fixed;
	top: 16px;
	left: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px;
	background-color: rgba(99, 99, 99, 0.9);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-radius: 12px;
	z-index: 1000;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.toolbar-separator {
	height: 1px;
	background-color: rgba(0, 0, 0, 0.15);
	margin: 4px 0;
}

.toolbar-btn {
	width: 48px;
	height: 48px;
	border: 2px solid rgba(0, 0, 0, 0.2);
	border-radius: 10px;
	background-color: rgba(255, 255, 255, 0.9);
	font-size: 24px;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	font-family: inherit;
	line-height: 1;
}

.toolbar-btn:hover {
	background-color: #ffffff;
	border-color: var(--link-color);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.toolbar-btn.active {
	background-color: var(--link-color);
	border-color: var(--link-color);
	box-shadow: 0 2px 8px rgba(224, 113, 69, 0.5);
}

.toolbar-btn-primary {
	background-color: var(--link-color);
	color: white;
	border-color: var(--link-color);
}

.toolbar-btn-primary:hover {
	background-color: var(--hover-color);
	border-color: var(--hover-color);
}

/* ======== クリア / リロードボタン (右上固定) ======== */

.clear-btn {
	position: fixed;
	top: 16px;
	right: 16px;
	width: 48px;
	height: 48px;
	border: 2px solid rgba(0, 0, 0, 0.2);
	border-radius: 10px;
	background-color: rgba(255, 255, 255, 0.9);
	font-size: 20px;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	z-index: 1001;
	font-family: inherit;
}

.clear-btn:hover {
	background-color: #fff;
	border-color: var(--link-color);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ======== ステータスオーバーレイ ======== */

.status-overlay {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(40, 40, 40, 0.92);
	color: white;
	padding: 24px 32px;
	border-radius: 12px;
	text-align: center;
	z-index: 10000;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
	min-width: 220px;
}

.status-spinner {
	width: 32px;
	height: 32px;
	border: 3px solid rgba(255, 255, 255, 0.25);
	border-top-color: white;
	border-radius: 50%;
	animation: primob-spin 0.9s linear infinite;
	margin: 0 auto 12px;
}

@keyframes primob-spin {
	to { transform: rotate(360deg); }
}

.status-text {
	font-size: 14px;
	font-weight: 500;
	white-space: pre-line;
	line-height: 1.6;
}

/* ======== トースト ======== */

.toast-container {
	position: fixed;
	top: 24px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 10001;
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: center;
	pointer-events: none;
}

.toast {
	display: inline-block;
	width: fit-content;
	padding: 12px 24px;
	background-color: rgba(99, 99, 99, 0.95);
	color: white;
	border-radius: 8px;
	font-size: 14px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	opacity: 0;
	transition: opacity 0.2s ease;
	max-width: 80vw;
	text-align: center;
}

.toast.show {
	opacity: 1;
}

/* ======== レスポンシブ ======== */

@media (max-width: 600px) {
	.landing-title {
		font-size: 26px;
	}
	.landing-subtitle {
		font-size: 12px;
	}
	.upload-box {
		padding: 30px 30px;
	}
	.upload-icon {
		font-size: 48px;
	}
	.upload-text {
		font-size: 17px;
	}
	.toolbar-btn {
		width: 44px;
		height: 44px;
		font-size: 22px;
	}
	.clear-btn {
		width: 44px;
		height: 44px;
	}
}
