.logo {
  width: 480px;
  max-width: 480px;
  margin: 24px auto 12px auto;
  display: block;
}

body {
  background: white; 
  width: 100vw;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.container {
  display: grid; 
  justify-content: center;
  align-items: center;
  grid-template-rows: repeat(4, 1fr);
  grid-template-columns: repeat(4, 1fr);     
  gap: 2vw;
  width: 90vw;
  max-width: 384px;   /* 기존 480px → 384px (정확히 80% 크기) */
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  background: rgba(248,248,248,0.3);
  border-radius: 20px;
  box-shadow: 0 3px 14px rgba(140,140,140,0.08);
}

.tile {
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #aaa;
  border-radius: 10%;
  box-shadow: 1px 0px 1px #aaa;
  background-color: #f8f8f8;
  font-size: 28px;
  z-index: 1;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  width: 100%;
  height: 100%;
  position: relative;
  transition: box-shadow 0.16s, background 0.16s;
}

.tile::before {
  content: '';
  position: absolute;
  width: 80%;   /* 원 크기 키움! */
  height: 80%;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(
    135deg,
    rgba(255,255,255,1) 0%,
    rgba(210,210,210,1) 100% /* 대비 높임 */
  );
  border-radius: 50%;
  z-index: -2;
}

.empty {
  visibility: hidden;
}

h1, h2 {
  text-align: center;
}

.congrats {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.invisible {
  display: none;
}

#congrats h1 {
  font-size: 2em;
}

/* 다시하기(파란) 버튼 + 공유/새게임 버튼 모두 큼직하게 */
.newGame,
#retry-btn,
#share-btn {
    display: block;
    margin: 22px auto 14px auto;
    border: 0;
    border-radius: 36px;
    color: white;
    padding: 0px 10px;
    width: 80vw;        /* 훨씬 더 큼직하게! */
    max-width: 340px;
    background-color: #009ee3;
    font-size: 1.45em;  /* 글자 더 큼직하게! */
    line-height: 230%;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,158,227,0.11);
    transition: background 0.17s;
    font-weight: bold;
}

.newGame {
  background-color: #bbb;
  color: #fff;
}
#share-btn {
  background-color: orange;
  color: #fff;
}

#end {
  display: block;
  margin: auto;
  width: 90vw;
  max-width: 480px;
  text-align: center;
  font-size: 15px;
  color: orange;
}

/* 반응형 모바일 최적화 */
@media (max-width: 480px) {
  .container {
    width: 98vw;
    max-width: 80vw;
    min-width: 80vw;
    gap: 2vw;
  }
  .tile {
    font-size: 7vw;
  }
  .logo {
    width: 95vw;
    max-width: 95vw;
    margin: 14px auto 8px auto;
  }
  #end {
    width: 95vw;
    font-size: 13px;
  }
  .newGame,
  #retry-btn,
  #share-btn {
      width: 94vw;
      max-width: 98vw;
      font-size: 1.2em;
  }
}

.tile.empty {
  visibility: visible !important;
  background: none;
  border: 2px dashed #b7b7b7;
  box-shadow: none;
  position: relative;
}

.tile.empty::after {
  content: "";
  color: #ccc;
  font-size: 1em;
  font-weight: bold;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
}

#counter {
  margin-top: 80px;
}