:root {
  --gap: 12px;
  --radius: 16px;
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --muted: #6b7280;
  --bg: #f8fafc;
  --white: #ffffff;
}
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: #111827;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  height: 100vh;
}

body {
  padding: 1.1rem;
  max-height: 100vw;
  overflow-y: hidden;
}

.container {
  display: flex;
  flex-direction: column; 
  justify-content: center; /* Centrerar allt innehåll (header, main, footer) vertikalt */
  text-align: initial; /* Återställer text-align för att undvika problem med header */
  height: 80vh;
  box-sizing: border-box;
  padding-top: 20vh;
}

header { padding: 20px; text-align: center; width: 100%; }
header h1 { margin: 0 0 6px 0; font-size: 20px; letter-spacing: 0.2px; }
header p { margin: 0; font-size: 14px; color: var(--muted); }

.scroller {
  padding: 16px;
  margin-right: calc(1rem - 16px);
  /*
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(to bottom, #ffffff, #fbfbfd);
  */
}
#row { display: flex; gap: 13px; }

.tile {
  scroll-snap-align: start;
  display: grid;
  grid-template-rows: 84px auto auto 1fr auto;
  width: 130px;
  min-width: 130px;
  height: 200px;
  padding: 10px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #eef2f7;
  -webkit-user-select: none;  /* Chrome, Safari, Opera */
  -moz-user-select: none;     /* Firefox */
  -ms-user-select: none;      /* IE 10+ */
  user-select: none;          /* Standard */
  -webkit-user-drag: none;    /* Chrome, Safari */
  user-drag: none;            /* Standard (kan behöva prefix) */
  -webkit-touch-callout: none; /* iOS Safari */
}

#row:last-child:after {
  content: ".";
  width: 2rem;
  height: 1rem;
  display: block;
  opacity: 0;
}

.pic {
  display: grid;
  place-items: center;
  width: 100%;
  height: 80px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 30%, #f1f5f9, #e7eef7);
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  max-width: 100%;
  max-height: 100%;
}

.pic img { 
  position: relative;
  top: -23px;
  display: block;
  height: 160px;
  clip-path: inset(0 0 57px 0);
  max-width: 100%;
}

.word {
  text-align: center;
  margin-top: 6px;
  cursor: pointer;
  user-select: none;
  height: 3rem;
  -webkit-user-select: none;  /* Chrome, Safari, Opera */
  -moz-user-select: none;     /* Firefox */
  -ms-user-select: none;      /* IE 10+ */
  user-select: none;          /* Standard */
  -webkit-user-drag: none;    /* Chrome, Safari */
  user-drag: none;            /* Standard (kan behöva prefix) */
  -webkit-touch-callout: none; /* iOS Safari */
}
.word .hl { font-weight: 800; 
  -webkit-user-select: none;  /* Chrome, Safari, Opera */
  -moz-user-select: none;     /* Firefox */
  -ms-user-select: none;      /* IE 10+ */
  user-select: none;          /* Standard */
  -webkit-user-drag: none;    /* Chrome, Safari */
  user-drag: none;            /* Standard (kan behöva prefix) */
  -webkit-touch-callout: none; /* iOS Safari */
}

.letters {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;  /* Chrome, Safari, Opera */
  -moz-user-select: none;     /* Firefox */
  -ms-user-select: none;      /* IE 10+ */
  user-select: none;          /* Standard */
  -webkit-user-drag: none;    /* Chrome, Safari */
  user-drag: none;            /* Standard (kan behöva prefix) */
  -webkit-touch-callout: none; /* iOS Safari */
}
.letters .upper { font-size: 42px;
  -webkit-user-select: none;  /* Chrome, Safari, Opera */
  -moz-user-select: none;     /* Firefox */
  -ms-user-select: none;      /* IE 10+ */
  user-select: none;          /* Standard */
  -webkit-user-drag: none;    /* Chrome, Safari */
  user-drag: none;            /* Standard (kan behöva prefix) */
  -webkit-touch-callout: none; /* iOS Safari */
 }
.letters .lower { font-size: 40px; 
  -webkit-user-select: none;  /* Chrome, Safari, Opera */
  -moz-user-select: none;     /* Firefox */
  -ms-user-select: none;      /* IE 10+ */
  user-select: none;          /* Standard */
  -webkit-user-drag: none;    /* Chrome, Safari */
  user-drag: none;            /* Standard (kan behöva prefix) */
  -webkit-touch-callout: none; /* iOS Safari */
}

.note {
  margin-top: 4px;
  text-align: center;
  font-size: 11px;
  color: #6b7280;
}

footer {
  padding: 16px 20px 28px;
  font-size: 12px;
  color: #6b7280;
  text-align: center;
}

@media (max-width: 480px) {
  :root { --tile-w: 120px; --tile-h: 200px; }
  .pic { font-size: 32px; }
}


img[src="/images/cards/moth.png"] {
  height: 50px;
  clip-path: none;
  top: 2px;
}

.word-as-is, .translation {
  margin: 1px 0;
}

.word-as-is {
  font-size: 20px;
}


.translation {
  font-size: 14px;
}
