/* styles.css - たして10 アプリのスタイル */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  --color-border: #ddd;
  --color-background: #fafafa;
  --color-primary: #333;
}

body {
  font-family: 'Arial', sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.container {
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  max-width: 500px;
  width: 100%;
  background-color: rgb(255, 240, 254);
  height: calc(100vh - 144px);
}

.header {
  background: white;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  min-height: 72px;
  width: 100%;
}

.footer {
  background: white;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  min-height: 72px;
  width: 100%;
}

.app-icon {
  margin-left: 10px;
  width: 48px;
  height: 48px;
  background-image: url(icons/icon-128.png);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 12px;
  border: #ccc 1px solid;
}

.problem-count {
  font-size: 24px;
  font-weight: bold;
  color: #666;
}

.header-buttons {
  display: flex;
  gap: 8px;
  margin-right: 10px;
}

.header-buttons button {
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.header-help-button svg {
  width: 32px;
  height: 32px;
}

.header-buttons button.install-button {
  width: 36px;
  height: 36px;
  background-image: url(icons/icon-128.png);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

#game-screen {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  height: 100%;
}

.problem-section {
  background: white;
  border-radius: 15px;
  padding: 10px;
  margin-bottom: 20px;
  position: relative;
   height: 180px;           /* 既存の110pxだと足りないので上書き */
  margin-bottom: 10px;
}

.problem-line {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.problem {
  font-size: 36px;
  font-weight: bold;
  color: #333;
  margin: auto 10px;
  display: inline-block;
}

.input-section {
  margin-left: 15px;
  display: inline-block;
  align-items: center;
  height: 66px;
}

.answer-display {
  background: white;
  border: 3px solid #ff07c9;
  border-radius: 10px;
  padding: 10px;
  font-size: 36px;
  font-weight: bold;
  color: #333;
  min-width: 80px;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dots-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
  height: 60px;
}

.dots-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.dots-row {
  display: flex;
  gap: 5px;
  margin-bottom: 5px;
}

.dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin: 1px;
}

.dot.blue {
  background-color: #2ecc71;
}

.dot.green {
  background-color: #3498db;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 300px;
  margin: 0 auto;
  justify-items: center;
  align-items: center;
}

.key-btn {
  width: 70px;
  height: 70px;
  border: none;
  border-radius: 10px;
  font-size: 36px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.key-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.key-btn:active {
  transform: translateY(0);
}

.num-btn {
  background: #fff;
  color: #333;
  border: 2px solid #ff07c9;
}

.clear-btn {
  background: #dc3545;
  color: white;
  font-size: 24px;
  border-radius: 35px;
}

.enter-btn {
  background: #007bff;
  color: white;
  font-size: 24px;
  border-radius: 35px;
}

.clear-btn svg,
.enter-btn svg {
  height: 60%;
  fill: white;
}

.zero-btn {
  background: #fff;
  color: #333;
  border: 2px solid #ff07c9;
}

.sticker-container {
  display: none;
  text-align: center;
}

.sticker-container.show {
  display: block;
  animation: fadeIn 1s ease-in-out;
}

.sticker-trophy {
  font-size: 120px;
  margin: 20px 0;
}

.sticker {
  font-size: 60px;
  margin: 20px 0;
}

.message {
  font-size: 24px;
  color: #333;
  font-weight: bold;
  margin: 20px 0;
}

.restart-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 25px;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.2s;
}

.restart-btn:hover {
  transform: translateY(-2px);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.feedback {
    position:absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);  
  font-size: 24px;
  font-weight: bold;
  min-height: 40px;
}

.correct {
  color: #00b894;
}

.incorrect {
  color: #d63031;
}

/* ===== ツリー型 問題表示 ===== */



.tree-problem {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.node {
  background: #fff;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  
}

.node-top {
  width: 260px;
  font-size: 60px;
  margin: -10px;
}

.node-row {
  display: flex;
  justify-content: space-between;
  padding: 0 22px;
  gap: 30px;
}

.node-bottom {
  width: 100px;
  height: 80px;
  border: 4px solid #cfcfcf;
  font-size: 60px;
}

.node-answer {
  border-color: #ff07c9; /* 黄色枠 */
}

.tree-answer {
  /* 既存 answer-display をツリー用に上書き */
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 18px;
  padding: 0;
  min-width: 0;
  min-height: 0;
  font-size: 60px;
}

.connector {
  height: 30px;
  pointer-events: none;
}

.connector path {
  fill: none;
  stroke: #cfcfcf;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
}


