* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Segoe UI", sans-serif; background: #262421; color: #eee; min-height: 100vh; display: flex; align-items: center; justify-content: center; }

/* ==================== LOGO ==================== */
.logo-auth { width: 200px; height: auto; margin-bottom: 16px; }
.logo-lobby { height: 50px; width: auto; }
.logo-game { height: 40px; width: auto; margin-left: auto; }

/* ==================== AUTH ==================== */
#auth-screen { background: #312e2b; padding: 40px; border-radius: 16px; width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); text-align: center; }
#auth-screen p { color: #888; margin-bottom: 30px; }
.tabs { display: flex; margin-bottom: 24px; border-radius: 8px; overflow: hidden; border: 1px solid #3d3a37; }
.tab { flex: 1; padding: 12px; cursor: pointer; background: #3d3a37; color: #888; border: none; font-size: 0.95em; transition: all 0.2s; }
.tab.active { background: #81b64c; color: #fff; font-weight: bold; }
input { width: 100%; padding: 14px 16px; margin-bottom: 12px; background: #3d3a37; border: 1px solid #4d4a47; border-radius: 8px; color: #eee; font-size: 0.95em; outline: none; transition: border 0.2s; }
input:focus { border-color: #81b64c; }
button.btn-main { width: 100%; padding: 14px; background: #81b64c; color: #fff; border: none; border-radius: 8px; font-size: 1em; font-weight: bold; cursor: pointer; transition: background 0.2s; }
button.btn-main:hover { background: #6fa03e; }
.msg { margin-top: 14px; font-size: 0.9em; min-height: 20px; }
.msg.error { color: #ff6b6b; }
.msg.success { color: #81b64c; }

/* ==================== LOBBY ==================== */
#lobby-screen { display: none; width: 100%; max-width: 900px; padding: 20px; }

.lobby-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; padding: 16px 24px; background: #312e2b; border-radius: 12px; }
.lobby-header h1 { font-size: 1.4em; color: #81b64c; }
.lobby-user { display: flex; align-items: center; gap: 12px; }
.lobby-avatar { width: 40px; height: 40px; border-radius: 50%; background: #81b64c; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 1.1em; color: #fff; }
.lobby-username { font-weight: bold; font-size: 1em; }
.btn-logout { background: #4d4a47; color: #ccc; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 0.85em; transition: background 0.2s; }
.btn-logout:hover { background: #5d5a57; }

.lobby-content { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }

/* Games grid */
.lobby-section { background: #312e2b; border-radius: 12px; padding: 20px; }
.lobby-section h2 { font-size: 1.1em; color: #aaa; margin-bottom: 16px; text-transform: uppercase; font-size: 0.85em; letter-spacing: 1px; }

.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.game-card { background: #3d3a37; border-radius: 10px; padding: 20px; text-align: center; cursor: pointer; transition: all 0.2s; border: 2px solid transparent; }
.game-card:hover { border-color: #81b64c; transform: translateY(-2px); }
.game-card .game-icon { font-size: 2.5em; margin-bottom: 10px; }
.game-card .game-title { font-weight: bold; font-size: 1em; margin-bottom: 4px; }
.game-card .game-desc { color: #888; font-size: 0.8em; }

/* Sidebar (online + chat placeholder) */
.lobby-sidebar { display: flex; flex-direction: column; gap: 20px; }
.online-list { list-style: none; }
.online-list li { padding: 8px 0; display: flex; align-items: center; gap: 10px; font-size: 0.9em; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #81b64c; }
.online-count { color: #888; font-size: 0.8em; margin-bottom: 10px; }

.chat-placeholder { color: #666; font-size: 0.85em; text-align: center; padding: 30px 10px; }

/* ==================== GAME (chess) ==================== */
#game-screen { display: none; flex-direction: column; align-items: center; padding: 20px; }
.game-topbar { display: flex; align-items: center; width: 100%; max-width: 560px; margin-bottom: 16px; }
.btn-back { background: #3d3a37; color: #ccc; border: 1px solid #555; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 0.85em; transition: background 0.2s; }
.btn-back:hover { background: #4d4a47; }

.game-header { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 560px; margin-bottom: 12px; }
.player-info { display: flex; align-items: center; gap: 10px; background: #312e2b; padding: 10px 16px; border-radius: 8px; flex: 1; }
.player-avatar { width: 36px; height: 36px; border-radius: 50%; background: #81b64c; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 1em; color: #fff; }
.player-name { font-weight: bold; font-size: 0.95em; }
.player-rating { color: #888; font-size: 0.8em; }

/* BOARD */
.board-area { display: flex; align-items: center; gap: 6px; }
.coords-file { display: flex; flex-direction: column; justify-content: space-around; height: 520px; }
.coords-rank { display: flex; justify-content: space-around; width: 520px; margin-top: 2px; }
.coord { font-size: 0.7em; color: #888; width: 12px; text-align: center; }
#chess-board {
  display: grid; grid-template-columns: repeat(8, 65px); grid-template-rows: repeat(8, 65px);
  width: 520px; height: 520px;
  border-radius: 4px; overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.square { position: relative; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.square.light { background: #EBECD0; }
.square.dark  { background: #779556; }
.square.sel-light { background: #F6F669; }
.square.sel-dark  { background: #BACA2B; }
.square.lm-light  { background: #CDD16E; }
.square.lm-dark   { background: #AEBA50; }

.dot { position: absolute; width: 28%; height: 28%; background: rgba(0,0,0,0.18); border-radius: 50%; pointer-events: none; z-index: 2; }
.ring { position: absolute; inset: 0; border-radius: 0; background: radial-gradient(transparent 55%, rgba(0,0,0,0.18) 56%); pointer-events: none; z-index: 2; }

.sq-coord { position: absolute; font-size: 0.65em; font-weight: bold; line-height: 1; z-index: 1; }
.sq-coord.rank { top: 2px; left: 3px; }
.sq-coord.file { bottom: 2px; right: 3px; }
.square.light .sq-coord { color: #779556; }
.square.dark  .sq-coord { color: #EBECD0; }

.piece { width: 100%; height: 100%; background-size: 85%; background-repeat: no-repeat; background-position: center; z-index: 3; transition: transform 0.05s; }
.piece:hover { transform: scale(1.08); }

.game-footer { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 560px; margin-top: 12px; }

.controls { display: flex; gap: 8px; margin-top: 14px; }
.controls button { padding: 9px 18px; border: none; border-radius: 6px; cursor: pointer; font-size: 0.88em; font-weight: bold; }
#btn-new  { background: #81b64c; color: #fff; }
#btn-new:hover { background: #6fa03e; }
#btn-flip { background: #3d3a37; color: #ccc; border: 1px solid #555; }
#btn-flip:hover { background: #4d4a47; }

#status-box { margin-top: 10px; padding: 10px 20px; background: #312e2b; border-radius: 8px; font-size: 0.88em; color: #bbb; text-align: center; max-width: 560px; width: 100%; }
#status-box.check { color: #f5c518; font-weight: bold; }
#status-box.gameover { color: #e84c3d; font-weight: bold; }

/* ELO selector */
.elo-selector {
  display: flex; align-items: center; gap: 12px; margin-top: 12px;
  background: #312e2b; padding: 8px 20px; border-radius: 8px;
}
.elo-btn {
  background: #3d3a37; color: #ccc; border: 1px solid #555;
  width: 32px; height: 32px; border-radius: 6px;
  cursor: pointer; font-size: 0.9em; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.elo-btn:hover { background: #81b64c; color: #fff; border-color: #81b64c; }
.elo-label { font-weight: bold; font-size: 1em; color: #81b64c; min-width: 120px; text-align: center; }

/* Mode selector */
.chess-mode-bar { display: flex; gap: 6px; margin-bottom: 12px; }
.mode-btn {
  padding: 8px 16px; border: 1px solid #555; border-radius: 6px;
  background: #3d3a37; color: #999; cursor: pointer; font-size: 0.82em; font-weight: bold;
  transition: all 0.2s;
}
.mode-btn:hover { background: #4d4a47; color: #ccc; }
.mode-btn.active { background: #81b64c; color: #fff; border-color: #81b64c; }

/* Captured pieces */
.captured-zone {
  display: flex; flex-wrap: wrap; gap: 1px; align-items: center;
  min-height: 24px; margin-left: 12px; flex: 1;
}
.captured-zone img { width: 22px; height: 22px; opacity: 0.8; }
.material-score {
  font-size: 0.85em; font-weight: bold; color: #81b64c;
  min-width: 30px; text-align: right;
}

/* Sandbox palette */
.sandbox-palette {
  background: #312e2b; border-radius: 8px; padding: 12px 16px;
  margin-top: 10px; max-width: 560px; width: 100%;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.palette-label { color: #888; font-size: 0.82em; font-weight: bold; }
.palette-pieces { display: flex; gap: 2px; flex-wrap: wrap; }
.palette-piece {
  width: 36px; height: 36px; cursor: pointer; border-radius: 4px;
  border: 2px solid transparent; background-size: 80%; background-repeat: no-repeat;
  background-position: center; transition: all 0.15s;
}
.palette-piece:hover { background-color: #4d4a47; }
.palette-piece.selected { border-color: #81b64c; background-color: #3a4a30; }
.palette-piece.eraser {
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1em; color: #ff6b6b;
}
.palette-btn {
  padding: 6px 12px; border: 1px solid #555; border-radius: 6px;
  background: #3d3a37; color: #ccc; cursor: pointer; font-size: 0.78em; font-weight: bold;
  transition: all 0.2s;
}
.palette-btn:hover { background: #4d4a47; }
.palette-btn.palette-play { background: #81b64c; color: #fff; border-color: #81b64c; }
.palette-btn.palette-play:hover { background: #6fa03e; }
.palette-turn { display: flex; align-items: center; gap: 6px; color: #888; font-size: 0.78em; }
.palette-turn-btn {
  padding: 4px 10px; border: 1px solid #555; border-radius: 4px;
  background: #3d3a37; color: #ccc; cursor: pointer; font-size: 0.78em;
  transition: all 0.2s;
}
.palette-turn-btn.active { background: #81b64c; color: #fff; border-color: #81b64c; }

/* ==================== CHAT ==================== */
.chat-box { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 10px 0; max-height: 250px; min-height: 150px; }
.chat-msg { padding: 3px 0; font-size: 0.85em; line-height: 1.4; word-break: break-word; }
.chat-time { color: #555; font-size: 0.75em; }
.chat-author { color: #81b64c; font-weight: bold; }
.chat-author.chat-me { color: #f5c518; }
.chat-text { color: #ccc; }
.chat-input-row { display: flex; gap: 6px; margin-top: 8px; }
.chat-input-row input { flex: 1; padding: 10px 12px; margin-bottom: 0; }
.chat-input-row button { padding: 10px 16px; background: #81b64c; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; font-size: 0.85em; }
.chat-input-row button:hover { background: #6fa03e; }

/* ==================== OTHELLO ==================== */
#othello-screen { display: none; flex-direction: column; align-items: center; padding: 20px; }

.oth-player-bar {
  display: flex; align-items: center; gap: 12px;
  background: #282523; padding: 12px 18px; border-radius: 10px;
  width: 100%; max-width: 504px;
  border: 1px solid #3a3633;
  transition: all 0.3s ease;
}
.oth-player-bar.active { border-color: #81b64c; box-shadow: 0 0 12px rgba(129,182,76,0.15); }
.oth-score { font-size: 1.8em; font-weight: 800; min-width: 44px; text-align: center; color: #81b64c; transition: transform 0.2s; }
.oth-player-bar.active .oth-score { transform: scale(1.1); }

.disc-preview { width: 16px; height: 16px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.disc-preview.black { background: radial-gradient(circle at 35% 35%, #555, #1a1a1a); box-shadow: inset 0 1px 2px rgba(255,255,255,0.1); }
.disc-preview.white { background: radial-gradient(circle at 35% 35%, #fff, #c8c8c8); box-shadow: inset 0 -1px 2px rgba(0,0,0,0.1); }

.oth-board-wrap { margin: 14px 0; display: flex; flex-direction: column; align-items: center; }
.oth-board-container { display: flex; align-items: center; gap: 0; }
.oth-coords-col { display: flex; flex-direction: column; width: 22px; }
.oth-coords-col .coord-label { height: 56px; display: flex; align-items: center; justify-content: center; font-size: 0.72em; color: #555; font-weight: 600; user-select: none; }
.oth-coords-row { display: flex; height: 22px; margin-left: 22px; }
.oth-coords-row .coord-label { width: 56px; display: flex; align-items: center; justify-content: center; font-size: 0.72em; color: #555; font-weight: 600; user-select: none; }

#othello-board {
  display: grid; grid-template-columns: repeat(8, 56px); grid-template-rows: repeat(8, 56px);
  border-radius: 6px; overflow: hidden;
  box-shadow: 0 10px 50px rgba(0,0,0,0.7), inset 0 0 30px rgba(0,0,0,0.15);
  border: 3px solid #1e4a12;
  background: #2e8b2e;
}
.oth-cell {
  width: 56px; height: 56px;
  background: #2d8a2d;
  border: 1px solid rgba(0,0,0,0.15);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; transition: background 0.15s;
  background-image: radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.03) 0%, transparent 70%);
}
.oth-cell:hover { background-color: #36a036; }
.oth-cell.valid-move { cursor: pointer; }
.oth-cell.valid-move::after {
  content: ''; width: 16px; height: 16px; border-radius: 50%;
  background: rgba(129,182,76,0.45); box-shadow: 0 0 8px rgba(129,182,76,0.3);
  position: absolute; animation: oth-pulse 1.5s ease-in-out infinite;
}
@keyframes oth-pulse { 0%, 100% { transform: scale(1); opacity: 0.7; } 50% { transform: scale(1.2); opacity: 1; } }
.oth-cell.last-played { background-color: #3cb43c; box-shadow: inset 0 0 12px rgba(255,255,255,0.08); }

.oth-disc {
  width: 44px; height: 44px; border-radius: 50%; position: relative; z-index: 1;
}
.oth-disc.black {
  background: radial-gradient(circle at 38% 32%, #666, #2a2a2a 50%, #111 100%);
  box-shadow: 0 3px 8px rgba(0,0,0,0.6), inset 0 1px 3px rgba(255,255,255,0.15), inset 0 -2px 4px rgba(0,0,0,0.4);
}
.oth-disc.white {
  background: radial-gradient(circle at 38% 32%, #fff, #e8e8e8 40%, #bbb 100%);
  box-shadow: 0 3px 8px rgba(0,0,0,0.4), inset 0 1px 3px rgba(255,255,255,0.8), inset 0 -2px 4px rgba(0,0,0,0.15);
}
.oth-disc.new { animation: oth-placeDisc 0.25s ease-out; }
.oth-disc.flip { animation: oth-flipDisc 0.45s ease; }
@keyframes oth-placeDisc { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
@keyframes oth-flipDisc { 0% { transform: scaleX(1); } 50% { transform: scaleX(0.05); } 100% { transform: scaleX(1); } }

#oth-status {
  margin-top: 12px; padding: 10px 20px;
  background: #282523; border: 1px solid #3a3633;
  border-radius: 8px; font-size: 0.88em; color: #999;
  text-align: center; max-width: 504px; width: 100%;
}
#oth-status.highlight { color: #81b64c; font-weight: bold; border-color: #4a6a3a; }
#oth-status.gameover { color: #f5c518; font-weight: bold; border-color: #6a5a20; background: #2a2720; }

.oth-controls { display: flex; gap: 10px; margin-top: 14px; }
.oth-controls button { padding: 10px 20px; border: none; border-radius: 8px; cursor: pointer; font-size: 0.88em; font-weight: bold; transition: all 0.2s; }
#oth-btn-new { background: #81b64c; color: #fff; }
#oth-btn-new:hover { background: #6fa03e; }
#oth-btn-difficulty { background: #3d3a37; color: #ccc; border: 1px solid #555; }
#oth-btn-difficulty:hover { background: #4d4a47; }

/* ==================== PUISSANCE 4 ==================== */
#connect4-screen { display: none; flex-direction: column; align-items: center; padding: 20px; }

.c4-player-bar {
  display: flex; align-items: center; gap: 12px;
  background: #282523; padding: 12px 18px; border-radius: 10px;
  width: 100%; max-width: 504px;
  border: 1px solid #3a3633;
  transition: all 0.3s ease;
}
.c4-player-bar.active { border-color: #81b64c; box-shadow: 0 0 12px rgba(129,182,76,0.15); }

.c4-disc-preview { width: 16px; height: 16px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.c4-disc-preview.red { background: radial-gradient(circle at 35% 35%, #ff6b6b, #cc2233); }
.c4-disc-preview.yellow { background: radial-gradient(circle at 35% 35%, #ffe066, #e6b800); }

.c4-board-wrap { margin: 14px 0; display: flex; flex-direction: column; align-items: center; }

.c4-col-indicators { display: flex; gap: 0; margin-bottom: 4px; }
.c4-col-indicator {
  width: 64px; height: 24px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 4px; transition: background 0.15s;
}
.c4-col-indicator.active:hover { background: rgba(129,182,76,0.2); }
.c4-col-indicator.active:hover::after {
  content: ''; width: 0; height: 0;
  border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-top: 10px solid #81b64c;
}

#c4-board {
  display: grid; grid-template-columns: repeat(7, 64px); grid-template-rows: repeat(6, 64px);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 10px 50px rgba(0,0,0,0.7);
  border: 4px solid #1a3a8a;
  background: #1e3fa0;
}

.c4-cell {
  width: 64px; height: 64px;
  background: #2050b8;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
  transition: background 0.15s;
}
.c4-cell:hover { background: #2860cc; }

.c4-slot {
  width: 52px; height: 52px; border-radius: 50%;
  background: #1a1816;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 3px 8px rgba(0,0,0,0.5);
}

.c4-disc {
  width: 46px; height: 46px; border-radius: 50%;
  position: relative; z-index: 1;
}
.c4-disc.red {
  background: radial-gradient(circle at 38% 32%, #ff8888, #dd3344 45%, #aa1122 100%);
  box-shadow: 0 3px 8px rgba(0,0,0,0.5), inset 0 1px 3px rgba(255,255,255,0.3), inset 0 -2px 4px rgba(0,0,0,0.3);
}
.c4-disc.yellow {
  background: radial-gradient(circle at 38% 32%, #fff07a, #eec020 45%, #cc9900 100%);
  box-shadow: 0 3px 8px rgba(0,0,0,0.5), inset 0 1px 3px rgba(255,255,255,0.4), inset 0 -2px 4px rgba(0,0,0,0.2);
}
.c4-disc.drop { animation: c4-drop 0.35s ease-in; }
.c4-disc.win { animation: c4-win 0.6s ease-in-out infinite alternate; }

@keyframes c4-drop {
  0% { transform: translateY(-300px); opacity: 0.5; }
  70% { transform: translateY(8px); }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes c4-win {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(255,255,255,0); }
  100% { transform: scale(1.1); box-shadow: 0 0 16px rgba(255,255,255,0.4); }
}

#c4-status {
  margin-top: 12px; padding: 10px 20px;
  background: #282523; border: 1px solid #3a3633;
  border-radius: 8px; font-size: 0.88em; color: #999;
  text-align: center; max-width: 504px; width: 100%;
}
#c4-status.highlight { color: #81b64c; font-weight: bold; border-color: #4a6a3a; }
#c4-status.gameover { color: #f5c518; font-weight: bold; border-color: #6a5a20; background: #2a2720; }

.c4-controls { display: flex; gap: 10px; margin-top: 14px; }
.c4-controls button { padding: 10px 20px; border: none; border-radius: 8px; cursor: pointer; font-size: 0.88em; font-weight: bold; transition: all 0.2s; }
#c4-btn-new { background: #81b64c; color: #fff; }
#c4-btn-new:hover { background: #6fa03e; }
#c4-btn-difficulty { background: #3d3a37; color: #ccc; border: 1px solid #555; }
#c4-btn-difficulty:hover { background: #4d4a47; }

/* ==================== PICROSS ==================== */
#picross-screen { display: none; flex-direction: column; align-items: center; padding: 20px; }

.pic-puzzle-select { display: flex; gap: 8px; margin-bottom: 12px; }
.pic-puzzle-btn {
  padding: 8px 18px; border: 1px solid #555; border-radius: 6px;
  background: #3d3a37; color: #ccc; cursor: pointer; font-size: 0.85em; font-weight: bold;
  transition: all 0.2s;
}
.pic-puzzle-btn:hover { background: #4d4a47; }
.pic-puzzle-btn.active { background: #81b64c; color: #fff; border-color: #81b64c; }

.pic-board {
  display: grid;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  border: 2px solid #999;
  user-select: none;
}

.pic-corner { background: #d0d0d0; }

.pic-col-clue {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  background: #d0d0d0; padding: 2px 1px; gap: 1px;
  font-size: 0.65em; color: #333; font-weight: 600;
}
.pic-col-clue span { line-height: 1.2; }
.pic-col-clue .pic-clue-done { color: #bbb; }
.pic-col-clue.pic-clue-highlight { background: #e8e4c8; }
.pic-col-clue.pic-clue-highlight span { color: #997a00; }
.pic-col-clue.pic-clue-highlight .pic-clue-done { color: #c8b870; }

.pic-row-clue {
  display: flex; align-items: center; justify-content: flex-end;
  background: #d0d0d0; padding: 1px 4px; gap: 3px;
  font-size: 0.65em; color: #333; font-weight: 600;
}
.pic-row-clue span { line-height: 1; }
.pic-row-clue .pic-clue-done { color: #bbb; }
.pic-row-clue.pic-clue-highlight { background: #e8e4c8; }
.pic-row-clue.pic-clue-highlight span { color: #997a00; }
.pic-row-clue.pic-clue-highlight .pic-clue-done { color: #c8b870; }

.pic-cell {
  background: #fff;
  border: 1px solid #ccc;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.05s;
  position: relative;
}
.pic-cell:hover { background: #f0f0f0; }
.pic-cell.filled { background: #222; border-color: #111; }
.pic-cell.filled:hover { background: #333; }
.pic-cell.marked { background: #fff; }
.pic-cell.marked::before, .pic-cell.marked::after {
  content: ""; position: absolute;
  width: 60%; height: 1px; background: #aaa;
  top: 50%; left: 20%;
}
.pic-cell.marked::before { transform: rotate(45deg); }
.pic-cell.marked::after { transform: rotate(-45deg); }

.pic-cell.memo { background: #fff; }
.pic-cell.memo::after {
  content: ""; position: absolute;
  width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-bottom: 8px solid #e05050;
  top: 3px;
}

.pic-cell.pic-preview { background: #fff3b0; border-color: #e6c200; }
.pic-preview-num { font-size: 0.6em; font-weight: bold; color: #c89e00; line-height: 1; }

.pic-border-right { border-right: 2px solid #888 !important; }
.pic-border-bottom { border-bottom: 2px solid #888 !important; }

/* Mode buttons */
.pic-mode-bar { display: flex; gap: 8px; margin-top: 8px; margin-bottom: 8px; }
.pic-mode-btn {
  padding: 8px 18px; border: 2px solid #555; border-radius: 8px;
  background: #3d3a37; color: #ccc;
  cursor: pointer; font-size: 0.85em; font-weight: bold;
  transition: all 0.2s;
}
.pic-mode-btn:hover { background: #4d4a47; }
.pic-btn-memo.active { background: #e05050; color: #fff; border-color: #e05050; }
.pic-btn-clearmemo { background: #3d3a37; color: #999; }

#pic-status {
  margin-top: 12px; padding: 10px 20px;
  background: #282523; border: 1px solid #3a3633;
  border-radius: 8px; font-size: 0.88em; color: #999;
  text-align: center; max-width: 700px; width: 100%;
}
#pic-status.pic-win { color: #81b64c; font-weight: bold; border-color: #4a6a3a; }
#pic-status.pic-fail { color: #ff6b6b; font-weight: bold; border-color: #6a3a3a; }
.pic-puzzle-btn.pic-completed { position: relative; }
.pic-puzzle-btn.pic-completed::after { content: " \2713"; color: #81b64c; }

.pic-controls { display: flex; gap: 10px; margin-top: 14px; }
.pic-controls button {
  padding: 10px 20px; border: none; border-radius: 8px;
  cursor: pointer; font-size: 0.88em; font-weight: bold; transition: all 0.2s;
}
.pic-btn-reset { background: #81b64c; color: #fff; }
.pic-btn-reset:hover { background: #6fa03e; }
.pic-btn-undo { background: #3d3a37; color: #ccc; border: 1px solid #555; }
.pic-btn-undo:hover { background: #4d4a47; }
