/* Scrabble pour phpBB */

.scrabble-app {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: flex-start;
	margin: 10px 0;
}

.scrabble-main {
	flex: 1 1 520px;
	max-width: 640px;
}

.scrabble-side {
	flex: 1 1 240px;
	min-width: 220px;
}

.scrabble-meta {
	color: #666;
	font-size: 0.9em;
}

.scrabble-badge {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 6px;
	border-radius: 3px;
	background: #d31141;
	color: #fff;
	font-size: 0.85em;
}

.scrabble-badge.won { background: #2e8b57; }
.scrabble-badge.lost { background: #888; }

.scrabble-empty {
	padding: 8px 10px;
	font-style: italic;
}

.scrabble-actions {
	margin-top: 4px;
}

.scrabble-status {
	padding: 6px 10px;
	margin-bottom: 8px;
	border-radius: 4px;
	background: #ecf1f3;
	font-weight: bold;
	font-size: 1.1em;
}

.scrabble-status.mine { background: #d9f2d9; color: #1d5e1d; }
.scrabble-status.over { background: #fff2cc; }

/* Plateau */
.scrabble-board {
	display: grid;
	grid-template-columns: repeat(15, 1fr);
	gap: 2px;
	padding: 4px;
	background: #1f5f4a;
	border-radius: 6px;
	user-select: none;
	touch-action: none;
}

.scrabble-cell {
	position: relative;
	aspect-ratio: 1 / 1;
	background: #cfe3d6;
	border-radius: 2px;
	overflow: hidden;
}

.scrabble-cell.tw { background: #e0453a; }
.scrabble-cell.dw { background: #f4a6a1; }
.scrabble-cell.tl { background: #2f7fc1; }
.scrabble-cell.dl { background: #9fd0f0; }

.scrabble-cell.center::before {
	content: "\2605";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #a52a2a;
	font-size: 1.3em;
}

.scrabble-cell.tw::before { content: "MT"; }
.scrabble-cell.dw::before { content: "MD"; }
.scrabble-cell.tl::before { content: "LT"; }
.scrabble-cell.dl::before { content: "LD"; }

.scrabble-cell.tw::before,
.scrabble-cell.dw::before,
.scrabble-cell.tl::before,
.scrabble-cell.dl::before {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, 0.9);
	font-size: 0.6em;
	font-weight: bold;
}

.scrabble-cell.dw.center::before { content: "\2605"; color: #a52a2a; font-size: 1.3em; }

/* Tuiles */
.scrabble-tile {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(#fbe8c2, #f1d398);
	border: 1px solid #c8a660;
	border-radius: 3px;
	color: #222;
	font-weight: bold;
	cursor: default;
	z-index: 1;
}

.scrabble-tile .letter {
	font-size: 1.15em;
	line-height: 1;
}

.scrabble-tile .value {
	position: absolute;
	right: 2px;
	bottom: 1px;
	font-size: 0.55em;
	font-weight: normal;
}

.scrabble-tile.blank .letter { color: #b03030; }
.scrabble-tile.last { background: linear-gradient(#fff6b0, #f5df6a); }
.scrabble-tile.pending { background: linear-gradient(#d8f5d0, #a9e29a); border-color: #4a9a3a; cursor: grab; }

.scrabble-tile.dragging {
	position: fixed;
	z-index: 10000;
	pointer-events: none;
	opacity: 0.9;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Chevalet */
.scrabble-rack-zone {
	margin-top: 10px;
}

.scrabble-rack {
	display: flex;
	justify-content: center;
	gap: 6px;
	min-height: 48px;
	padding: 6px;
	background: #7a4f2a;
	border-radius: 6px;
	touch-action: none;
}

.scrabble-rack .scrabble-tile {
	width: 44px;
	height: 44px;
	font-size: 1.2em;
	cursor: grab;
}

.scrabble-rack .scrabble-tile.ghost {
	background: rgba(255, 255, 255, 0.15);
	border: 1px dashed rgba(255, 255, 255, 0.4);
	cursor: default;
}

.scrabble-rack .scrabble-tile.selected { outline: 3px solid #ffcc00; }
.scrabble-rack .scrabble-tile.exchange { outline: 3px solid #e0453a; transform: translateY(-4px); }

.scrabble-buttons {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin-top: 8px;
}

.scrabble-buttons .button-primary {
	font-weight: bold;
}

.scrabble-message {
	margin-top: 8px;
	min-height: 1.4em;
	text-align: center;
}

.scrabble-message.error { color: #bc2a4d; font-weight: bold; }
.scrabble-message.info { color: #105289; }

/* Colonne latérale */
.scrabble-scores {
	width: 100%;
	border-collapse: collapse;
}

.scrabble-scores td {
	padding: 4px;
	border-bottom: 1px solid #ddd;
}

.scrabble-scores tr.current td { background: #d9f2d9; font-weight: bold; }
.scrabble-scores tr.resigned td { text-decoration: line-through; opacity: 0.6; }
.scrabble-scores .score { text-align: right; white-space: nowrap; }
.scrabble-scores .tiles { text-align: right; white-space: nowrap; }
.scrabble-scores .crown { color: #d4a017; }

.scrabble-timer {
	margin-top: 6px;
	font-weight: bold;
}

.scrabble-timer.urgent { color: #d31141; }

.scrabble-history {
	max-height: 360px;
	overflow-y: auto;
	margin: 0;
	padding-left: 0;
	list-style: none;
}

.scrabble-history li {
	padding: 3px 0;
	border-bottom: 1px dotted #ccc;
}

.scrabble-history .bingo { color: #d31141; }

@media (max-width: 700px) {
	.scrabble-main { flex-basis: 100%; }
	.scrabble-tile .letter { font-size: 0.9em; }
	.scrabble-tile .value { display: none; }
	.scrabble-cell::before { font-size: 0.45em !important; }
	.scrabble-rack .scrabble-tile { width: 38px; height: 38px; }
}

/* Infobulles des boutons */
.scrabble-tip {
	position: relative;
	display: inline-block;
}

.scrabble-tip[data-tip]:hover::after,
.scrabble-tip[data-tip]:focus-within::after {
	content: attr(data-tip);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	z-index: 20;
	width: max-content;
	max-width: 220px;
	padding: 5px 8px;
	border-radius: 4px;
	background: #333;
	color: #fff;
	font-size: 11px;
	font-weight: normal;
	line-height: 1.3;
	text-align: center;
	white-space: normal;
	pointer-events: none;
}

.scrabble-tip[data-tip]:hover::before,
.scrabble-tip[data-tip]:focus-within::before {
	content: "";
	position: absolute;
	bottom: calc(100% + 2px);
	left: 50%;
	transform: translateX(-50%);
	z-index: 20;
	border: 6px solid transparent;
	border-top-color: #333;
	border-bottom: 0;
	pointer-events: none;
}

.scrabble-tip-left[data-tip]:hover::after,
.scrabble-tip-left[data-tip]:focus-within::after {
	left: auto;
	right: 0;
	transform: none;
	top: calc(100% + 8px);
	bottom: auto;
}

.scrabble-tip-left[data-tip]:hover::before,
.scrabble-tip-left[data-tip]:focus-within::before {
	display: none;
}

.scrabble-buttons .button[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Aperçu du score */
.scrabble-preview {
	min-height: 1.4em;
	margin-top: 6px;
	text-align: center;
	font-weight: bold;
}

.scrabble-preview.valid { color: #1d5e1d; }
.scrabble-preview.invalid { color: #a0522d; font-weight: normal; }

.scrabble-points-won {
	color: #b8860b;
	font-weight: bold;
}

/* Plein écran */
.scrabble-toolbar {
	display: flex;
	justify-content: flex-end;
	gap: 6px;
	margin-bottom: 6px;
}

.scrabble-fs-zone:fullscreen,
.scrabble-fs-zone.scrabble-fs {
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	padding: 10px;
	overflow: auto;
	background: #f5f7fa;
}

.scrabble-fs-zone.scrabble-fs {
	position: fixed;
	inset: 0;
	z-index: 9999;
}

html.scrabble-fs-lock,
html.scrabble-fs-lock body {
	overflow: hidden;
}

.scrabble-fs-zone:fullscreen .scrabble-app,
.scrabble-fs-zone.scrabble-fs .scrabble-app {
	flex-wrap: nowrap;
	justify-content: center;
	margin: 0;
}

/* Le plateau prend toute la hauteur disponible */
.scrabble-fs-zone:fullscreen .scrabble-main,
.scrabble-fs-zone.scrabble-fs .scrabble-main {
	flex: 0 1 auto;
	width: min(100%, calc(100vh - 240px));
	max-width: none;
}

.scrabble-fs-zone:fullscreen .scrabble-side,
.scrabble-fs-zone.scrabble-fs .scrabble-side {
	flex: 0 0 280px;
	max-height: calc(100vh - 70px);
	overflow-y: auto;
}

@media (max-width: 900px) {
	.scrabble-fs-zone:fullscreen .scrabble-app,
	.scrabble-fs-zone.scrabble-fs .scrabble-app {
		flex-wrap: wrap;
	}
	.scrabble-fs-zone:fullscreen .scrabble-main,
	.scrabble-fs-zone.scrabble-fs .scrabble-main {
		width: 100%;
	}
	.scrabble-fs-zone:fullscreen .scrabble-side,
	.scrabble-fs-zone.scrabble-fs .scrabble-side {
		flex-basis: 100%;
		max-height: none;
	}
}

/* Classement */
.scrabble-ranking td, .scrabble-ranking th { padding: 6px 4px; }
.scrabble-ranking tr.scrabble-me td { font-weight: bold; background: #e6f2e6; }
.scrabble-medal {
	display: inline-block;
	width: 22px;
	height: 22px;
	line-height: 22px;
	border-radius: 50%;
	color: #fff;
	font-weight: bold;
}
.scrabble-medal.gold { background: #d4a017; }
.scrabble-medal.silver { background: #9e9e9e; }
.scrabble-medal.bronze { background: #b0703c; }

.scrabble-seat { margin-bottom: 4px; }
.scrabble-invite { margin-left: 6px; }

/* Badges des parties (compétition, défi du jour) */
.scrabble-badge.comp { background: #4a6fa5; color: #fff; text-decoration: none; }

/* Encadrés du salon */
.scrabble-boxes {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 10px;
}
.scrabble-boxes > .panel {
	flex: 1 1 300px;
	margin-bottom: 0;
}
.scrabble-daily-ranking { margin: 6px 0 6px 22px; }
.scrabble-daily-ranking li { margin-bottom: 2px; }
.scrabble-daily-ranking li.scrabble-me, .scrabble-champions li.scrabble-me { font-weight: bold; }

/* Saisons */
.scrabble-seasons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	margin: 8px 0;
}
.scrabble-seasons .button.scrabble-active { border-color: #2e8b57; background: #e6f2e6; font-weight: bold; }
.scrabble-champions { margin-left: 18px; }

/* Compétitions */
.scrabble-comp-winner .inner { font-size: 1.2em; color: #8a6d00; }
.scrabble-rounds {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 10px 0;
}
.scrabble-round {
	flex: 1 1 200px;
	min-width: 180px;
}
.scrabble-bracket { flex-wrap: nowrap; overflow-x: auto; }
.scrabble-bracket .scrabble-round {
	display: flex;
	flex-direction: column;
	justify-content: space-around;
}
.scrabble-round h3 { margin-top: 0; }
.scrabble-match {
	border: 1px solid #ccc;
	border-radius: 6px;
	padding: 5px 8px;
	margin-bottom: 8px;
	background: #fff;
}
.scrabble-match.scrabble-me { border-color: #2e8b57; box-shadow: 0 0 0 1px #2e8b57; }
.scrabble-match > div { display: flex; justify-content: space-between; gap: 8px; }
.scrabble-match .winner { font-weight: bold; }
.scrabble-match .winner > :first-child::after { content: " ✓"; color: #2e8b57; }
.scrabble-match .score { font-weight: bold; }
.scrabble-match .score { color: #555; }

/* Succès */
.scrabble-progress {
	height: 10px;
	border-radius: 5px;
	background: #ddd;
	overflow: hidden;
	margin: 8px 0 14px;
}
.scrabble-progress > div { height: 100%; background: #2e8b57; }
.scrabble-achievements {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 10px;
}
.scrabble-ach {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #f6f6f6;
	opacity: 0.55;
	filter: grayscale(1);
}
.scrabble-ach.unlocked { opacity: 1; filter: none; background: #fffbea; border-color: #e0c060; }
.scrabble-ach .icon { font-size: 26px; color: #b8860b; width: 32px; text-align: center; }
.scrabble-ach strong, .scrabble-ach span { display: block; }

/* Discussion */
.scrabble-chat-list {
	list-style: none;
	margin: 0 0 6px;
	padding: 0;
	max-height: 180px;
	overflow-y: auto;
	word-wrap: break-word;
}
.scrabble-chat-list li { padding: 2px 0; border-bottom: 1px dotted #ddd; }
.scrabble-chat-list li.mine { background: #f2f8f2; }
.scrabble-chat-form { display: flex; gap: 4px; }
.scrabble-chat-form .inputbox { flex: 1; min-width: 0; }

/* Inviter des amis */
.scrabble-landing { text-align: center; padding: 20px 10px; }
.scrabble-landing h2 { margin-top: 12px; }
.scrabble-landing-list { list-style: none; margin: 10px 0 16px; padding: 0; }
.scrabble-landing-list li { margin: 4px 0; }
.scrabble-landing-list li::before { content: "✓ "; color: #2e8b57; font-weight: bold; }
.scrabble-landing-tiles { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; }
.scrabble-landing-tiles .scrabble-tile {
	position: relative;
	display: inline-block;
	width: 40px;
	height: 40px;
	line-height: 40px;
	font-size: 22px;
	font-weight: bold;
	color: #3b2a14;
	background: linear-gradient(#fbe9c3, #f0d49a);
	border-radius: 5px;
	box-shadow: 0 2px 0 #b8935a;
}
.scrabble-landing-tiles .scrabble-tile small { position: absolute; right: 3px; bottom: -10px; font-size: 9px; }
.button.scrabble-big { font-size: 1.2em; padding: 6px 16px; }

/* Entête commune (1.4) */
.scrabble-hero {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 18px;
	margin: 8px 0 0;
	padding: 16px 20px;
	border-radius: 8px 8px 0 0;
	background: #0d6b41 linear-gradient(135deg, #0a5534 0%, #11804f 55%, #0d6b41 100%);
	box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15);
	color: #fff;
}
.scrabble-hero-brand,
.scrabble-hero-brand:hover {
	display: flex;
	align-items: center;
	gap: 14px;
	color: #fff;
	text-decoration: none;
}
.scrabble-hero-tiles { display: flex; gap: 3px; }
.scrabble-hero-tiles span {
	position: relative;
	display: inline-block;
	width: 28px;
	height: 28px;
	line-height: 28px;
	text-align: center;
	font: bold 17px/28px Georgia, "Times New Roman", serif;
	color: #3b2a14;
	background: linear-gradient(#fbe9c3, #edcf91);
	border-radius: 4px;
	box-shadow: 0 2px 0 #9c7a45;
}
.scrabble-hero-tiles small { position: absolute; right: 2px; bottom: 0; font-size: 8px; line-height: 1; }
.scrabble-hero-name {
	font: bold 30px/1 Georgia, "Times New Roman", serif;
	letter-spacing: 1px;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.scrabble-hero-sub { flex: 1 1 220px; font-size: 1.05em; color: #d9f2e4; }
.scrabble-hero-info { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.scrabble-hero-pill {
	padding: 4px 10px;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.16);
	font-weight: bold;
	white-space: nowrap;
}
.scrabble-hero-pill.turn { background: #f5c542; color: #3b2a14; }
.scrabble-hero-pill .icon { color: inherit; }

.scrabble-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 14px;
	padding: 10px 12px;
	border: 1px solid #c9dfd2;
	border-top: 0;
	border-radius: 0 0 8px 8px;
	background: #eef6f1;
}
.scrabble-nav-btn,
.scrabble-nav-btn:visited {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border: 1px solid #0d6b41;
	border-radius: 20px;
	background: #fff;
	color: #0d6b41;
	font-size: 1.1em;
	font-weight: bold;
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
}
.scrabble-nav-btn:hover,
.scrabble-nav-btn:focus { background: #dcefe4; color: #0a5534; text-decoration: none; }
.scrabble-nav-btn.active,
.scrabble-nav-btn.active:hover { background: #0d6b41; color: #fff; }
.scrabble-nav-btn.share { margin-left: auto; border-color: #c98a00; background: #f5c542; color: #3b2a14; }
.scrabble-nav-btn.share:hover { background: #e8b52a; color: #3b2a14; }
.scrabble-nav-btn .icon { color: inherit; font-size: 1em; }

@media (max-width: 700px) {
	.scrabble-hero { padding: 12px; }
	.scrabble-hero-tiles span { width: 22px; height: 22px; font-size: 13px; line-height: 22px; }
	.scrabble-hero-name { display: none; }
	.scrabble-hero-info { margin-left: 0; }
	.scrabble-nav-btn { flex: 0 0 calc(50% - 4px); box-sizing: border-box; min-width: 0; justify-content: center; padding: 8px 6px; font-size: 1em; text-align: center; }
	.scrabble-nav-btn.share { margin-left: 0; }
}

/* Bloc « Recommandez le Scrabble » */
.panel.scrabble-share { border-left: 4px solid #0d6b41; background: #f3faf6; }
.scrabble-share h3 { color: #0d6b41; border-bottom-color: #c9dfd2; }
.scrabble-share h3 .icon { color: #d31141; }
.scrabble-share-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 10px; }
.scrabble-share-btn,
.scrabble-share-btn:visited {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border: 0;
	border-radius: 20px;
	background: #555;
	color: #fff;
	font-family: inherit;
	font-size: 1.05em;
	font-weight: bold;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}
.scrabble-share-btn:hover,
.scrabble-share-btn:focus { color: #fff; text-decoration: none; filter: brightness(0.9); }
.scrabble-share-btn .icon { color: #fff; font-size: 1.15em; }
.scrabble-share-btn.whatsapp { background: #25d366; }
.scrabble-share-btn.facebook { background: #1877f2; }
.scrabble-share-btn.x { background: #000; }
.scrabble-share-btn.telegram { background: #229ed9; }
.scrabble-share-btn.email { background: #0d6b41; }
.scrabble-share-btn.other { background: #6c757d; }
.scrabble-share-x { font-size: 1.1em; line-height: 1; }
.scrabble-share-link { display: flex; gap: 6px; align-items: center; }
.scrabble-share-link .inputbox { flex: 1 1 auto; min-width: 0; }
.scrabble-side .scrabble-share-btn { padding: 6px 10px; font-size: 1em; }
.scrabble-fs-zone:fullscreen .scrabble-share,
.scrabble-fs-zone.scrabble-fs .scrabble-share { display: none; }

/* Version 1.5 */
.scrabble-more { margin: 6px 10px 8px; text-align: right; }
.scrabble-filters { float: left; display: flex; flex-wrap: wrap; gap: 4px; }
.button.scrabble-active { background: #0d6b41; border-color: #0a5534; color: #fff; }
.button.scrabble-active span { color: #fff; }
a.scrabble-word { color: inherit; border-bottom: 1px dotted currentColor; text-decoration: none; }
a.scrabble-word:hover { color: #0d6b41; border-bottom-style: solid; }
.scrabble-status.replay { background: #eef6f1; border-color: #0d6b41; color: #333; }
.scrabble-daily-share { margin: 10px 0; padding: 10px 12px; border: 1px solid #c9dfd2; border-radius: 6px; background: #f3faf6; }
.scrabble-daily-share-text { margin: 0 0 8px; color: #333; font-family: inherit; font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

/* Encadré sur l'accueil du forum */
.scrabble-ib { margin: 10px 0; border: 1px solid #c9dfd2; border-radius: 8px; overflow: hidden; background: #f6fbf8; }
.scrabble-ib-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	padding: 8px 12px;
	background: #0d6b41 linear-gradient(135deg, #0a5534 0%, #11804f 55%, #0d6b41 100%);
	color: #fff;
}
.scrabble-ib-title, .scrabble-ib-title:hover { font: bold 20px/1 Georgia, "Times New Roman", serif; color: #fff; text-decoration: none; }
a.scrabble-hero-pill, a.scrabble-hero-pill:hover { color: #3b2a14; text-decoration: none; }
.scrabble-ib-play, .scrabble-ib-play:visited {
	margin-left: auto;
	padding: 5px 14px;
	border-radius: 16px;
	background: #f5c542;
	color: #3b2a14;
	font-weight: bold;
	text-decoration: none;
}
.scrabble-ib-play:hover { background: #e8b52a; color: #3b2a14; text-decoration: none; }
.scrabble-ib-play .icon { color: inherit; }
.scrabble-ib-body { display: flex; flex-wrap: wrap; gap: 0 24px; padding: 6px 12px 8px; }
.scrabble-ib-col { flex: 1 1 260px; }
.scrabble-ib-col h3 { margin: 6px 0 4px; color: #0d6b41; font-size: 1.05em; border-bottom: 1px solid #c9dfd2; }
.scrabble-ib-col p { margin: 3px 0; }
