all repos — emchess @ e3439f4fd1351a66738e364bb3c2a16038ca6e6a

src/style.css (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
@font-face {
  font-family: "PxVGA";
  src: url("./fonts/WebPlus_IBM_VGA_8x16.woff") format("woff");
  font-display: swap;
}
@font-face {
  font-family: "PxSmall";
  src: url("./fonts/Web437_IBM_VGA_8x14.woff") format("woff");
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f5f1e6;
  --panel: #efe9d8;
  --ink: #1b1a15;
  --soft: #726b58;
  --line: #d6ccb2;
  --accent: #5f7a45;
  --light-sq: #eae1c6;
  --dark-sq: #bda06d;
  --sel: #d7cc9d;
  --check: #b24b43;
  --mono: "PxVGA", "Consolas", "Courier New", monospace;
  --small: "PxSmall", var(--mono);
  --sq: 62px;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: var(--paper); }

body {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

#app { max-width: 900px; margin: 0 auto; padding: 40px 22px 80px; }

a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--soft); }

button { font-family: inherit; font-size: inherit; color: inherit; cursor: pointer; background: none; border: none; padding: 0; }

.soft { color: var(--soft); }

@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }
.cursor { color: var(--accent); animation: blink 1.1s step-end infinite; }

/* Home — a text-mode title screen */

.home { padding-top: 40px; }
.home .logo {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: clamp(7px, 2.15vw, 15px);
  line-height: 1;
  color: var(--ink);
  white-space: pre;
  overflow-x: auto;
}
.home .kicker { color: var(--soft); margin: 0 0 40px; padding-left: 2px; }
.home .kicker::before { content: "// "; color: var(--accent); }

.menu { display: block; }
.menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 3px 0;
  letter-spacing: 1px;
}
.menu button::before { content: "  "; white-space: pre; color: var(--accent); }
.menu button:hover::before,
.menu button:focus-visible::before { content: "> "; }
.menu button:hover, .menu button:focus-visible { color: var(--accent); outline: none; }

/* Screen chrome */

.topbar { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 26px; }
.topbar h2 { margin: 0; font-family: var(--mono); font-size: 22px; font-weight: normal; }
.topbar h2::before { content: "# "; color: var(--accent); }
.back { color: var(--soft); }
.back:hover { color: var(--ink); }

/* Setup */

.setup { max-width: 560px; }
.field { margin-bottom: 30px; }
.field > label { display: block; color: var(--soft); margin-bottom: 10px; }
.field > label::before { content: ": "; color: var(--accent); }

.toggle { display: flex; gap: 4px; flex-wrap: wrap; }
.toggle button { padding: 2px 6px; color: var(--soft); }
.toggle button::before { content: "[ "; }
.toggle button::after { content: " ]"; }
.toggle button:hover { color: var(--ink); }
.toggle button[aria-pressed="true"] { color: var(--ink); }
.toggle button[aria-pressed="true"]::before { content: "[x "; color: var(--accent); }
.toggle button[aria-pressed="true"]::after { content: " ]"; color: var(--accent); }

/* Opponent list — a plain menu with dotted leaders, not cards */

.pick { display: block; }
.pick .row {
  display: flex;
  align-items: baseline;
  width: 100%;
  text-align: left;
  padding: 7px 0;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.pick .row:first-child { border-top: 1px solid var(--line); }
.pick .cur { width: 1ch; color: var(--accent); white-space: pre; }
.pick .face { font-family: system-ui, sans-serif; }
.pick .name { color: var(--ink); }
.pick .blurb { color: var(--soft); }
.pick .leader { flex: 1; border-bottom: 1px dotted var(--line); transform: translateY(-4px); }
.pick .row:hover .name { color: var(--accent); }
.pick .row[aria-pressed="true"] .cur::before { content: ">"; }
.pick .row[aria-pressed="true"] .name { color: var(--accent); }

@media (max-width: 560px) {
  .pick .blurb { display: none; }
}

.custom { margin-top: 10px; display: flex; gap: 18px; color: var(--soft); }
.custom.hidden { display: none; }
.custom input {
  width: 5ch;
  font-family: var(--mono);
  font-size: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 2px 4px;
}

.load {
  width: 100%;
  font-family: var(--small);
  font-size: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px;
  resize: vertical;
}

.start {
  margin-top: 10px;
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--ink);
}
.start::before { content: "> "; color: var(--accent); }
.start:hover { color: var(--accent); }
.start:hover::after { content: "_"; }

