/* Teema: palikkamainen "kuutiomaailma" – värit, perustyylit, napit ja dialogit. */
:root {
  --sky-top: #5aaef0;
  --sky-bottom: #bfe4ff;
  --grass: #5fae3a;
  --grass-dark: #3f7d25;
  --dirt: #8b5e3c;
  --dirt-dark: #5b3d26;
  --stone: #6b6b6b;
  --stone-dark: #474747;
  --plank: #c9a46a;
  --plank-dark: #8c6c3e;
  --gold: #ffd23f;
  --ink: #1e1408;
  --navy: #0d2a3f;
  --outline: #1b1b1b;
  --ok: #3fae3f;
  --hurry: #f2b705;
  --late: #d9412b;
  --c: #2e8b3a; /* lapsen oma väri, asetetaan näkymäkohtaisesti */
  --bevel: inset -6px -6px 0 rgba(0, 0, 0, .3), inset 6px 6px 0 rgba(255, 255, 255, .3);
  --font: "Segoe UI", Roboto, "Noto Sans", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; height: 100%; }

body {
  font-family: var(--font);
  font-weight: 700;
  color: var(--ink);
  background: linear-gradient(var(--sky-top), var(--sky-bottom));
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
}

#app {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  padding-bottom: 28px;
}

/* Nurmi- ja multakaistale ruudun alareunassa. */
.ground {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  z-index: 0;
  border-top: 3px solid var(--outline);
  background:
    linear-gradient(var(--grass) 0 8px, var(--grass-dark) 8px 11px, transparent 11px),
    repeating-linear-gradient(90deg, var(--dirt) 0 14px, var(--dirt-dark) 14px 18px, var(--dirt) 18px 30px, #74503a 30px 36px);
}

.block {
  border: 4px solid var(--outline);
  box-shadow: var(--bevel);
}

.btn {
  font: inherit;
  font-size: 26px;
  min-height: 72px;
  min-width: 72px;
  padding: 0 24px;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, .6);
  background: var(--stone);
  border: 4px solid var(--outline);
  box-shadow: var(--bevel);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}
.btn:active { transform: translateY(2px); box-shadow: inset 6px 6px 0 rgba(0, 0, 0, .3); }
.btn:disabled { opacity: .35; }
.btn.primary { background: var(--grass-dark); }
.btn.danger { background: #b3352a; }
.btn.small { min-height: 64px; min-width: 64px; font-size: 22px; padding: 0 16px; }
.btn.big { min-height: 88px; font-size: 34px; padding: 0 40px; }

.input {
  font: inherit;
  font-size: 22px;
  min-height: 64px;
  padding: 0 14px;
  border: 4px solid var(--outline);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  user-select: text;
  -webkit-user-select: text;
}

.chip {
  font: inherit;
  font-size: 22px;
  min-height: 64px;
  min-width: 64px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  border: 3px solid var(--outline);
  cursor: pointer;
}
.chip.selected { background: var(--gold); box-shadow: inset 0 0 0 3px var(--outline); }
.chip.emoji { font-size: 36px; padding: 0; }

.center-message {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--navy);
}
.center-message h2 { font-size: 52px; margin: 8px 0; }
.center-message p { font-size: 28px; margin: 0; }
.big-emoji { font-size: 150px; line-height: 1.1; }

/* Dialogit ja ilmoitukset */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .55);
}
.dialog { width: 100%; max-width: 640px; padding: 28px; background: var(--plank); }
.dialog.wide { max-width: 760px; }
.dialog-text { font-size: 30px; margin: 0 0 24px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 16px; justify-content: flex-end; align-items: center; }
.dialog-actions .input { width: 160px; }
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 72px);
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
  margin-bottom: 20px;
}
.emoji-grid .chip { height: 72px; }

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  padding: 16px 24px;
  font-size: 24px;
  color: #fff;
  background: #222;
}
