* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
}

body {
  font-family: Arial, sans-serif;
  color: #202020;
  background:
    radial-gradient(circle at top left, #fff4a3, transparent 35%),
    radial-gradient(circle at bottom right, #ffd6e7, transparent 35%),
    linear-gradient(135deg, #f7fbff, #fff5f8);
  overflow: hidden;
}

button {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button:active {
  transform: scale(0.96);
}

.hidden {
  display: none !important;
}

.app {
  width: 100vw;
  height: 100dvh;
}

/* START */

.start-screen {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 20px;
}

.start-card {
  width: min(900px, 94vw);
  min-height: min(580px, 86vh);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: 36px;
}

.start-animal {
  font-size: clamp(80px, 12vw, 130px);
  line-height: 1;
}

.start-card h1 {
  font-size: clamp(40px, 6vw, 70px);
  margin: 8px 0;
  line-height: 1;
}

.start-card p {
  max-width: 740px;
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.25;
  margin: 8px 0 32px;
}

#startBtn {
  font-size: clamp(26px, 3.5vw, 36px);
  padding: 20px 48px;
  border-radius: 999px;
  background: #ffcf33;
  box-shadow: 0 9px 0 #c99800;
}

/* SPIELSEITE */

.game-screen {
  width: 100%;
  height: 100%;
  padding: 16px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
}

.game-header {
  min-height: 84px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.game-header h1 {
  font-size: clamp(34px, 4vw, 52px);
  margin: 0;
  line-height: 1;
}

.game-header p {
  font-size: clamp(18px, 2vw, 24px);
  margin: 6px 0 0;
  font-weight: 700;
  color: #555;
}

.stats {
  display: flex;
  gap: 14px;
}

.stat-box {
  min-width: 120px;
  border-radius: 22px;
  background: #fff0f6;
  padding: 10px 16px;
  text-align: center;
  box-shadow: inset 0 0 0 4px #ffd3e6;
}

.stat-box span {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: #555;
}

.stat-box strong {
  display: block;
  font-size: 38px;
  line-height: 1;
}

/* HAUPTLAYOUT */

.game-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 14px;
}

.left-panel,
.right-panel {
  min-height: 0;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
  padding: 16px;
}

/* LINKS */

.left-panel {
  display: grid;
  grid-template-rows: 1fr auto auto auto;
  gap: 12px;
}

.animal-card {
  min-height: 0;
  border-radius: 28px;
  background: #fff3bd;
  box-shadow: inset 0 0 0 5px #ffd84d;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 12px;
}

.animal {
  font-size: clamp(90px, 13vw, 190px);
  line-height: 1;
}

.animal-name {
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 900;
  margin-top: 4px;
}

.task-card {
  border-radius: 28px;
  background: #fff5f8;
  box-shadow: inset 0 0 0 5px #ffb9d7;
  padding: 12px;
  text-align: center;
}

.task-label {
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 900;
}

.color-word {
  display: inline-block;
  max-width: 100%;
  margin: 8px 0;
  padding: 10px 22px;
  border-radius: 28px;
  border: 5px solid currentColor;
  background: #ffffff;
  font-size: clamp(62px, 9.5vw, 130px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 1px;
}

.color-word.light-word {
  text-shadow:
    -2px -2px 0 #202020,
     2px -2px 0 #202020,
    -2px  2px 0 #202020,
     2px  2px 0 #202020;
}

.pair-hint {
  display: inline-block;
  margin-top: 8px;
  border-radius: 999px;
  padding: 8px 14px;
  background: #ffffff;
  border: 3px solid #ffd3e6;
  font-size: clamp(17px, 1.7vw, 22px);
  font-weight: 900;
  color: #34425c;
}

.feedback {
  min-height: 58px;
  border-radius: 22px;
  background: #f5f5f5;
  box-shadow: inset 0 0 0 4px #e3e3e3;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 8px 16px;
  font-size: clamp(20px, 2.2vw, 32px);
  font-weight: 900;
}

.feedback.good {
  color: #138a1d;
  background: #e3ffdf;
  box-shadow: inset 0 0 0 4px #87db7b;
}

.feedback.try {
  color: #bc7700;
  background: #fff1cc;
  box-shadow: inset 0 0 0 4px #ffc95c;
}

.restart-btn {
  justify-self: center;
  font-size: 21px;
  padding: 12px 28px;
  border-radius: 999px;
  background: #e9e9e9;
  box-shadow: 0 6px 0 #bdbdbd;
}

/* RECHTS */

.right-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
}

.pad-title {
  text-align: center;
  font-size: clamp(32px, 3.8vw, 46px);
  font-weight: 900;
  line-height: 1;
}

.color-pad {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 10px;
}

.color-tile {
  min-width: 0;
  min-height: 0;
  border-radius: 20px;
  border: 5px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 6px 0 #cccccc,
    inset 0 0 0 3px rgba(0, 0, 0, 0.08);
  line-height: 1;
  padding: 8px;
}

.color-tile.correct-flash {
  outline: 7px solid #5ad64a;
  box-shadow: 0 6px 0 #3ca331;
}

.color-tile.wrong-flash {
  outline: 7px solid #ffb02e;
  box-shadow: 0 6px 0 #c47d00;
}

.hint-box {
  border-radius: 20px;
  background: #fff0f6;
  box-shadow: inset 0 0 0 4px #ffd3e6;
  padding: 12px;
  font-size: clamp(17px, 1.8vw, 21px);
  line-height: 1.2;
  text-align: center;
  font-weight: 800;
  color: #34425c;
}

/* ANIMATION */

.animal-success {
  animation: animalBounce 0.5s ease;
}

@keyframes animalBounce {
  0% {
    transform: scale(1);
  }

  35% {
    transform: scale(1.18) rotate(-4deg);
  }

  70% {
    transform: scale(0.95) rotate(4deg);
  }

  100% {
    transform: scale(1);
  }
}

/* KOMPAKT FÜR 1024 x 768 / 1024 x 786 */

@media (max-width: 1100px), (max-height: 820px) {
  .game-screen {
    padding: 10px;
    gap: 10px;
  }

  .game-header {
    min-height: 64px;
    padding: 8px 18px;
    border-radius: 22px;
  }

  .game-header h1 {
    font-size: 32px;
  }

  .game-header p {
    font-size: 17px;
    margin-top: 2px;
  }

  .stats {
    gap: 10px;
  }

  .stat-box {
    min-width: 92px;
    padding: 7px 12px;
    border-radius: 18px;
    box-shadow: inset 0 0 0 3px #ffd3e6;
  }

  .stat-box span {
    font-size: 15px;
  }

  .stat-box strong {
    font-size: 31px;
  }

  .game-layout {
    grid-template-columns: 0.95fr 1.05fr;
    gap: 10px;
  }

  .left-panel,
  .right-panel {
    padding: 10px;
    border-radius: 24px;
  }

  .left-panel {
    gap: 8px;
    grid-template-rows: 0.9fr auto auto auto;
  }

  .right-panel {
    gap: 8px;
  }

  .animal-card {
    border-radius: 22px;
    padding: 8px;
    box-shadow: inset 0 0 0 4px #ffd84d;
  }

  .animal {
    font-size: clamp(72px, 11vw, 130px);
  }

  .animal-name {
    font-size: 28px;
    margin-top: 0;
  }

  .task-card {
    border-radius: 22px;
    padding: 8px;
    box-shadow: inset 0 0 0 4px #ffb9d7;
  }

  .task-label {
    font-size: 21px;
  }

  .color-word {
    font-size: clamp(46px, 7vw, 88px);
    padding: 7px 16px;
    border-width: 4px;
    border-radius: 22px;
  }

  .pair-hint {
    font-size: 16px;
    padding: 6px 11px;
    margin-top: 5px;
    border-width: 2px;
  }

  .feedback {
    min-height: 44px;
    border-radius: 18px;
    font-size: 20px;
    padding: 5px 12px;
  }

  .restart-btn {
    font-size: 18px;
    padding: 8px 22px;
    box-shadow: 0 4px 0 #bdbdbd;
  }

  .pad-title {
    font-size: 30px;
  }

  .color-pad {
    gap: 7px;
  }

  .color-tile {
    border-radius: 15px;
    border-width: 3px;
    box-shadow: 0 4px 0 #cccccc;
    font-size: clamp(14px, 1.6vw, 22px);
    padding: 5px;
  }

  .color-tile-name {
    padding: 4px 7px;
  }

  .hint-box {
    font-size: 16px;
    padding: 8px;
    border-radius: 16px;
    box-shadow: inset 0 0 0 3px #ffd3e6;
  }
}

/* SEHR NIEDRIGE HÖHE */

@media (max-height: 700px) {
  .game-header {
    min-height: 54px;
  }

  .game-header h1 {
    font-size: 26px;
  }

  .game-header p {
    font-size: 15px;
  }

  .stat-box {
    min-width: 82px;
    padding: 5px 10px;
  }

  .stat-box span {
    font-size: 13px;
  }

  .stat-box strong {
    font-size: 26px;
  }

  .animal {
    font-size: clamp(58px, 9vw, 105px);
  }

  .animal-name {
    font-size: 24px;
  }

  .task-label {
    font-size: 18px;
  }

  .color-word {
    font-size: clamp(38px, 6vw, 72px);
    padding: 6px 13px;
  }

  .pair-hint {
    font-size: 14px;
    padding: 5px 9px;
  }

  .feedback {
    min-height: 38px;
    font-size: 17px;
  }

  .restart-btn {
    font-size: 16px;
    padding: 7px 18px;
  }

  .pad-title {
    font-size: 25px;
  }

  .color-pad {
    gap: 6px;
  }

  .color-tile {
    font-size: 14px;
    border-radius: 12px;
    box-shadow: 0 3px 0 #cccccc;
  }

  .hint-box {
    font-size: 14px;
    padding: 6px;
  }
}

/* TABLET / HANDY */

@media (max-width: 850px) {
  body {
    overflow: auto;
  }

  .app {
    height: auto;
    min-height: 100dvh;
  }

  .game-screen {
    height: auto;
    min-height: 100dvh;
  }

  .game-header {
    flex-direction: column;
    text-align: center;
  }

  .stats {
    width: 100%;
    justify-content: center;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .left-panel,
  .right-panel {
    min-height: auto;
  }

  .animal-card {
    min-height: 180px;
  }

  .color-pad {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
  }

  .color-tile {
    min-height: 80px;
    font-size: 24px;
  }
}

@media (max-width: 520px) {
  .game-screen {
    padding: 8px;
  }

  .game-header h1 {
    font-size: 30px;
  }

  .game-header p {
    font-size: 16px;
  }

  .stat-box {
    min-width: 105px;
  }

  .animal-card {
    min-height: 150px;
  }

  .animal {
    font-size: 90px;
  }

  .animal-name {
    font-size: 26px;
  }

  .color-word {
    font-size: 56px;
  }

  .color-pad {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .color-tile {
    min-height: 68px;
    font-size: 20px;
    border-radius: 15px;
  }
}