* {
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent !important;
  tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  display: flex;
  flex-direction:column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: hsl(50, 85%, 80%);
  padding-top:20px;
}
.header{
  display: flex;
  margin-bottom:5px;
  color:hsl(175, 30%, 25%);
  margin-left:240px;
}
#title{
  font-size:14px;
  font-style:italic;
}
.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding-bottom:50px;
  gap: 10px;
}

.list-selector {
  position: relative;
  z-index: 100;
  display: flex;
  background: hsl(69, 47%, 97%);
  padding: 5px 10px;
  border: 2.5px solid hsl(175, 30%, 25%);
  border-radius: 8px;
  margin-left:232px;
  margin-bottom:0px;
}

.list-selector select {
  border: none;
  outline: none;
  background: white;
  padding: 5px 5px;
  border-radius: 5px;
  text-align:center;
  font-family:Verdana, Geneva, Tahoma, sans-serif;
  font-size: 18px;
  color: hsl(175, 30%, 15%);
  cursor: pointer;
  font-weight:bold;
}

.list-selector select:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background: #f5f5f5;
}

.syllables {
  font-size: 30px;
  color: hsl(50, 90%, 75%);
  margin-bottom: 4px;
}

.game-box {
  width: 360px;
  height: 360px;
  background: white;
  border: 3px solid hsl(175, 30%, 25%);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  pointer-events: auto;
  padding:0px;
  perspective: 1000px;
}

.row {
  min-height: 31%;
  max-height: 30%;
  width: 96.7%;
  background-color: hsl(150, 50%, 88%);
  border-radius: 5px;
  position: relative;
  cursor: pointer;
  transition: transform 0.6s, opacity 0.3s ease;
  transform-style: preserve-3d;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  will-change: transform;
}

#row1 {
  opacity: 1;
  pointer-events: auto;
}

.row.show {
  opacity: 1;
  pointer-events: auto;
}

.row.flipped {
  transform: rotateX(180deg);
}

.front, .back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 12px;
  text-align: center;
}

.back {
  transform: rotateX(180deg);
}

/* Row 1 */
#word1 {
  font-size: 34px;
  font-weight: bold;
  color: hsl(175, 30%, 1%);
}
#word1.red {
  color: hsl(175, 30%, 5%);
}
.ipa {
  font-size: 20px;
  color: hsl(175, 30%, 65%);
  margin-top: 4px;
}
.translation {
  font-size: 24px;
  color: hsl(175, 30%, 5%);
}

/* Row 2 */
.stress {
  font-size: 22px;
  color:hsl(175, 30%, 5%);
  margin-top: 4px;
}
.collocations {
  font-size: 25px;
  color: hsl(175, 30%, 5%);
  text-align: center;
  text-wrap: balance;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  max-height:90%;
  line-height:1.3;
  padding:1px;
}
#row2 .back::before {
  content: "常见搭配";
  position: absolute;
  top: 5%;
  left: 8px;
  font-size: 10px;
  color: hsl(50, 90%, 90%);
  white-space: nowrap;
  z-index: 2;
  pointer-events: none;
}

/* Row 3 */
.sentence {
  font-size: 22px;
  color: hsl(175, 30%, 5%);
  text-align: center;
  text-wrap: balance;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  max-height: 90%;
  line-height:1.3;
  padding:1px;
}
.sent-trans {
  font-size: 22px;
  color: hsl(175, 30%, 5%);
  text-align: center;
  text-wrap: balance;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  max-height: 90%;
}
#row3 .front::before {
  content: "例句";
  position: absolute;
  top: 5%;
  left: 8px;
  font-size: 10px;
  color: hsl(50, 90%, 90%);
  white-space: nowrap;
  z-index: 2;
  pointer-events: none;
}

/* Controls */
.combined-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  width: 100%;
  max-width: 360px;
  margin-top: 1px;
  flex-wrap: wrap;
}

.word-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

#star-btn,
#hide-btn {
  width: 45px;
  height: 45px;
  font-size: 22px;
  border-radius: 50%;
  border: 2px solid hsl(175, 30%, 25%);
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
#hide-btn.active {
  background: #69f3a2;
  border-color: hsl(175, 30%, 25%);
  color: white;
}
#star-btn.active {
  background: #fff350;
  border-color: hsl(175, 30%, 25%);
  transform: scale(1.08);
}

#show-starred-btn,
#show-hidden-btn {
  padding: 10px 10px;
  font-size: 14px;
  border-radius: 8px;
  border: 2px solid hsl(175, 30%, 25%);
  background: white;
  color:hsl(175, 30%, 25%);
  cursor: pointer;
  transition: all 0.2s ease;
}

#show-starred-btn.active,
#show-hidden-btn.active {
  background: hsl(175, 30%, 25%);
  color: white;
}

.nav-buttons {
  display: flex;
  gap: 10px;
}

.nav-buttons button {
  padding: 6px 12px;
  font-size: 18px;
  border: 2px solid hsl(175, 30%, 15%);
  border-radius: 8px;
  background: hsl(150, 50%, 25%);
  color: white;
  cursor: pointer;
  transition: background 0.2s ease;
}

.nav-buttons button:not(:disabled):hover {
  background: hsl(150, 50%, 80%);
  color:hsl(175, 30%, 25%);
}

/* FIXED: Removed broken comma */
#star-btn:disabled,
#hide-btn:disabled,
#show-starred-btn:disabled,
#show-hidden-btn:disabled,
.nav-buttons button:disabled,
#word-list:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}