/* Play */

.play { display: grid; grid-template-columns: auto 240px; gap: 30px; align-items: start; }
@media (max-width: 720px) {
  .play { grid-template-columns: 1fr; }
  :root { --sq: min(11.4vw, 62px); }
}

.board-wrap { width: calc(var(--sq) * 8); }
.board {
  position: relative;
  width: calc(var(--sq) * 8);
  height: calc(var(--sq) * 8);
  border: 1px solid var(--ink);
  display: grid;
  grid-template-columns: repeat(8, var(--sq));
  grid-template-rows: repeat(8, var(--sq));
  user-select: none;
  touch-action: manipulation;
}

.sq { position: relative; display: flex; align-items: center; justify-content: center; }
.sq.light { background: var(--light-sq); }
.sq.dark { background: var(--dark-sq); }

.sq .coord { position: absolute; font-family: var(--small); font-size: 14px; line-height: 1; color: rgba(0,0,0,.4); }
.sq.dark .coord { color: rgba(255,255,255,.5); }
.sq .coord.file { right: 3px; bottom: 2px; }
.sq .coord.rank { left: 3px; top: 1px; }

.sq.last::before { content: ""; position: absolute; inset: 0; background: var(--sel); opacity: .5; mix-blend-mode: multiply; }
.sq.sel::after { content: ""; position: absolute; inset: 0; background: var(--sel); opacity: .7; mix-blend-mode: multiply; }
.sq.check::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, var(--check) 55%, transparent 72%); opacity: .5; }

.dot { position: absolute; width: 26%; height: 26%; border-radius: 50%; background: rgba(0,0,0,.24); pointer-events: none; }
.dot.capture { width: 82%; height: 82%; background: none; border: 3px solid rgba(0,0,0,.24); }

/* Pieces */

.piece {
  position: absolute;
  width: var(--sq);
  height: var(--sq);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, "Segoe UI Emoji", sans-serif;
  font-size: calc(var(--sq) * .64);
  line-height: 1;
  cursor: grab;
  z-index: 2;
  transition: transform .26s cubic-bezier(.2,.7,.25,1);
  will-change: transform;
}
.piece .glyph { position: relative; z-index: 2; }
/* Emoji share one glyph per type, so the light and dark armies are told apart by the
   token each piece rides on, not by the emoji's own colors. */
/* A grounding shadow plus a hairline light rim, so a mid-tone emoji (a grey wolf, say)
   still reads on the dark army's token without being darkened into it. */
