@import url('https://fonts.googleapis.com/css2?family=Patrick+Hand&display=swap');

:root {
  --board-columns: 24;
  --board-row-height: 40px;
  --gap: 6px;
  --text: #f5f5f5;
  --muted: #c7c7c7;
  --panel: rgba(0,0,0,.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #252525;
  color: var(--text);
  font-family: "Patrick Hand", "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.03), transparent 22%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.025), transparent 20%);
  background-size: cover;
  background-position: center;
}

.board {
  width: 100vw;
  min-height: 100vh;
  display: grid;
  grid-template-columns: repeat(var(--board-columns), minmax(0, 1fr));
  grid-auto-rows: var(--board-row-height);
  gap: var(--gap);
  padding: 8px;
}

.widget {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.06);
}

.widget-title {
  padding: 3px 8px;
  font-size: clamp(16px, 1.6vw, 30px);
  line-height: 1.1;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.widget-body {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.clock-time {
  font-size: clamp(44px, 7vw, 110px);
  line-height: .9;
  padding: 8px 14px 0;
}

.clock-date {
  color: var(--muted);
  font-size: clamp(18px, 2.1vw, 34px);
  padding: 4px 14px;
}

.text-widget {
  padding: 10px;
  font-size: clamp(18px, 2vw, 34px);
}

.widget-iframe {
  border: 0;
  display: block;
  background: transparent;
}

.json-value {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: clamp(26px, 4vw, 64px);
}

.is-error, .widget-error {
  color: #ff7b7b;
}

.fatal {
  position: fixed;
  inset: 20px;
  padding: 20px;
  background: #330000;
  color: white;
  font: 20px system-ui;
  z-index: 9999;
}


/* RichBoard v0.4: explicitly allow vertical scrolling when the grid
   is taller than the display viewport. */
html, body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  min-height: 100vh;
}

.board {
  min-height: 100vh;
  height: auto;
  padding-bottom: 40px;
}


/* RichBoard v0.6 ---------------------------------------------------------
   Default iframe widgets fill their allocated cell.
   Native-sized widgets keep their own dimensions with safe breathing room.
   ---------------------------------------------------------------------- */

.widget-iframe-fill {
  width: 100%;
  height: 100%;
}

.widget-body-native {
  overflow: hidden;
  padding: 8px;
}

.widget-body-center {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.widget-iframe-native {
  flex: 0 0 auto;
  max-width: none;
  max-height: none;
}

/* A single image can sit behind the entire board. */
body.has-board-background {
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Keep dashboard cells transparent so the same background reads through. */
.widget {
  background: rgba(0,0,0,.18);
}
