/* ============================================================
 * Phrason — Floating Workspace
 * Adaptado do SwapVerbs CSS. Diferenças principais:
 * - Cada tema tem seu próprio hero (não uma cor única pro site inteiro)
 * - Área de trabalho tem 2 estados: foto temática (padrão) → textura
 *   cinza granulada (quando o usuário abre o primeiro exercício)
 * - 4 skill cards em vez de 4 registros
 * ============================================================ */

.ph-page * { box-sizing: border-box; }

.ph-page {
	position: relative;
	--ph-sky:        #4FC3E8;
	--ph-sky-light:  #7DD8F5;
	--ph-green:      #34C77B;
	--ph-green-light:#5EDB98;
	--ph-dark:       #070b0c;
	--ph-surface:    #0d1517;
	--ph-surface2:   #131f22;
	--ph-surface3:   #1a2a2d;
	--ph-border:     #1f3236;
	--ph-border2:    #2a4247;
	--ph-text:       #e2f2f0;
	--ph-text-dim:   #8fb0ad;
	--ph-text-muted: #536a68;
	font-family: 'DM Sans', sans-serif;
	background: var(--ph-surface);
	color: var(--ph-text);
}

/* ── TOP MENU ── */
.ph-top-menu { background: var(--ph-dark); border-bottom: 1px solid var(--ph-border); }
.ph-top-menu-inner { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; }
.ph-top-menu-logo { text-decoration: none; }
.ph-logo-text { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 900; color: var(--ph-sky); letter-spacing: -.5px; }
.ph-top-menu-nav { display: flex; gap: 22px; }
.ph-top-menu-nav a { color: var(--ph-text-dim); text-decoration: none; font-size: 13px; font-weight: 600; transition: color .15s; }
.ph-top-menu-nav a:hover { color: var(--ph-text); }

/* ── HERO — base (sobrescrito por variante de tema abaixo) ── */
.ph-hero {
	padding: 26px 28px 0;
	position: relative;
	overflow: hidden;
	background-color: var(--ph-dark);
	background-size: cover;
	background-position: center;
}
.ph-hero-content { max-width: 1000px; }

/* Badge / link do universo (equivalente ao sv-hero-cluster) */
.ph-hero-universe { margin-bottom: 14px; }
.ph-universe-link {
	display: inline-flex; align-items: center; gap: 6px;
	background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
	border-radius: 20px; padding: 4px 14px; font-size: 11px;
	color: var(--ph-sky-light); text-decoration: none;
	letter-spacing: .08em; text-transform: uppercase; font-weight: 700;
	transition: opacity .15s;
}
.ph-universe-link:hover { opacity: .75; }

/* H1 grande — headline fixo do site */
.ph-hero-title {
	font-family: 'Playfair Display', serif;
	font-size: clamp(34px, 5.2vw, 56px); font-weight: 900;
	background: linear-gradient(100deg, var(--ph-sky-light), var(--ph-green-light));
	-webkit-background-clip: text; background-clip: text; color: transparent;
	letter-spacing: -1px; line-height: 1.05; margin: 0;
}
/* H1 menor — nome do tema */
.ph-hero-theme {
	font-family: 'Playfair Display', serif;
	font-size: clamp(20px, 2.6vw, 28px); font-weight: 700;
	color: var(--ph-text); opacity: .85; margin: 6px 0 0; line-height: 1.2;
}
.ph-hero-subtitle { font-size: 15px; color: #cfe4e1; line-height: 1.6; margin: 14px 0 0; max-width: 640px; }

/* 4 skill cards */
.ph-skill-cards { display: flex; gap: 10px; margin: 22px 0 0; flex-wrap: wrap; }
.ph-skill-card {
	flex: 1; min-width: 150px; max-width: 260px; padding: 16px 16px 14px;
	border-radius: 12px; cursor: pointer;
	border: 1.5px solid rgba(255,255,255,.14); border-bottom: none;
	background: rgba(0,0,0,.28); backdrop-filter: blur(2px);
	transition: all .2s; position: relative; bottom: -1px;
}
.ph-skill-card:hover { background: rgba(0,0,0,.4); border-color: rgba(255,255,255,.28); }
.ph-skill-card.active { border-color: var(--ph-sky); background: rgba(79,195,232,.14); }
.ph-skill-card-label {
	font-family: 'Playfair Display', serif; font-size: 19px; font-weight: 700;
	color: #fff; margin-bottom: 4px;
}
.ph-skill-card-count { font-size: 11.5px; color: rgba(255,255,255,.55); margin-bottom: 10px; }
.ph-skill-card-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.14); overflow: hidden; }
.ph-skill-card-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--ph-sky), var(--ph-green)); transition: width .4s ease; }