.piece:not(.traditional) .glyph {
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)) drop-shadow(0 0 .5px rgba(255,255,255,.55));
}
.piece::before {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  z-index: 1;
}
.piece.w::before {
  background: radial-gradient(circle at 38% 32%, #fffdf6, #e7dcbe 78%);
  box-shadow: 0 2px 4px rgba(0,0,0,.22), inset 0 0 0 2px rgba(90,70,28,.5);
}
.piece.b::before {
  background: radial-gradient(circle at 38% 32%, #3b362a, #14110b 78%);
  box-shadow: 0 2px 4px rgba(0,0,0,.38), inset 0 0 0 2px rgba(243,238,220,.5);
}
.piece.traditional { font-family: var(--mono); font-size: calc(var(--sq) * .8); }
.piece.traditional.w { color: #fbf7ec; text-shadow: 0 0 1px #000, 0 1px 1px rgba(0,0,0,.45); }
.piece.traditional.b { color: #141109; }
.piece.traditional::before { display: none; }
.piece.dragging { z-index: 30; transition: none; cursor: grabbing; }
.piece.captured { transition: transform .2s ease, opacity .2s ease; opacity: 0; transform: scale(.4); }
.piece.hop .glyph { animation: hop .34s ease; }
@keyframes hop { 0% { transform: translateY(0); } 45% { transform: translateY(-24%); } 100% { transform: translateY(0); } }
.piece.threat::after {
  content: "";
  position: absolute;
  inset: 3%;
  border: 2px solid var(--check);
  border-radius: 50%;
  opacity: .9;
  z-index: 3;
  pointer-events: none;
}

.puff {
  position: absolute;
  width: var(--sq);
  height: var(--sq);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, "Segoe UI Emoji", sans-serif;
  font-size: calc(var(--sq) * .5);
  z-index: 20;
  pointer-events: none;
  animation: puff .48s ease forwards;
}
@keyframes puff { from { opacity: .8; transform: scale(.7); } to { opacity: 0; transform: scale(1.3); } }

.reaction {
  position: absolute;
  width: var(--sq);
  height: var(--sq);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, "Segoe UI Emoji", sans-serif;
  font-size: calc(var(--sq) * .42);
  z-index: 25;
  pointer-events: none;
  transition: transform .8s ease, opacity .8s ease;
}
.reaction.rise { transform: translateY(-40%); opacity: 0; }

/* Clocks */

.clocks { display: flex; flex-direction: column; gap: 6px; }
.clock {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 10px;
  border: 1px solid var(--line);
}
.clock .who { color: var(--soft); font-size: 14px; }
.clock .time { font-size: 26px; letter-spacing: 1px; }
.clock.running { border-color: var(--ink); }
.clock.low .time { color: var(--check); }
.clock.flag { opacity: .5; }

/* Assist + coach */

.assist { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.assist button { color: var(--soft); }
.assist button::before { content: "[ "; color: var(--line); }
.assist button::after { content: " ]"; color: var(--line); }
.assist button[aria-pressed="true"] { color: var(--accent); }
.assist button[aria-pressed="true"]::before { content: "[x "; color: var(--accent); }
.assist button:hover { color: var(--ink); }

.coach { min-height: 0; color: var(--ink); border-left: 2px solid var(--accent); padding-left: 12px; }
.coach:empty { display: none; }

/* Panel */

.panel { display: flex; flex-direction: column; gap: 20px; }
.status { min-height: 24px; }
.status .turn-dot { display: inline-block; width: .55em; height: .55em; margin-right: .4em; border: 1px solid var(--ink); }
.status .turn-dot.w { background: var(--paper); }
.status .turn-dot.b { background: var(--ink); }
.thinking { color: var(--accent); }

.moves { max-height: 260px; overflow-y: auto; font-family: var(--small); font-size: 14px; line-height: 18px; }
.moves ol { margin: 0; padding: 0; list-style: none; }
.moves li { display: grid; grid-template-columns: 2.4em 1fr 1fr; }
.moves .no { color: var(--soft); }
.moves .san.here { color: var(--accent); }

.controls { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.controls button { color: var(--soft); }
.controls button::before { content: "["; color: var(--line); }
.controls button::after { content: "]"; color: var(--line); }
.controls button:hover { color: var(--ink); }
.controls button:disabled { color: var(--line); cursor: default; }

/* Promotion */

.promo { position: absolute; z-index: 40; background: var(--paper); border: 1px solid var(--ink); display: flex; flex-direction: column; }
.promo button { width: var(--sq); height: var(--sq); font-family: system-ui, "Segoe UI Emoji", sans-serif; font-size: calc(var(--sq) * .6); }
.promo button:hover { background: var(--sel); }

/* About */

.about { max-width: 560px; line-height: 26px; }
.about .card { margin-top: 20px; padding-left: 14px; border-left: 2px solid var(--accent); }
.about .kill { margin-top: 26px; color: var(--accent); letter-spacing: 1px; }