/* Simple responsive CSS for the bingo app */
:root{
  --bg:#FFFFFF;
  --card:#fff;
  --accent:#004e84;
  --muted:#8ECD99;
  --success:#002640;
}

*{box-sizing:border-box}
html,body{height:100%;margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,'Helvetica Neue',Arial;color:#222;background:var(--bg)}
.container{max-width:920px;margin:24px auto;padding:16px}
h1{margin:0 0 12px;font-size:1.6rem}
.lead{color:var(--muted);margin-bottom:16px}
.buttons{
  display:flex;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
}
.logo{
  display:block;
  margin:0 auto;
  max-width:90%;
  height:auto;
}
.gif{
  display:block;
  margin:0 auto;
  max-width:80%;
  height:auto;
}

.btn{
  display:inline-block;
  padding:10px 14px;
  background:transparent;
  border:1px solid #cfd8e3;
  border-radius:8px;
  text-decoration:none;
  text-align: center;
  color:#004e84;
  cursor:pointer;
}

/* small screens */
@media (max-width: 500px) {
  .btn{
    display:block;
    width:90%;
    margin:0 auto;
    text-align: center;
  }
}

.btn.small{
  padding:6px 8px;
  font-size:0.9rem;
  text-align: center;
}

.btn.primary{
  background:var(--accent);
  color:#fff;
  border:none;
  text-align: center;
}

/* Pink variant used for the "Rules and Resources" CTA on the home page */
.btn.rules{
  background:#ec53a0;
  color:#fff;
  border:none;
  text-align:center;
}
.btn.rules:hover{
  background:#d8408d;
}

.row{display:flex;gap:8px;align-items:center}
.form label{display:block;margin-bottom:12px}
.form input{width:100%;padding:8px;border-radius:6px;border:1px solid #cbd5e1}
.form textarea{width:100%;padding:8px;border-radius:6px;border:1px solid #cbd5e1;font-family:inherit;resize:vertical}
.msg{margin-top:12px;color:var(--muted)}
.msg.error{color:#b00020}

/* board layout */
.board-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.board{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}
.cell{
  aspect-ratio:1/1;
  background:var(--card);
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px;
  text-align:center;
  cursor:pointer;
  border:1px solid #e6eef8;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition:transform .08s ease, background .12s ease;
  font-size:0.95rem;
}
.cell:hover{transform:translateY(-3px)}
.cell.linked{background:linear-gradient(90deg, rgba(143, 204, 153), rgba(143, 204, 153));border-color:rgba(40, 78, 132)}
.cell a{color:inherit;text-decoration:underline}
.modal{position:fixed;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,0.35);padding:16px}
.hidden{display:none}
.modal.hidden{display:none}
.modal-content{background:#fff;padding:16px;border-radius:12px;max-width:420px;width:100%}
.winners{display:flex;flex-direction:column;gap:12px}
.winner{background:var(--card);padding:12px;border-radius:10px;display:flex;gap:12px;align-items:flex-start}
.link{color:var(--accent);text-decoration:underline}

/* accessibility focus */
.cell:focus{outline:3px solid rgba(30,144,255,0.18)}

/* visually-hidden: accessible but not visible (for screen readers) */
.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

/* small-board / small-cell for winners and help pages */
.small-board {
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:4px;
  width:200px;
}

.small-cell {
  aspect-ratio:1/1;
  border-radius:6px;
  background:#f8fafc;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:0.7rem;
  padding:4px;
  overflow:hidden;
  text-overflow:ellipsis;
  position:relative;
  text-decoration: none;
  cursor:default;
}

/* Linked (completed) small-cell: green, clickable */
.small-cell.linked {
  background: linear-gradient(180deg, rgba(143, 204, 153), rgba(143, 204, 153));
  border: 1px solid rgba(40, 78, 132);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  cursor: pointer;
}

/* Anchor inside linked should fill the cell so clicking anywhere works */
.small-cell.linked > a {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* focus state for keyboard users */
.small-cell.linked > a:focus {
  outline: 3px solid rgba(255,255,255,0.25);
  outline-offset: 2px;
}

/* Anonymous winners: completed squares are shown green but the evidence
   URL and description are withheld, so the cell is not clickable and
   should not advertise itself as interactive. */
.small-cell.linked-anonymous {
  cursor: default;
}

/* Unlinked (no URL) small-cell: neutral color, not clickable but shows tooltip on hover */
.small-cell.unlinked {
  background: linear-gradient(180deg, #f1f5f9, #f8fafc);
  border: 1px solid #e6eef8;
  cursor: default;
}

/* On hover provide a subtle lift for discoverability */
.small-cell:hover {
  transform: translateY(-2px);
  transition: transform 0.12s ease;
}

@media (max-width:600px){
  .small-board{width:140px}
}

/* Home-page tagline that links to the rules page */
.tagline {
  display: block;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin: 14px auto 22px;
  padding: 8px 16px;
  max-width: 700px;
}
.tagline:hover {
  text-decoration: underline;
}

/* Institute badge next to a winner's name on the public Winners page.
   The colour comes from the server (see lib/store.js instituteForEmail). */
.institute {
  font-weight: 600;
  margin-left: 4px;
}

/* "Nx Bingo!" badge shown under the date on the Winners page when a winner
   has completed more than one line. */
.bingo-count {
  font-weight: 600;
  color: var(--accent);
  margin-top: 2px;
}

/* "SUPER BINGO!" badge — bold pink, only shown when all 25 squares are
   filled. Same family as .bingo-count but visually distinct. */
.super-bingo {
  font-weight: bold;
  color: #eb539f;
  margin-top: 2px;
  letter-spacing: 0.5px;
}

/* Home-page "How it works" block */
.intro {
  max-width: 700px;
  margin: 24px auto 28px;
  padding: 0 8px;
}
.intro h2 {
  color: var(--accent);
  border-bottom: 2px solid var(--muted);
  padding-bottom: 4px;
  margin-bottom: 12px;
  font-size: 1.15rem;
}
.intro ol {
  padding-left: 22px;
  line-height: 1.55;
}
.intro ol li {
  margin-bottom: 6px;
}
.intro .intro-more {
  margin-top: 14px;
  font-size: 0.95rem;
  color: #4b5563;
}
.intro .intro-more a {
  color: var(--accent);
}

/* Help page styles */
.help-section {
  margin-bottom: 32px;
}
.help-section h2 {
  color: var(--accent);
  border-bottom: 2px solid var(--muted);
  padding-bottom: 6px;
  margin-bottom: 12px;
}
.help-section ul {
  line-height: 1.8;
}
.help-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.help-cell {
  aspect-ratio: 1/1;
  background: var(--card);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  text-align: center;
  border: 1px solid #e6eef8;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: transform .08s ease, background .12s ease;
  font-size: 0.85rem;
  cursor: pointer;
}
.help-cell:hover {
  transform: translateY(-3px);
  background: linear-gradient(90deg, rgba(143, 204, 153, 0.3), rgba(143, 204, 153, 0.3));
}
.help-cell a {
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.help-cell a:hover {
  text-decoration: underline;
}

/* Auto-injected footer (see public/js/common.js) */
.app-footer {
  margin: 48px auto 24px;
  padding: 16px;
  text-align: center;
  color: #6b7280;
  border-top: 1px solid #e6eef8;
  max-width: 920px;
}
.app-footer a {
  color: var(--accent);
  text-decoration: none;
}
.app-footer a:hover {
  text-decoration: underline;
}

/* Privacy block on the registration form */
.privacy-block {
  margin: 16px 0;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e6eef8;
  border-radius: 8px;
  font-size: 0.92rem;
}
.privacy-block .privacy-summary {
  margin-top: 0;
  line-height: 1.45;
}
.privacy-block a {
  color: var(--accent);
}

/* Privacy notice page (privacy.html and translations) */
.privacy-page {
  max-width: 760px;
  margin: 24px auto;
  padding: 16px 20px 40px;
  line-height: 1.55;
}
.privacy-page h1 {
  margin-bottom: 4px;
}
.privacy-page .meta {
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.privacy-page h2 {
  color: var(--accent);
  border-bottom: 2px solid var(--muted);
  padding-bottom: 4px;
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 1.15rem;
}
.privacy-page ul {
  padding-left: 20px;
}
.privacy-page .lang-switcher {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-bottom: 12px;
  font-size: 0.9rem;
}
.privacy-page .lang-switcher a {
  color: var(--accent);
  text-decoration: none;
}
.privacy-page .lang-switcher a.active {
  font-weight: 600;
  text-decoration: underline;
}
.privacy-page address {
  font-style: normal;
  background: #f8fafc;
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  margin: 8px 0;
}
