@font-face { font-family: 'W98'; src: url('../fonts/ms_sans_serif.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'W98'; src: url('../fonts/ms_sans_serif_bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --face: #c0c0c0;
  --hi: #ffffff;
  --lt: #dfdfdf;
  --sh: #808080;
  --dk: #0a0a0a;
  --navy: #000080;
  --title2: #1084d0;
  --desk: #008080;
  --z: 1; /* page zoom set by main.js; viewport units get zoomed too, so divide them by it */
  --raised: inset -1px -1px var(--dk), inset 1px 1px var(--lt), inset -2px -2px var(--sh), inset 2px 2px var(--hi);
  --btn: inset -1px -1px var(--dk), inset 1px 1px var(--hi), inset -2px -2px var(--sh), inset 2px 2px var(--lt);
  --btn-down: inset -1px -1px var(--hi), inset 1px 1px var(--dk), inset -2px -2px var(--lt), inset 2px 2px var(--sh);
  --sunken: inset -1px -1px var(--hi), inset 1px 1px var(--sh), inset -2px -2px var(--lt), inset 2px 2px var(--dk);
  --shallow: inset -1px -1px var(--hi), inset 1px 1px var(--sh);
  --thin-up: inset -1px -1px var(--sh), inset 1px 1px var(--hi);
  --checker: repeating-conic-gradient(var(--hi) 0 25%, var(--face) 0 50%) 0 0 / 2px 2px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.no-scroll, html.paint-max { overflow: hidden; }
html, body { margin: 0; }
body {
  background: var(--desk);
  color: #000;
  font: 11px/1.25 'W98', 'Microsoft Sans Serif', Tahoma, Geneva, sans-serif;
  -webkit-font-smoothing: none;
  font-smooth: never;
  user-select: none;
  -webkit-user-select: none;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
img, canvas { image-rendering: pixelated; }
[hidden] { display: none !important; }

/* ---------- controls ---------- */
button {
  font: inherit;
  color: #000;
  background: var(--face);
  border: 0;
  border-radius: 0;
  box-shadow: var(--btn);
  min-width: 75px;
  min-height: 23px;
  padding: 0 12px;
  cursor: default;
}
button:not(:disabled):active, button.pressed { box-shadow: var(--btn-down); }
button:not(:disabled):active > *, button.pressed > * { transform: translate(1px, 1px); }
button:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }
button:disabled { color: var(--sh); text-shadow: 1px 1px 0 var(--hi); }
button.danger b, button.danger { color: #800000; }

.field, input[type=text], select, textarea {
  background: #fff;
  box-shadow: var(--sunken);
  border: 0;
  border-radius: 0;
  font: inherit;
  color: #000;
}
input[type=text] { height: 21px; padding: 3px 4px; width: 100%; user-select: text; -webkit-user-select: text; }
input[type=text]:focus, select:focus { outline: none; }
select {
  height: 21px;
  padding: 2px 20px 2px 4px;
  appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17'%3E%3Crect width='16' height='17' fill='%23c0c0c0'/%3E%3Cpath d='M0 0h15v1H1v15H0z' fill='%23dfdfdf'/%3E%3Cpath d='M1 1h13v1H2v13H1z' fill='%23fff'/%3E%3Cpath d='M15 0h1v17H0v-1h15z' fill='%230a0a0a'/%3E%3Cpath d='M14 1h1v15H1v-1h13z' fill='%23808080'/%3E%3Cpath d='M4 7h7v1H4zm1 1h5v1H5zm1 1h3v1H6zm1 1h1v1H7z'/%3E%3C/svg%3E") no-repeat right 2px center;
}


/* ---------- windows ---------- */
.window {
  position: relative;
  background: var(--face);
  box-shadow: var(--raised);
  padding: 3px;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  min-height: 120px;
}
.window.minimized { display: none; }
.window.maximized { position: fixed !important; inset: 0 !important; width: auto !important; height: auto !important; min-height: 0 !important; margin: 0 !important; z-index: 10000; }
.window.opening { animation: win-open 0.12s steps(3) both; }
@keyframes win-open { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }

.title-bar {
  flex: none;
  height: 18px;
  padding: 0 2px 0 3px;
  display: flex; align-items: center; gap: 3px;
  background: linear-gradient(90deg, var(--sh), #b5b5b5);
  color: var(--face);
  touch-action: none;
}
.window.active .title-bar { background: linear-gradient(90deg, var(--navy), var(--title2)); color: #fff; }
.title-icon { width: 16px; height: 16px; flex: none; background-size: 16px 16px; image-rendering: pixelated; }
.title-text { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.2px; }
.title-controls { display: flex; flex: none; }
.title-controls button {
  width: 16px; height: 14px; min-width: 0; min-height: 0; padding: 0;
  background-repeat: no-repeat; background-position: center;
}
.title-controls button:active { background-position: calc(50% + 1px) calc(50% + 1px); }
.title-controls [data-act=close] { margin-left: 2px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='7'%3E%3Cpath d='M0 0h2v1h1v1h2V1h1V0h2v1H7v1H6v1H5v1h1v1h1v1h1v1H6V6H5V5H3v1H2v1H0V6h1V5h1V4h1V3H2V2H1V1H0z'/%3E%3C/svg%3E"); }
.title-controls [data-act=min] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='2'%3E%3Cpath d='M0 0h6v2H0z'/%3E%3C/svg%3E"); background-position: 4px 9px; }
.title-controls [data-act=min]:active { background-position: 5px 10px; }
.title-controls [data-act=max] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9'%3E%3Cpath fill-rule='evenodd' d='M9 0H0v9h9zM8 2H1v6h7z'/%3E%3C/svg%3E"); }
.window.maximized .title-controls [data-act=max] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='9'%3E%3Cpath fill='%23000' d='M2 0h6v6H6V5h1V2H3V1H2z M0 3h6v6H0z M1 5h4v3H1z' fill-rule='evenodd'/%3E%3C/svg%3E"); }

.resize-grip {
  position: absolute; right: 2px; bottom: 2px; width: 13px; height: 13px;
  cursor: nwse-resize; touch-action: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M11 0v1H10V0zM11 4v1H6V4zM11 8v1H2V8z' fill='%23fff'/%3E%3Cpath d='M11 1L1 11M11 5L5 11M11 9L9 11' stroke='%23808080' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right bottom;
}
.window.maximized .resize-grip { display: none; }

/* ---------- menus ---------- */
.menubar { flex: none; display: flex; padding: 1px 0; position: relative; }
.menu-top { padding: 2px 6px 3px; position: relative; cursor: default; }
.menu-top.open { background: var(--navy); color: #fff; }
.menu-drop {
  position: absolute; left: 0; top: 100%; z-index: 9000;
  min-width: 170px;
  background: var(--face); box-shadow: var(--raised); padding: 2px;
  color: #000;
}
.menu-item { display: flex; align-items: center; gap: 8px; padding: 3px 12px 3px 20px; white-space: nowrap; position: relative; }
.menu-item .accel { margin-left: auto; padding-left: 24px; }
.menu-item.checked::before { content: ''; position: absolute; left: 6px; top: 6px; width: 7px; height: 7px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7'%3E%3Cpath d='M6 0v2L3 5 1 3V1l2 2z'/%3E%3C/svg%3E"); }
.menu-item:not(.disabled):hover, .menu-item.hot { background: var(--navy); color: #fff; }
.menu-item.checked:hover::before { filter: invert(1); }
.menu-item.disabled { color: var(--sh); text-shadow: 1px 1px 0 var(--hi); }
.menu-item.disabled:hover { background: none; }
.menu-item.bold { font-weight: 700; }
.menu-sep { height: 2px; margin: 3px 1px; box-shadow: inset 0 1px var(--sh), inset 0 -1px var(--hi); }
u.mn { text-decoration: underline; }

/* ---------- paint ---------- */
.paint-toolbar {
  flex: none; display: flex; align-items: center; gap: 1px;
  padding: 2px 2px 3px;
  box-shadow: inset 0 1px var(--hi), inset 0 -1px var(--sh), 0 1px var(--hi);
  margin-bottom: 2px;
}
button.flat {
  width: 24px; height: 22px; min-width: 0; min-height: 0; padding: 0;
  box-shadow: none; background: transparent;
  display: grid; place-items: center;
}
button.flat:hover:not(:disabled) { box-shadow: var(--thin-up); }
button.flat:active:not(:disabled) { box-shadow: var(--shallow); }
button.flat:disabled img { filter: grayscale(1) opacity(0.4); }
.tb-sep { width: 2px; height: 18px; margin: 0 4px; box-shadow: inset 1px 0 var(--sh), inset -1px 0 var(--hi); }
.upload-btn {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 22px; padding: 0 10px 0 6px; margin-left: 2px;
}
.upload-btn b { font-weight: 700; }
.upload-btn .up-icon { width: 16px; height: 16px; background-size: 16px; }
.upload-btn.nudge { animation: nudge 1.6s steps(2) infinite; }
@keyframes nudge { 50% { background: #ffff80; } }

.paint-body { flex: 1; min-height: 0; display: flex; position: relative; }
.toolbox {
  flex: none; width: 58px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 2px 3px 2px 1px;
}
.tools { display: grid; grid-template-columns: 25px 25px; }
.tool {
  width: 25px; height: 25px; min-width: 0; min-height: 0; padding: 0;
  display: grid; place-items: center;
}
.tool.active { box-shadow: var(--btn-down); background: var(--checker); }
.tool.active img { transform: translate(1px, 1px); }
.tool-options {
  width: 44px; min-height: 68px;
  box-shadow: var(--shallow);
  padding: 3px 2px;
  display: flex; justify-content: center; align-items: flex-start;
}
.opts { display: grid; gap: 1px; }
.opt { display: block; }

.canvas-area {
  flex: 1; min-width: 0;
  background: var(--sh);
  box-shadow: var(--sunken);
  overflow: auto;
  padding: 5px 14px 14px 5px;
  position: relative;
}
.canvas-wrap { position: relative; }
.canvas-wrap canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.pm-main { background: #fff; }
.pm-overlay { touch-action: none; cursor: crosshair; }
.sel-frame { position: absolute; border: 1px dashed var(--navy); pointer-events: none; }
.resize-ghost { position: absolute; left: 0; top: 0; border: 1px dotted #000; pointer-events: none; }
.handle { position: absolute; width: 3px; height: 3px; background: var(--navy); touch-action: none; }
.handle::before { content: ''; position: absolute; inset: -7px; }
.handle[data-dir=r] { right: -4px; top: calc(50% - 1px); cursor: ew-resize; }
.handle[data-dir=b] { bottom: -4px; left: calc(50% - 1px); cursor: ns-resize; }
.handle[data-dir=rb] { right: -4px; bottom: -4px; cursor: nwse-resize; }
.text-box {
  position: absolute; z-index: 2;
  margin: 0; padding: 0; border: 0;
  outline: 1px dashed var(--navy);
  resize: none; overflow: hidden; white-space: pre;
  box-shadow: none;
  -webkit-font-smoothing: auto;
  user-select: text; -webkit-user-select: text;
}

.window-lite { background: var(--face); box-shadow: var(--raised); padding: 3px; }
.font-bar { position: absolute; right: 18px; top: 6px; z-index: 5; }
.fb-title { background: linear-gradient(90deg, var(--navy), var(--title2)); color: #fff; font-weight: 700; padding: 1px 4px; margin-bottom: 3px; }
.fb-row { display: flex; gap: 3px; align-items: center; }
.fb-family { width: 128px; }
.fb-size { width: 52px; }
.fb-btn { min-width: 0; width: 23px; height: 21px; padding: 0; }

.colorbox { flex: none; display: flex; align-items: flex-start; gap: 3px; padding: 4px 1px 1px; }
.cur-colors { width: 32px; height: 34px; position: relative; box-shadow: var(--sunken); background: var(--checker); flex: none; }
.cur-fg, .cur-bg { position: absolute; width: 15px; height: 15px; box-shadow: var(--shallow), inset 0 0 0 1px transparent; }
.cur-fg { left: 5px; top: 5px; z-index: 1; box-shadow: inset 1px 1px var(--sh), inset -1px -1px var(--hi); outline: 1px solid var(--face); }
.cur-bg { left: 13px; top: 14px; }
.palette { display: grid; grid-template-columns: repeat(14, 16px); grid-template-rows: 16px 16px; }
.swatch { width: 16px; height: 16px; box-shadow: var(--sunken); }
.color-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.statusbar { flex: none; display: flex; gap: 2px; margin-top: 2px; }
.status-field { box-shadow: var(--shallow); padding: 2px 4px 1px; min-width: 88px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 18px; }
.status-field.grow { flex: 1; min-width: 0; }


/* ---------- viewer ---------- */
.viewer-stage { flex: 1; min-height: 0; display: grid; place-items: center; background: var(--sh); overflow: hidden; padding: 6px; }
.viewer-stage img { max-width: 100%; max-height: 100%; background: #fff; box-shadow: 2px 2px 0 var(--dk); }
.viewer-meta { flex: none; padding: 5px 4px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-meta b { font-weight: 700; }
.viewer-bar { flex: none; display: flex; gap: 4px; padding: 3px 2px 2px; flex-wrap: wrap; }
.viewer-bar button { min-width: 64px; padding: 0 8px; }

/* ---------- dialogs ---------- */
#modal-layer:not(:empty) { position: fixed; inset: 0; z-index: 20000; }
.dialog { position: absolute; min-width: 300px; max-width: calc(100vw - 16px); }
.dialog .dlg-body { padding: 12px 10px 6px; display: flex; gap: 14px; align-items: flex-start; }
.dialog .dlg-icon { flex: none; width: 32px; height: 32px; }
.dialog .dlg-msg { white-space: pre-line; padding-top: 4px; line-height: 1.45; max-width: 380px; user-select: text; -webkit-user-select: text; }
.dialog .dlg-buttons { display: flex; justify-content: center; gap: 6px; padding: 8px 10px 8px; flex-wrap: wrap; }
.dialog .dlg-buttons.right { justify-content: flex-end; }
.form-grid { display: grid; grid-template-columns: auto 1fr; gap: 7px 8px; align-items: center; width: 100%; }
.form-grid label { white-space: nowrap; }
.save-as { display: flex; gap: 12px; padding: 10px 10px 2px; }
.save-as .preview { flex: none; width: 132px; height: 102px; display: grid; place-items: center; background: var(--sh); box-shadow: var(--sunken); }
.save-as .preview canvas { max-width: 124px; max-height: 94px; image-rendering: auto; box-shadow: 1px 1px 0 var(--dk); }
.save-as .fields { flex: 1; min-width: 0; }
.save-as .hint { color: var(--sh); margin-top: 8px; line-height: 1.4; }
.fake-select { display: flex; align-items: center; gap: 4px; height: 21px; padding: 0 4px; white-space: nowrap; overflow: hidden; }
.fake-select span.i { width: 16px; height: 16px; background-size: 16px; flex: none; }
.progress { height: 18px; box-shadow: var(--shallow); padding: 2px; margin: 4px 10px 0; display: flex; gap: 2px; overflow: hidden; }
.progress i { width: 9px; flex: none; background: var(--navy); }
.attr-row { display: flex; gap: 8px; align-items: center; }
.attr-row input { width: 64px; }


#balloon {
  position: fixed; right: 8px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 17000;
  width: 270px; background: #ffffe1; border: 1px solid #000; padding: 8px 24px 9px 10px;
  box-shadow: 2px 2px 0 rgba(0,0,0,.35);
  cursor: pointer;
}
#balloon .b-title { font-weight: 700; display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
#balloon .b-close { position: absolute; right: 4px; top: 4px; width: 14px; height: 14px; min-width: 0; min-height: 0; padding: 0; font-size: 9px; line-height: 1; }
#balloon .b-row { display: flex; gap: 8px; align-items: center; }
#balloon .b-row img { max-width: 60px; max-height: 44px; border: 1px solid var(--sh); image-rendering: auto; background: #fff; }

/* ---------- page ---------- */
main { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 0 16px 40px; }

.hero { text-align: center; padding: clamp(14px, 3vh, 26px) 16px 14px; }
.wordart {
  margin: 0;
  font: 400 clamp(50px, 9.5vw, 120px)/0.95 Impact, 'Haettenschweiler', 'Arial Narrow Bold', 'Arial Black', sans-serif;
  letter-spacing: 0.02em;
  position: relative;
  display: inline-block;
  transform: perspective(600px) rotateX(14deg) skewX(-6deg);
  transform-origin: 50% 100%;
  color: transparent;
}
/* WordArt: an extruded navy shadow layer, then the rainbow face on top */
.wordart::before, .wordart::after { content: attr(data-text); position: absolute; left: 0; top: 0; }
.wordart::before {
  color: #000080;
  -webkit-text-stroke: 2px #000080;
  text-shadow: 1px 1px 0 #000080, 2px 2px 0 #000080, 3px 3px 0 #000080, 4px 4px 0 #000080, 5px 5px 0 #000080,
    6px 6px 0 #000080, 7px 7px 0 #000080, 8px 8px 0 #000, 9px 9px 0 #000;
}
.wordart::after {
  color: transparent;
  background: linear-gradient(180deg, #ffff00 0%, #ffb000 30%, #ff3c00 55%, #ff00a0 78%, #8000ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 2px #000;
}
.tagline {
  margin: 10px 0 0;
  font: 700 clamp(14px, 2.2vw, 20px)/1.2 'Comic Sans MS', 'Comic Sans', 'Chalkboard SE', cursive;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  -webkit-font-smoothing: auto;
}
.hero-links { display: flex; justify-content: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.big-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 150px; height: 42px; padding: 0 18px 0 12px; justify-content: center;
  background: var(--face); box-shadow: var(--btn); color: #000; text-decoration: none;
  font-size: 15px; cursor: pointer;
}
.big-btn b { font-weight: 700; }
.big-btn:active { box-shadow: var(--btn-down); }
.big-btn:active > * { transform: translate(1px, 1px); }
.big-btn:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
.big-btn.buy { background: #ffff80; }
.big-btn.buy:hover { background: #ffff00; }
.big-btn:not(.buy):hover { background: #d4d4d4; }
.bb-icon { width: 32px; height: 32px; background-size: 32px; image-rendering: pixelated; flex: none; }
.ca-box {
  margin: 12px auto 0; width: min(560px, 100%);
  display: flex; align-items: center; gap: 6px;
  background: var(--face); box-shadow: var(--raised); padding: 5px 6px;
}
.ca-label { font-weight: 700; padding: 0 2px 0 4px; }
.ca-field {
  flex: 1; min-width: 0; height: 23px; padding: 4px 6px;
  font: 13px/15px 'Lucida Console', 'Courier New', monospace; -webkit-font-smoothing: auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--sh); text-align: left;
}
.ca-field.set { color: #000; cursor: copy; user-select: all; -webkit-user-select: all; }
#ca-copy { min-width: 64px; height: 23px; }
.online-line {
  margin: 10px auto 0; display: inline-flex; align-items: center; gap: 6px;
  background: var(--face); box-shadow: var(--btn); padding: 3px 10px 3px 8px;
}
.online-line .dot { width: 8px; height: 8px; background: #0c0; box-shadow: inset -1px -1px #060; animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

#win-paint { width: min(960px, 100%); height: clamp(440px, calc(100svh / var(--z) - 348px), 680px); }

.scroll-hint {
  color: #fff; text-decoration: none; font-weight: 700; text-shadow: 1px 1px 0 #000;
  padding: 6px 10px; animation: bob 1.4s steps(2) infinite;
}
@keyframes bob { 50% { transform: translateY(4px); } }

/* ---------- everyone's memes ---------- */
#memes { width: min(1480px, 100%); scroll-margin-top: 16px; min-height: 360px; }
.addressbar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 4px 6px; }
#gal-count { font-weight: 700; }
.live-pill { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--sh); }
.live-pill i { width: 8px; height: 8px; background: var(--sh); box-shadow: inset -1px -1px var(--dk); }
.live-pill.on { color: #800000; }
.live-pill.on i { background: #f00; animation: blink 1.2s steps(1) infinite; }

.meme-grid {
  padding: 22px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); align-content: start;
  gap: 30px 22px;
  min-height: 240px;
}
.meme-card {
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0; min-height: 0; padding: 0; background: none; box-shadow: none;
  text-align: left;
}
.meme-card:active { box-shadow: none; }
.meme-card .thumb {
  aspect-ratio: 4 / 3; width: 100%;
  display: grid; place-items: center;
  background: var(--face); box-shadow: var(--sunken); padding: 6px;
  overflow: hidden;
}
.meme-card .thumb img { max-width: 100%; max-height: 100%; display: block; background: #fff; image-rendering: auto; }
.meme-card .name { font-size: 14px; margin-top: 3px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px 3px; align-self: flex-start; max-width: 100%; }
.meme-card .by { font-size: 12px; display: flex; justify-content: space-between; gap: 8px; color: var(--sh); padding: 0 3px; }
.meme-card .by span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meme-card .when { flex: none; }
.meme-card:hover .name, .meme-card:focus-visible .name { background: var(--navy); color: #fff; }
.meme-card:hover .thumb { background: var(--checker); }
.meme-card:focus-visible { outline: 1px dotted #000; outline-offset: 2px; }
.meme-card.fresh .thumb { animation: fresh 0.5s steps(2) 5; }
@keyframes fresh { 50% { box-shadow: var(--sunken), 0 0 0 3px #ff0; } }
.meme-card > * { transform: none !important; }
.gallery-empty { grid-column: 1 / -1; text-align: center; color: var(--sh); padding: 50px 10px; font-size: 13px; }
.gallery-foot { text-align: center; padding: 10px 0 4px; color: #000; min-height: 24px; }

.page-foot { text-align: center; color: #fff; opacity: 0.8; padding: 0 16px 28px; text-shadow: 1px 1px 0 #000; }

/* ---------- viewer overlay ---------- */
.viewer-layer {
  position: fixed; inset: 0; z-index: 12000;
  display: grid; place-items: center; padding: 16px;
  background: repeating-conic-gradient(rgba(0,0,0,.55) 0 25%, transparent 0 50%) 0 0 / 2px 2px;
}
#win-viewer { width: min(760px, 100%); height: min(640px, 100%); }

/* ---------- phones ---------- */
@media (max-width: 720px) {
  main { padding: 0 8px 30px; }
  #win-paint { height: auto; }
  #win-paint .canvas-area { flex: 1 1 auto; max-height: 62svh; }
  .paint-toolbar { overflow-x: auto; }
  .upload-btn { margin-left: auto; }
  .font-bar { left: 64px; right: 4px; top: 4px; }
  .fb-family { width: auto; flex: 1; min-width: 0; }
  .colorbox { overflow-x: auto; }
  #st-help { display: none; }
  .status-field { flex: 1; }
  .meme-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 12px; }
  .dialog { left: 8px !important; right: 8px; min-width: 0; }
  .save-as { flex-direction: column; align-items: center; }
  .save-as .fields { width: 100%; }
  .viewer-layer { padding: 6px; }
  .title-controls [data-act=max] { display: none; }
}


/* ---------- hall of fame ---------- */
.hall { width: min(1200px, 100%); display: flex; flex-direction: column; align-items: center; padding-top: 22px; }
.wordart.small { font-size: clamp(38px, 6.5vw, 76px); }
.hall-grid { width: 100%; margin-top: 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.hall-card { min-width: 0; }
.hall-img { margin: 4px 2px 0; height: 230px; padding: 10px; background: #fff; }
.hall-img img { display: block; width: 100%; height: 100%; object-fit: contain; }
.hall-text { flex: 1; padding: 10px 8px 4px; font-size: 12px; line-height: 1.5; }
.hall-text h3 { margin: 0; font: 400 26px/1.1 Impact, 'Arial Black', sans-serif; letter-spacing: 0.02em; }
.hall-meta { margin: 3px 0 8px; color: #800000; font-weight: 700; }
.hall-text p { margin: 0 0 8px; }
.hall-actions { padding: 2px 8px 8px; }
.hall-next { color: #fff; text-shadow: 1px 1px 0 #000; font-weight: 700; margin: 18px 0 0; text-align: center; }

@media (max-width: 1100px) {
  .hall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 900px; }
}
@media (max-width: 640px) {
  .hall-grid { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
  .hall-img { height: 210px; }
}