/* ── VARIANTES DE HERO POR TEMA ───────────────────────────────────────── */

/* Space — preto profundo com estrelas espalhadas (tiling CSS, sem imagem) */
.ph-hero--space {
	background-color: #030305;
	background-image:
		radial-gradient(1.6px 1.6px at 20px 30px, #fff, transparent 100%),
		radial-gradient(1.2px 1.2px at 90px 80px, #fff, transparent 100%),
		radial-gradient(1px 1px at 140px 20px, rgba(255,255,255,.8), transparent 100%),
		radial-gradient(1.4px 1.4px at 170px 110px, #fff, transparent 100%),
		radial-gradient(1px 1px at 40px 140px, rgba(255,255,255,.7), transparent 100%),
		radial-gradient(1.8px 1.8px at 200px 60px, #fff, transparent 100%),
		radial-gradient(ellipse at 70% 30%, rgba(79,195,232,.12) 0%, transparent 60%);
	background-repeat: repeat, repeat, repeat, repeat, repeat, repeat, no-repeat;
	background-size: 220px 220px, 220px 220px, 220px 220px, 220px 220px, 220px 220px, 220px 220px, 100% 100%;
}

/* Oceans — azul profundo (cor extraída direto da foto de referência do
   tema, pra hero e área de trabalho ficarem no mesmo tom) */
.ph-hero--ocean {
	background-color: #001446;
	background-image:
		radial-gradient(ellipse at 50% 10%, rgba(0,60,140,.35) 0%, transparent 60%),
		linear-gradient(180deg, #001e5b 0%, #001446 60%, #000b28 100%);
}

/* Extremes — Himalaia: gradiente extraído direto da foto de referência
   (azul intenso no topo → azul mais claro perto do horizonte) */
.ph-hero--extremes {
	background: linear-gradient(180deg, #016acb 0%, #037ee2 100%);
}

/* Landscapes — deserto: gradiente extraído direto da foto de referência
   (azul mais forte no topo → azul mais claro perto do horizonte) */
.ph-hero--landscapes {
	background: linear-gradient(180deg, #0067c1 0%, #5cace4 100%);
}

/* ── WORKSPACE WRAPPER + TOOLBARS ──
 * A toolbar horizontal (.ph-fixed-toolbar) fica FORA deste wrapper — é uma
 * barra sticky de largura cheia. Este wrapper só contém a barra lateral
 * (esquerda) + a área de trabalho (direita). */
.ph-workspace-wrapper { display: flex; align-items: flex-start; }

.ph-fixed-toolbar {
	position: sticky; top: 0; z-index: 300; width: 100%;
	background: var(--ph-dark); border-top: 3px solid var(--ph-sky);
	border-bottom: 1px solid var(--ph-border);
	display: flex; align-items: center; padding: 0 20px; gap: 2px;
	box-shadow: 0 4px 20px rgba(0,0,0,.5); flex-wrap: wrap;
}
.ph-tb-skill-label {
	font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 700;
	color: var(--ph-sky-light); margin-right: 10px; white-space: nowrap; padding: 10px 0;
}
.ph-tb-sep { width: 1px; height: 28px; background: var(--ph-border); margin: 0 6px; }
.ph-tb-exercises { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
.ph-tb-btn {
	display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 7px;
	border: 1px solid transparent; background: transparent; color: rgba(226,242,240,.55);
	font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
	cursor: pointer; transition: all .15s; white-space: nowrap;
}
.ph-tb-btn:hover { background: rgba(255,255,255,.07); color: var(--ph-text); border-color: var(--ph-border); }
.ph-tb-btn.active { background: rgba(79,195,232,.12); color: var(--ph-sky-light); border-color: rgba(79,195,232,.35); }
.ph-tb-right { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.ph-tb-notes { color: rgba(94,219,152,.75) !important; }
.ph-tb-notes:hover { color: var(--ph-green-light) !important; background: rgba(52,199,123,.08) !important; }
.ph-tb-magnet.on { color: var(--ph-text) !important; background: rgba(255,255,255,.1) !important; border-color: rgba(255,255,255,.25) !important; }
.ph-tb-sweep { color: rgba(255,110,110,.7) !important; }
.ph-tb-sweep:hover { color: #ff8080 !important; background: rgba(255,80,80,.08) !important; }

.ph-side-toolbar {
	position: sticky; top: 60px; flex-shrink: 0; width: 130px;
	max-height: calc(100vh - 60px); overflow-y: auto;
	background: var(--ph-dark); border-right: 1px solid var(--ph-border);
	box-shadow: 4px 0 20px rgba(0,0,0,.5);
	display: flex; flex-direction: column; padding: 16px 10px; gap: 8px; z-index: 200;
}
.ph-side-toolbar-label {
	font-size: 10px; text-transform: uppercase; letter-spacing: .8px;
	color: rgba(226,242,240,.4); text-align: center; margin-bottom: 6px; font-weight: 600;
}
.ph-score-btn {
	display: flex; flex-direction: column; gap: 4px; padding: 10px 8px;
	border-radius: 9px; border: 1px solid var(--ph-border); background: rgba(255,255,255,.03);
	cursor: pointer; transition: all .18s;
}
.ph-score-btn:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.2); }
.ph-score-label { font-size: 11px; font-weight: 700; color: var(--ph-text); }
.ph-score-num { font-size: 11px; color: var(--ph-sky-light); font-weight: 600; }
.ph-score-retry { font-size: 10px; color: var(--ph-green-light); font-weight: 600; margin-top: 2px; }

/* ── WORKSPACE — foto temática (padrão) → cinza granulado (foco em exercício) ── */
.ph-workspace {
	flex: 1; min-width: 0; position: relative; min-height: 60vh; padding-bottom: 60px;
	background-color: #cfd2ce;
	background-image: var(--ph-ws-photo, none);
	background-size: cover; background-position: var(--ph-ws-photo-position, center);
	transition: background-color .5s ease;
}
/* Focada: a foto continua visível, mas "apagada" por um véu cinza-claro
   semi-transparente + a granulação por cima — mantém a ambientação do
   tema sem competir com as janelas de exercício abertas. */
.ph-workspace.ph-ws-focused {
	background-image:
		url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.10'/%3E%3C/svg%3E"),
		linear-gradient(rgba(226,226,223,.82), rgba(226,226,223,.82)),
		var(--ph-ws-photo, none);
	background-size: 200px 200px, cover, cover;
	background-position: center, center, center;
	background-repeat: repeat, no-repeat, no-repeat;
}

/* ── FLOATING WINDOWS ── */
.ph-win {
	display: none; position: absolute;
	width: 400px; height: 360px; min-width: 280px; min-height: 220px;
	background: #f4faf9; border-radius: 12px; border: 1px solid rgba(0,0,0,.12);
	box-shadow: 0 12px 36px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.3);
	flex-direction: column; overflow: hidden; z-index: 9000; color: #0e1f1c;
}
.ph-win.open { display: flex; }
.ph-win-bar {
	display: flex; align-items: center; gap: 7px; padding: 9px 12px;
	border-bottom: 1px solid rgba(0,0,0,.1); cursor: grab; user-select: none;
	flex-shrink: 0; background: #e4f2ef; border-top: 3px solid var(--ph-sky);
}
.ph-win-bar:active { cursor: grabbing; }
.ph-win-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ph-sky); flex-shrink: 0; }
.ph-win-title { font-family: 'Playfair Display', serif; font-size: 13px; font-weight: 700; color: #0e6e8c; }
.ph-win-ctrls { margin-left: auto; display: flex; gap: 3px; }
.ph-win-btn { background: rgba(0,0,0,.07); border: none; color: rgba(0,0,0,.4); font-size: 12px; width: 20px; height: 20px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.ph-win-btn:hover { background: rgba(0,0,0,.14); color: #0e1f1c; }
.ph-win-x:hover { background: rgba(220,50,50,.2); color: #cc2222; }
.ph-win-body { padding: 16px 18px; overflow-y: auto; flex: 1; font-size: 13.5px; }
.ph-win-resize { position: absolute; bottom: 0; right: 0; width: 16px; height: 16px; cursor: se-resize; background: linear-gradient(135deg,transparent 50%,rgba(0,0,0,.12) 50%); border-radius: 0 0 12px 0; }
.ph-win-loading, .ph-win-soon { color: rgba(0,0,0,.45); font-style: italic; padding: 20px 0; text-align: center; }

/* ── TELA DE ORIENTAÇÃO (intro + botão Start) ── */
.ph-win-intro {
	height: 100%; display: flex; flex-direction: column; align-items: center;
	justify-content: center; text-align: center; gap: 14px; padding: 10px 6px;
}
.ph-win-intro-title {
	font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700; color: #0e6e8c;
}
.ph-win-intro-desc { font-size: 13.5px; color: #3a4c49; line-height: 1.6; max-width: 300px; }
.ph-win-start-btn {
	margin-top: 6px; padding: 10px 26px; border-radius: 24px; border: none;
	background: linear-gradient(100deg, var(--ph-sky), var(--ph-green));
	color: #06231c; font-weight: 700; font-size: 13.5px; cursor: pointer;
	font-family: 'DM Sans', sans-serif; transition: transform .15s, box-shadow .15s;
	box-shadow: 0 4px 14px rgba(52,199,123,.3);
}
.ph-win-start-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(52,199,123,.4); }

/* Placar detalhado (score panel) */
.ph-win-score .ph-win-bar { border-top-color: var(--ph-green); }
.ph-score-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ph-score-list li { display: flex; justify-content: space-between; font-size: 13px; padding: 7px 10px; background: rgba(0,0,0,.04); border-radius: 7px; }

/* ── NOTES ── */
.ph-win.ph-win-notes { width: 380px; }
.ph-win.ph-win-notes .ph-win-bar { border-top-color: var(--ph-green); }
.ph-win.ph-win-notes .ph-win-body { display: flex; flex-direction: column; gap: 8px; }
.ph-notes-area {
	flex: 1; width: 100%; min-height: 180px; border: 1px solid rgba(0,0,0,.15); border-radius: 8px;
	padding: 12px; font-family: 'DM Sans', sans-serif; font-size: 14px; line-height: 1.6;
	color: #0e1f1c; background: #fff; resize: none; outline: none; box-sizing: border-box;
}
.ph-notes-area:focus { border-color: rgba(52,199,123,.5); }
.ph-notes-status { font-size: 11px; color: rgba(0,0,0,.4); min-height: 14px; }
.ph-notes-actions { display: flex; gap: 8px; }
.ph-notes-dl, .ph-notes-clear {
	display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 7px;
	font-size: 11px; font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all .15s;
}
.ph-notes-dl { background: rgba(52,199,123,.14); border: 1px solid rgba(52,199,123,.4); color: #0f5c34; }
.ph-notes-dl:hover { background: rgba(52,199,123,.24); }
.ph-notes-clear { background: rgba(0,0,0,.05); border: 1px solid rgba(0,0,0,.15); color: rgba(0,0,0,.45); }
.ph-notes-clear:hover { background: rgba(220,50,50,.12); border-color: rgba(220,50,50,.3); color: #aa2222; }

/* ── QUIZ ── */
.ph-qz-question { font-size: 1em; color: #0e1f1c; line-height: 1.7; margin-bottom: 14px; font-weight: 500; }
.ph-qz-counter { font-size: .72em; color: rgba(0,0,0,.4); }
.ph-qz-blank { display: inline-block; min-width: 80px; border-bottom: 2px solid var(--ph-sky); color: #0e6e8c; font-weight: 700; text-align: center; margin: 0 4px; }
.ph-qz-options { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.ph-qz-opt { padding: 9px 14px; border-radius: 8px; border: 1px solid rgba(0,0,0,.15); background: rgba(0,0,0,.03); color: #16302c; font-size: .9em; cursor: pointer; transition: all .18s; text-align: left; font-family: 'DM Sans', sans-serif; }
.ph-qz-opt:hover { border-color: var(--ph-sky); background: rgba(79,195,232,.08); }
.ph-qz-opt.correct { border-color: var(--ph-green); background: rgba(52,199,123,.14); color: #0f5c34; }
.ph-qz-opt.wrong { border-color: #ef4444; background: rgba(239,68,68,.1); color: #8a1010; }
.ph-qz-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; font-size: .8em; color: rgba(0,0,0,.5); }
.ph-qz-next { padding: 7px 16px; border-radius: 7px; background: rgba(79,195,232,.14); border: 1px solid rgba(79,195,232,.35); color: #0e6e8c; font-size: .85em; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all .15s; }
.ph-qz-next:hover { background: rgba(79,195,232,.24); }
.ph-qz-score { text-align: center; padding: 24px 0; }
.ph-qz-score-num { font-family: 'Playfair Display', serif; font-size: 2.4em; background: linear-gradient(100deg, var(--ph-sky), var(--ph-green)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ph-qz-score-label { font-size: .8em; color: rgba(0,0,0,.4); margin-top: 4px; }

/* ── COMPLEMENTARY TEXT ── */
.ph-comp-progress { font-size: .72em; color: rgba(0,0,0,.4); margin-bottom: 8px; }
.ph-comp-main {
	font-size: .96em; color: #0e1f1c; line-height: 1.7; margin-bottom: 16px;
	padding: 12px 14px; background: rgba(0,0,0,.04); border-radius: 8px;
	border-left: 3px solid var(--ph-sky);
}
.ph-comp-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.ph-comp-opt {
	display: flex; align-items: flex-start; gap: 10px; text-align: left;
	padding: 10px 14px; border-radius: 8px; border: 1px solid rgba(0,0,0,.15);
	background: rgba(0,0,0,.03); color: #16302c; font-size: .88em; line-height: 1.55;
	cursor: pointer; transition: all .18s; font-family: 'DM Sans', sans-serif;
}
.ph-comp-opt:hover { border-color: var(--ph-sky); background: rgba(79,195,232,.08); }
.ph-comp-opt.correct { border-color: var(--ph-green); background: rgba(52,199,123,.14); color: #0f5c34; }
.ph-comp-opt.wrong { border-color: #ef4444; background: rgba(239,68,68,.1); color: #8a1010; }
.ph-comp-opt-tag {
	flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
	background: rgba(0,0,0,.08); color: rgba(0,0,0,.5); font-size: 11px; font-weight: 700;
	display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.ph-comp-explanation {
	font-size: .82em; color: #4a5a58; line-height: 1.6; background: rgba(52,199,123,.08);
	border: 1px solid rgba(52,199,123,.25); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px;
}
.ph-comp-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .8em; color: rgba(0,0,0,.5); }
.ph-comp-score { flex-shrink: 0; }
.ph-comp-explain-btn, .ph-comp-next {
	padding: 6px 14px; border-radius: 7px; font-size: .85em; cursor: pointer;
	font-family: 'DM Sans', sans-serif; transition: all .15s;
}
.ph-comp-explain-btn { background: rgba(52,199,123,.12); border: 1px solid rgba(52,199,123,.3); color: #0f5c34; }
.ph-comp-explain-btn:hover { background: rgba(52,199,123,.22); }
.ph-comp-next { background: rgba(79,195,232,.14); border: 1px solid rgba(79,195,232,.35); color: #0e6e8c; margin-left: auto; }
.ph-comp-next:hover { background: rgba(79,195,232,.24); }

/* ── FOOTER ── */
.ph-footer { padding: 28px 20px 24px; background: var(--ph-dark); border-top: 1px solid var(--ph-border); text-align: center; }
.ph-footer-ecosystem { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; margin-bottom: 16px; }
.ph-footer-eco-label { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ph-text-muted); margin-right: 4px; }
.ph-footer-ecosystem a { color: var(--ph-text-dim); text-decoration: none; font-size: 12px; font-weight: 600; transition: color .15s; }
.ph-footer-ecosystem a:hover { color: var(--ph-sky-light); }
.ph-footer-nav { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin-bottom: 14px; }
.ph-footer-nav a { color: var(--ph-text-muted); text-decoration: none; font-size: 12px; transition: color .15s; }
.ph-footer-nav a:hover { color: var(--ph-sky-light); }
.ph-footer-copy { font-size: 11px; color: var(--ph-text-muted); }

.ph-win.snapping { transition: left .35s cubic-bezier(.4,0,.2,1), top .35s cubic-bezier(.4,0,.2,1); }

/* ============================================================
 * RESPONSIVE
 * ============================================================ */
@media (max-width: 900px) {
	.ph-workspace-wrapper { flex-direction: column; }
	.ph-side-toolbar { position: static; width: 100%; flex-direction: row; flex-wrap: wrap; max-height: none; }
}

@media (max-width: 768px) {
	.ph-hero { padding: 18px 16px 0; }
	.ph-skill-cards { gap: 6px; }
	.ph-skill-card { min-width: 130px; padding: 12px 10px 10px; }
	.ph-fixed-toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 0 12px; }
	.ph-fixed-toolbar::-webkit-scrollbar { display: none; }
	.ph-tb-btn { font-size: 11px; padding: 9px 8px; }
	.ph-tb-notes, .ph-tb-magnet { display: none !important; }

	.ph-win {
		position: fixed !important; left: 0 !important; bottom: 0 !important; top: auto !important;
		width: 100vw !important; max-width: 100vw !important; height: 72vh !important; max-height: 72vh !important;
		min-height: unset !important; border-radius: 16px 16px 0 0 !important;
		border-left: none !important; border-right: none !important; border-bottom: none !important;
		z-index: 9000 !important;
	}
	.ph-win-resize { display: none !important; }
}
