From adca2464f89240ca60f5f85ab09f8059f0a1798b Mon Sep 17 00:00:00 2001 From: admin01 Date: Sun, 23 Aug 2026 07:36:35 +0000 Subject: [PATCH] Update chess/public/styles.css --- chess/public/styles.css | 1327 +++++++++++++++++++++++++++++++++------ 1 file changed, 1140 insertions(+), 187 deletions(-) diff --git a/chess/public/styles.css b/chess/public/styles.css index 4c7a4b5..f09ed9a 100644 --- a/chess/public/styles.css +++ b/chess/public/styles.css @@ -1,250 +1,1203 @@ :root { - --bg-body: #0f172a; - --bg-panel: rgba(30, 41, 59, 0.55); - --bg-input: rgba(15, 23, 42, 0.6); - --border-subtle: rgba(255, 255, 255, 0.12); - --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.08); - - --border-focus: #10b981; - --text-main: #f8fafc; - --text-muted: #94a3b8; - - --primary: #10b981; - --primary-hover: #059669; - - --secondary: rgba(255, 255, 255, 0.1); - --secondary-hover: rgba(255, 255, 255, 0.2); - - --board-light: #ebecd0; - --board-dark: #739552; - - --radius-sm: 4px; - --radius-md: 6px; - --radius-lg: 8px; + color-scheme: dark light; + + --bg-body: #0f172a; + --bg-panel: rgba(30, 41, 59, 0.72); + --bg-input: rgba(15, 23, 42, 0.72); + + --border-subtle: rgba(255, 255, 255, 0.12); + --border-strong: rgba(255, 255, 255, 0.2); + + --glass-shadow: + 0 8px 32px rgba(0, 0, 0, 0.28), + inset 0 1px 1px rgba(255, 255, 255, 0.06); + + --border-focus: #10b981; + + --text-main: #f8fafc; + --text-muted: #94a3b8; + --text-soft: #cbd5e1; + + --primary: #10b981; + --primary-hover: #059669; + + --secondary: rgba(255, 255, 255, 0.09); + --secondary-hover: rgba(255, 255, 255, 0.16); + + --danger: #ef4444; + + --board-light: #ebecd0; + --board-dark: #739552; + + --radius-sm: 5px; + --radius-md: 8px; + --radius-lg: 10px; + + --content-width: 1280px; } -* { box-sizing: border-box; margin: 0; padding: 0; } + +/* ========================================================= + LIGHT THEME +========================================================= */ + +@media (prefers-color-scheme: light) { + + :root { + --bg-body: #eef2f3; + --bg-panel: rgba(255, 255, 255, 0.78); + --bg-input: rgba(255, 255, 255, 0.82); + + --border-subtle: rgba(15, 23, 42, 0.12); + --border-strong: rgba(15, 23, 42, 0.2); + + --glass-shadow: + 0 8px 28px rgba(15, 23, 42, 0.12), + inset 0 1px 1px rgba(255, 255, 255, 0.7); + + --text-main: #172033; + --text-muted: #64748b; + --text-soft: #334155; + + --secondary: rgba(15, 23, 42, 0.06); + --secondary-hover: rgba(15, 23, 42, 0.11); + } + + body { + background-color: #eef2f3; + } + + .main-header h1, + h2, + h3 { + color: var(--text-main); + text-shadow: none; + } + + .piece.white { + color: #ffffff; + } + + input[type="text"], + select { + color: var(--text-main); + } + + input::placeholder { + color: rgba(15, 23, 42, 0.4); + } + + .mode-button.active { + color: var(--text-main); + } + + .secondary-button, + .icon-button { + color: var(--text-main); + } +} + + +/* ========================================================= + RESET +========================================================= */ + +*, +*::before, +*::after { + box-sizing: border-box; +} + +html { + min-height: 100%; + scroll-behavior: smooth; +} body { - background-color: var(--bg-body); - background-image: url('https://images.unsplash.com/photo-1529699211952-734e80c4d42b?q=80&w=2000&auto=format&fit=crop'); - background-size: cover; - background-position: center; - background-attachment: fixed; - color: var(--text-main); - font-family: 'Inter', sans-serif; - line-height: 1.5; - -webkit-font-smoothing: antialiased; - padding: 20px; - min-height: 100vh; + margin: 0; + min-height: 100vh; + + background-color: var(--bg-body); + + background-image: + linear-gradient( + rgba(15, 23, 42, 0.48), + rgba(15, 23, 42, 0.62) + ), + url("https://images.unsplash.com/photo-1529699211952-734e80c4d42b?q=70&w=1600&auto=format&fit=crop"); + + background-size: cover; + background-position: center; + background-attachment: fixed; + + color: var(--text-main); + + font-family: + Inter, + ui-sans-serif, + system-ui, + -apple-system, + BlinkMacSystemFont, + "Segoe UI", + Roboto, + Helvetica, + Arial, + sans-serif; + + line-height: 1.5; + + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + + padding: 20px; } -.hidden { display: none !important; } - -.page-shell { max-width: 1280px; margin: 0 auto; } - -.main-header { margin-bottom: 24px; text-align: left; } -.main-header h1 { - font-size: 28px; font-weight: 800; color: #fff; - display: flex; align-items: center; gap: 12px; - text-shadow: 0 2px 10px rgba(0,0,0,0.5); +button, +input, +select { + font: inherit; } -.chess-icon { color: var(--primary); font-size: 32px; } - -.app-grid { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; } - -.panel { - background: var(--bg-panel); - backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); - border: 1px solid var(--border-subtle); - border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--glass-shadow); -} -.panel-head { margin-bottom: 20px; } - -.label { - font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; - font-weight: 700; color: var(--text-muted); margin-bottom: 4px; -} -h3 { font-size: 18px; font-weight: 600; color: #fff; } -h2 { font-size: 20px; font-weight: 700; } button { - font-family: inherit; cursor: pointer; border: none; border-radius: var(--radius-sm); - font-weight: 600; font-size: 14px; transition: all 0.2s ease; - display: inline-flex; align-items: center; justify-content: center; - padding: 10px 16px; backdrop-filter: blur(4px); + cursor: pointer; } + +button:disabled { + cursor: not-allowed; + opacity: 0.55; +} + +.hidden { + display: none !important; +} + + +/* ========================================================= + PAGE +========================================================= */ + +.page-shell { + width: 100%; + max-width: var(--content-width); + margin: 0 auto; +} + +.main-header { + margin-bottom: 24px; + text-align: left; +} + +.main-header h1 { + margin: 0; + + display: flex; + align-items: center; + gap: 12px; + + font-size: clamp(24px, 3vw, 30px); + font-weight: 800; + + color: #fff; + + text-shadow: + 0 2px 10px rgba(0, 0, 0, 0.5); +} + +.chess-icon { + color: var(--primary); + font-size: 32px; + line-height: 1; +} + + +/* ========================================================= + MAIN GRID +========================================================= */ + +.app-grid { + display: grid; + grid-template-columns: minmax(0, 1fr) 360px; + gap: 24px; + align-items: start; +} + + +/* ========================================================= + PANELS +========================================================= */ + +.panel { + background: var(--bg-panel); + + backdrop-filter: blur(14px); + -webkit-backdrop-filter: blur(14px); + + border: 1px solid var(--border-subtle); + border-radius: var(--radius-lg); + + padding: 24px; + + box-shadow: var(--glass-shadow); +} + +.panel + .panel { + margin-top: 20px; +} + +.panel-head { + margin-bottom: 20px; +} + +.label { + margin: 0 0 4px; + + font-size: 12px; + text-transform: uppercase; + letter-spacing: 0.06em; + + font-weight: 700; + + color: var(--text-muted); +} + +h2, +h3 { + margin: 0; +} + +h2 { + font-size: 20px; + font-weight: 700; +} + +h3 { + font-size: 18px; + font-weight: 600; + color: var(--text-main); +} + + +/* ========================================================= + BUTTONS +========================================================= */ + +button { + border: none; + border-radius: var(--radius-sm); + + display: inline-flex; + align-items: center; + justify-content: center; + + padding: 10px 16px; + + font-size: 14px; + font-weight: 600; + + transition: + background-color 0.16s ease, + border-color 0.16s ease, + transform 0.16s ease, + box-shadow 0.16s ease; + + -webkit-tap-highlight-color: transparent; +} + +button:focus-visible, +input:focus-visible, +select:focus-visible { + outline: 2px solid var(--primary); + outline-offset: 2px; +} + .primary-button { - background-color: var(--primary); color: #fff; width: 100%; padding: 12px; - font-size: 15px; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); + width: 100%; + + padding: 12px; + + background: var(--primary); + color: #fff; + + font-size: 15px; + + box-shadow: + 0 4px 12px rgba(16, 185, 129, 0.25); } + .primary-button:hover { - background-color: var(--primary-hover); transform: translateY(-2px); - box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4); + background: var(--primary-hover); + transform: translateY(-1px); + + box-shadow: + 0 6px 16px rgba(16, 185, 129, 0.3); } -.secondary-button { background-color: var(--secondary); border: 1px solid var(--border-subtle); color: #fff; } -.secondary-button:hover { background-color: var(--secondary-hover); } -.ghost-button { background: transparent; color: #ff5c5c; border: 1px solid rgba(255, 92, 92, 0.5); width: 100%; } -.ghost-button:hover { background: rgba(255, 92, 92, 0.15); color: #ff7676; } - -.icon-button { background-color: var(--secondary); border: 1px solid var(--border-subtle); color: #fff; padding: 10px; } -.icon-button:hover { background-color: var(--secondary-hover); } - -.mode-switcher { - display: flex; background: rgba(0, 0, 0, 0.2); border-radius: var(--radius-sm); - padding: 4px; margin-bottom: 20px; border: 1px solid var(--border-subtle); +.secondary-button { + background: var(--secondary); + border: 1px solid var(--border-subtle); + color: var(--text-main); } -.mode-button { flex: 1; background: transparent; color: var(--text-muted); padding: 8px; border: none; } -.mode-button.active { background: var(--secondary-hover); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.2); } -.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; } -.field span { font-size: 13px; font-weight: 500; color: var(--text-muted); } -.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } - -input[type="text"], select { - width: 100%; background: var(--bg-input); border: 1px solid var(--border-subtle); - color: #fff; padding: 12px; border-radius: var(--radius-sm); font-family: inherit; - font-size: 14px; outline: none; transition: all 0.2s; +.secondary-button:hover { + background: var(--secondary-hover); + border-color: var(--border-strong); } -input[type="text"]:focus, select:focus { border-color: var(--border-focus); background: rgba(15, 23, 42, 0.8); } -input::placeholder { color: rgba(255,255,255,0.3); } -.join-row { display: flex; gap: 8px; } -.join-row input { flex: 1; } -.muted-copy { font-size: 12px; color: var(--text-muted); margin-top: 12px; text-align: center; } +.ghost-button { + width: 100%; + + background: transparent; + color: #ff5c5c; + + border: 1px solid rgba(255, 92, 92, 0.5); +} + +.ghost-button:hover { + background: rgba(255, 92, 92, 0.12); + color: #ff7676; +} + +.icon-button { + min-width: 42px; + + background: var(--secondary); + border: 1px solid var(--border-subtle); + + color: var(--text-main); +} + +.icon-button:hover { + background: var(--secondary-hover); +} + + +/* ========================================================= + HEADER TOOLBAR +========================================================= */ .board-toolbar { - display: flex; justify-content: space-between; align-items: center; - margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border-subtle); + display: flex; + justify-content: space-between; + align-items: center; + + gap: 16px; + + margin-bottom: 24px; + padding-bottom: 16px; + + border-bottom: 1px solid var(--border-subtle); } -.toolbar-actions { display: flex; gap: 8px; } + +.toolbar-actions { + display: flex; + gap: 8px; + flex-wrap: wrap; +} + + +/* ========================================================= + MODE SWITCHER +========================================================= */ + +.mode-switcher { + display: flex; + + padding: 4px; + margin-bottom: 20px; + + background: rgba(0, 0, 0, 0.16); + + border: 1px solid var(--border-subtle); + border-radius: var(--radius-sm); +} + +.mode-button { + flex: 1; + + padding: 8px; + + background: transparent; + color: var(--text-muted); + + border: none; +} + +.mode-button.active { + background: var(--secondary-hover); + color: var(--text-main); + + box-shadow: + 0 2px 8px rgba(0, 0, 0, 0.15); +} + + +/* ========================================================= + FORMS +========================================================= */ + +.field { + display: flex; + flex-direction: column; + gap: 8px; + + margin-bottom: 20px; +} + +.field span { + font-size: 13px; + font-weight: 500; + color: var(--text-muted); +} + +.field-grid { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 12px; +} + +input[type="text"], +select { + width: 100%; + + background: var(--bg-input); + + border: 1px solid var(--border-subtle); + border-radius: var(--radius-sm); + + color: var(--text-main); + + padding: 12px; + + outline: none; + + font-size: 14px; + + transition: + border-color 0.16s ease, + background-color 0.16s ease; +} + +input[type="text"]:focus, +select:focus { + border-color: var(--border-focus); +} + +input::placeholder { + color: rgba(255, 255, 255, 0.35); +} + +.join-row { + display: flex; + gap: 8px; +} + +.join-row input { + flex: 1; + min-width: 0; +} + +.muted-copy { + margin: 12px 0 0; + + font-size: 12px; + color: var(--text-muted); + + text-align: center; +} + + +/* ========================================================= + CHESS BOARD +========================================================= */ .board-stage { - width: 100%; max-width: 640px; margin: 0 auto; background: rgba(0, 0, 0, 0.2); - backdrop-filter: blur(8px); padding: 12px; border-radius: var(--radius-md); - box-shadow: inset 0 2px 10px rgba(0,0,0,0.5); border: 1px solid var(--border-subtle); + width: 100%; + max-width: 640px; + + margin: 0 auto; + + padding: 12px; + + background: rgba(0, 0, 0, 0.18); + + border: 1px solid var(--border-subtle); + border-radius: var(--radius-md); + + box-shadow: + inset 0 2px 10px rgba(0, 0, 0, 0.35); } .board { - width: 100%; aspect-ratio: 1 / 1; display: grid; - grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); - border: 4px solid rgba(15, 23, 42, 0.8); border-radius: var(--radius-sm); overflow: hidden; + width: 100%; + aspect-ratio: 1 / 1; + + display: grid; + + grid-template-columns: repeat(8, 1fr); + grid-template-rows: repeat(8, 1fr); + + overflow: hidden; + + border: 4px solid rgba(15, 23, 42, 0.8); + border-radius: var(--radius-sm); + + contain: layout paint; } -/* ========================================= - ИСПРАВЛЕННЫЕ СТИЛИ ДОСКИ И ФИГУР -========================================= */ .square { - width: 100%; height: 100%; border: none; padding: 0; margin: 0; - display: flex; align-items: center; justify-content: center; - cursor: pointer; position: relative; + width: 100%; + height: 100%; + + position: relative; + + display: flex; + align-items: center; + justify-content: center; + + padding: 0; + margin: 0; + + border: none; + + cursor: pointer; + + -webkit-tap-highlight-color: transparent; } -.square.light { background-color: var(--board-light); } -.square.dark { background-color: var(--board-dark); } +.square.light { + background-color: var(--board-light); +} -.square.selected { background-color: rgba(234, 230, 93, 0.7); } -.square.last-move { background-color: rgba(234, 230, 93, 0.4); } -.square.check-square { background-color: rgba(239, 68, 68, 0.6); } +.square.dark { + background-color: var(--board-dark); +} + +.square.selected { + background-color: rgba(234, 230, 93, 0.72); +} + +.square.last-move { + background-color: rgba(234, 230, 93, 0.42); +} + +.square.check-square { + background-color: rgba(239, 68, 68, 0.62); +} .square.legal-target::after { - content: ''; width: 25%; height: 25%; border-radius: 50%; - background-color: rgba(0, 0, 0, 0.25); position: absolute; + content: ""; + + position: absolute; + + width: 25%; + height: 25%; + + border-radius: 50%; + + background: rgba(0, 0, 0, 0.25); + + pointer-events: none; } + .square.capture-target::after { - content: ''; width: 80%; height: 80%; border-radius: 50%; - border: 5px solid rgba(0, 0, 0, 0.25); position: absolute; background: transparent; + content: ""; + + position: absolute; + + width: 80%; + height: 80%; + + border-radius: 50%; + + border: 5px solid rgba(0, 0, 0, 0.25); + + background: transparent; + + pointer-events: none; } .piece { - font-size: clamp(28px, 6vw, 65px); - user-select: none; z-index: 10; - line-height: 1; pointer-events: none; + position: relative; + z-index: 10; + + font-size: clamp(28px, 6vw, 65px); + + line-height: 1; + + user-select: none; + pointer-events: none; } -.piece.white { color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.6); } -.piece.black { color: #000; text-shadow: 0 2px 4px rgba(255,255,255,0.4); } + +.piece.white { + color: #fff; + + text-shadow: + 0 2px 4px rgba(0, 0, 0, 0.65); +} + +.piece.black { + color: #000; + + text-shadow: + 0 2px 4px rgba(255, 255, 255, 0.4); +} + + +/* ========================================================= + STATUS +========================================================= */ -/* ========================================= - СТАТУС И ЧАСЫ -========================================= */ .status-strip { - display: flex; justify-content: space-between; align-items: center; margin-top: 24px; - padding: 16px; background: var(--bg-panel); border: 1px solid var(--border-subtle); - border-radius: var(--radius-md); -} -.status-message { font-weight: 500; font-size: 15px; } -.status-meta { display: flex; gap: 8px; } -.status-chip { - padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; letter-spacing: 0.5px; -} -.turn-white { background: rgba(255, 255, 255, 0.9); color: #000; } -.turn-black { background: rgba(0, 0, 0, 0.8); color: #fff; border: 1px solid var(--border-subtle); } -.connection-solo { background: var(--secondary); color: #fff; } -.connection-party { background: var(--primary); color: #fff; } + display: flex; + justify-content: space-between; + align-items: center; -.roster-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 20px; } + gap: 16px; + + margin-top: 24px; + padding: 16px; + + background: var(--bg-panel); + + border: 1px solid var(--border-subtle); + border-radius: var(--radius-md); +} + +.status-message { + margin: 0; + + font-size: 15px; + font-weight: 500; +} + +.status-meta { + display: flex; + gap: 8px; + flex-wrap: wrap; + justify-content: flex-end; +} + +.status-chip { + padding: 4px 10px; + + border-radius: 20px; + + font-size: 12px; + font-weight: 600; + + letter-spacing: 0.4px; +} + +.turn-white { + background: rgba(255, 255, 255, 0.9); + color: #000; +} + +.turn-black { + background: rgba(0, 0, 0, 0.8); + color: #fff; + + border: 1px solid var(--border-subtle); +} + +.connection-solo { + background: var(--secondary); + color: var(--text-main); +} + +.connection-party { + background: var(--primary); + color: #fff; +} + + +/* ========================================================= + PLAYERS +========================================================= */ + +.roster-grid { + display: grid; + grid-template-columns: 1fr; + + gap: 12px; + + margin-bottom: 20px; +} + .roster-card { - background: rgba(0, 0, 0, 0.2); padding: 12px 16px; border-radius: var(--radius-sm); - display: flex; flex-direction: row; justify-content: space-between; align-items: center; - border: 1px solid var(--border-subtle); + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + + gap: 12px; + + padding: 12px 16px; + + background: rgba(0, 0, 0, 0.16); + + border: 1px solid var(--border-subtle); + border-radius: var(--radius-sm); +} + +.roster-card.white-player { + border-left: 4px solid rgba(255, 255, 255, 0.8); +} + +.roster-card.black-player { + border-left: 4px solid rgba(0, 0, 0, 0.8); +} + +.roster-info { + display: flex; + flex-direction: column; + gap: 2px; + + min-width: 0; +} + +.roster-role { + font-size: 11px; + + text-transform: uppercase; + + color: var(--text-muted); +} + +.roster-card strong { + font-size: 14px; + + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } -.roster-card.white-player { border-left: 4px solid rgba(255,255,255,0.8); } -.roster-card.black-player { border-left: 4px solid rgba(0,0,0,0.8); } -.roster-info { display: flex; flex-direction: column; gap: 2px; } -.roster-role { font-size: 11px; text-transform: uppercase; color: var(--text-muted); } -.roster-card strong { font-size: 14px; } .player-clock { - font-family: monospace, sans-serif; font-size: 20px; font-weight: 700; - background: rgba(0, 0, 0, 0.4); color: var(--text-main); padding: 6px 12px; - border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); - letter-spacing: 1px; transition: all 0.3s ease; min-width: 80px; text-align: center; -} -.player-clock.active { - background: rgba(16, 185, 129, 0.2); border-color: var(--primary); color: var(--primary); - box-shadow: 0 0 10px rgba(16, 185, 129, 0.3); -} -.player-clock.low { color: #ef4444; border-color: #ef4444; background: rgba(239, 68, 68, 0.1); } + min-width: 80px; -.spectator-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; } -.badge { background: var(--bg-input); border: 1px solid var(--border-subtle); padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; color: var(--text-muted); } -.spectator-list { list-style: none; font-size: 13px; color: var(--text-muted); } -.empty-state { font-style: italic; opacity: 0.7; } + padding: 6px 12px; + + background: rgba(0, 0, 0, 0.4); + + border: 1px solid var(--border-subtle); + border-radius: var(--radius-sm); + + color: var(--text-main); + + font-family: + ui-monospace, + SFMono-Regular, + Menlo, + Monaco, + Consolas, + monospace; + + font-size: 20px; + font-weight: 700; + + letter-spacing: 1px; + + text-align: center; + + transition: + border-color 0.2s ease, + background-color 0.2s ease; +} + +.player-clock.active { + background: rgba(16, 185, 129, 0.18); + + border-color: var(--primary); + + color: var(--primary); + + box-shadow: + 0 0 10px rgba(16, 185, 129, 0.25); +} + +.player-clock.low { + color: var(--danger); + + border-color: var(--danger); + + background: rgba(239, 68, 68, 0.1); +} + + +/* ========================================================= + SPECTATORS +========================================================= */ + +.spectator-header { + display: flex; + justify-content: space-between; + align-items: center; + + margin-bottom: 8px; +} + +.badge { + padding: 2px 8px; + + background: var(--bg-input); + + border: 1px solid var(--border-subtle); + border-radius: 12px; + + color: var(--text-muted); + + font-size: 11px; + font-weight: 600; +} + +.spectator-list { + margin: 0; + padding: 0; + + list-style: none; + + font-size: 13px; + color: var(--text-muted); +} + +.empty-state { + font-style: italic; + opacity: 0.7; +} + + +/* ========================================================= + MODAL +========================================================= */ .modal { - position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); - display: flex; align-items: center; justify-content: center; z-index: 1000; + position: fixed; + inset: 0; + + z-index: 1000; + + display: flex; + align-items: center; + justify-content: center; + + padding: 20px; + + background: rgba(0, 0, 0, 0.62); + + backdrop-filter: blur(6px); + -webkit-backdrop-filter: blur(6px); } + .modal-card { - background: var(--bg-panel); backdrop-filter: blur(20px); padding: 32px; - border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); - box-shadow: var(--glass-shadow); text-align: center; min-width: 300px; + width: min(100%, 420px); + + padding: 32px; + + background: var(--bg-panel); + + border: 1px solid var(--border-subtle); + border-radius: var(--radius-lg); + + box-shadow: var(--glass-shadow); + + text-align: center; } -.promotion-options { display: flex; gap: 16px; justify-content: center; margin-top: 24px; } + +.promotion-options { + display: flex; + justify-content: center; + + gap: 16px; + + margin-top: 24px; +} + .promotion-options button { - font-size: 32px; padding: 16px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border-subtle); color: #fff; + padding: 16px; + + background: rgba(0, 0, 0, 0.25); + + border: 1px solid var(--border-subtle); + + color: #fff; + + font-size: 32px; } -.promotion-options button:hover { background: var(--primary); border-color: var(--primary); } + +.promotion-options button:hover { + background: var(--primary); + border-color: var(--primary); +} + + +/* ========================================================= + TOAST +========================================================= */ .toast-host { - position: fixed; bottom: 20px; right: 20px; z-index: 9999; - display: flex; flex-direction: column; gap: 10px; -} -.toast { - background: var(--bg-panel); backdrop-filter: blur(10px); - padding: 12px 20px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); - color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 4px 12px rgba(0,0,0,0.3); - animation: slide-up 0.3s ease-out; -} -.toast.success { border-color: var(--primary); } -.toast.error { border-color: #ef4444; } + position: fixed; -@keyframes slide-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } + right: 20px; + bottom: 20px; + + z-index: 9999; + + display: flex; + flex-direction: column; + gap: 10px; + + max-width: min(420px, calc(100vw - 40px)); +} + +.toast { + padding: 12px 20px; + + background: var(--bg-panel); + + border: 1px solid var(--border-subtle); + border-radius: var(--radius-md); + + color: var(--text-main); + + font-size: 14px; + font-weight: 500; + + box-shadow: + 0 4px 12px rgba(0, 0, 0, 0.25); + + animation: slide-up 0.25s ease-out; +} + +.toast.success { + border-color: var(--primary); +} + +.toast.error { + border-color: var(--danger); +} + +@keyframes slide-up { + from { + opacity: 0; + transform: translateY(8px); + } + + to { + opacity: 1; + transform: translateY(0); + } +} + + +/* ========================================================= + FOOTER +========================================================= */ + +.site-footer { + margin-top: 28px; + padding: 22px 8px 8px; + + border-top: 1px solid var(--border-subtle); + + display: flex; + justify-content: center; +} + +.repository-link { + display: inline-flex; + align-items: center; + gap: 10px; + + padding: 8px 12px; + + color: var(--text-muted); + + text-decoration: none; + + border-radius: var(--radius-md); + + transition: + color 0.16s ease, + background-color 0.16s ease, + transform 0.16s ease; +} + +.repository-link:hover { + color: var(--text-main); + background: var(--secondary); + + transform: translateY(-1px); +} + +.repository-logo { + display: block; + + width: 34px; + height: 34px; + + object-fit: contain; + + border-radius: 7px; +} + +.repository-name { + font-size: 13px; + font-weight: 600; +} + + +/* ========================================================= + RESPONSIVE +========================================================= */ @media (max-width: 960px) { - .app-grid { grid-template-columns: 1fr; } - .board-toolbar { flex-direction: column; gap: 16px; align-items: stretch; } - .toolbar-actions { justify-content: stretch; } - .toolbar-actions button { flex: 1; } + + body { + padding: 14px; + } + + .app-grid { + grid-template-columns: 1fr; + } + + .board-toolbar { + flex-direction: column; + align-items: stretch; + } + + .toolbar-actions { + width: 100%; + } + + .toolbar-actions button { + flex: 1; + } +} + + +@media (max-width: 600px) { + + body { + padding: 10px; + } + + .main-header { + margin-bottom: 16px; + } + + .main-header h1 { + font-size: 24px; + } + + .chess-icon { + font-size: 28px; + } + + .panel { + padding: 16px; + } + + .app-grid { + gap: 14px; + } + + .board-stage { + padding: 6px; + } + + .board { + border-width: 3px; + } + + .piece { + font-size: clamp(25px, 11vw, 50px); + } + + .status-strip { + flex-direction: column; + align-items: stretch; + } + + .status-meta { + justify-content: flex-start; + } + + .field-grid { + grid-template-columns: 1fr; + gap: 0; + } + + .toolbar-actions { + display: grid; + grid-template-columns: 1fr 1fr; + } + + #copyInviteButton { + grid-column: span 2; + } + + .join-row { + flex-direction: column; + } + + .toast-host { + right: 10px; + bottom: 10px; + + max-width: calc(100vw - 20px); + } +} + + +@media (max-width: 380px) { + + .panel { + padding: 12px; + } + + .toolbar-actions { + grid-template-columns: 1fr; + } + + #copyInviteButton { + grid-column: auto; + } + + .player-clock { + min-width: 70px; + font-size: 17px; + } +} + + +/* ========================================================= + REDUCED MOTION +========================================================= */ + +@media (prefers-reduced-motion: reduce) { + + *, + *::before, + *::after { + scroll-behavior: auto !important; + animation-duration: 0.01ms !important; + animation-iteration-count: 1 !important; + transition-duration: 0.01ms !important; + } +} + + +/* ========================================================= + LOW POWER / TOUCH DEVICES +========================================================= */ + +@media (hover: none) { + + .primary-button:hover, + .secondary-button:hover, + .ghost-button:hover, + .icon-button:hover, + .repository-link:hover { + transform: none; + } }