:root{
  --orange-main: #ff9f3f;
  --orange-light: #ffba67;
  --dark-bg: #1a1a1a;
  --dark-card: #2a2a2a;
  --text-main: #ff9f3f;
  --text-light: #ffd2a6;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --radius: 18px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at 20% 0%, #333 0, #1a1a1a 35%, #111 70%, #000 100%);
  color: #eee;
}
.container{
  max-width: 1280px;
  margin: 24px auto;
  padding: 0 16px;
  display:grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  align-items:start;
}
.game-main,
.game-sidebar{
  background: rgba(40, 40, 40, .85);
  border: 1px solid rgba(255, 159, 63, .2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.game-main{padding:18px}
.game-sidebar{padding:18px; position: sticky; top: 18px; height: fit-content;}
.game-header{
  text-align:center;
  padding: 10px 10px 0;
}
.game-header .logo img{width:72px;height:72px;border-radius:16px; box-shadow:0 8px 18px rgba(255,159,63,.2)}
.game-header h1{margin:10px 0 4px; color: var(--orange-main); font-size: 40px; letter-spacing:.5px; text-shadow: 0 2px 10px rgba(0,0,0,0.5);}
.subtitle{margin:0; color:var(--orange-light)}
.rules-box{
  margin: 14px 0 14px;
  background: rgba(0, 0, 0, .4);
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 159, 63, .15);
}
.rules-box h3{margin:0 0 8px; color: var(--orange-main)}
.rules-box ol{margin:0; padding-left: 18px; color:var(--text-light)}
.alert{
  margin-top:10px;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 159, 63, .2);
  font-weight: 600;
}
.alert-info{background: rgba(255, 159, 63, .1); color:var(--orange-light); border-color: rgba(255, 159, 63, .3)}
.alert-warning{background: rgba(255, 190, 90, .1); color:#ffba67; border-color: rgba(255,190,90,.3)}
.alert-danger{background: rgba(255, 60, 60, .1); color:#ff6b6b; border-color: rgba(255,60,60,.3)}

.pricing-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0 14px;
}
.price-item{
  background: rgba(0, 0, 0, .5);
  border: 1px solid rgba(255, 159, 63, .25);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text-light);
  font-weight: 800;
}
@media (max-width: 700px){
  .pricing-grid{grid-template-columns: 1fr;}
}

.difficulty-tabs{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin: 16px 0 14px;
}
.tab-btn{
  border: 2px solid rgba(255, 159, 63, .3);
  background: rgba(30, 30, 30, .8);
  color: var(--orange-main);
  padding: 12px 10px;
  border-radius: 999px;
  font-weight: 800;
  cursor:pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}
.tab-btn.active{
  background: linear-gradient(180deg, #ffba67, #ff9f3f);
  border-color: #ffba67;
  color: #000;
  box-shadow: 0 0 15px rgba(255, 159, 63, 0.4);
}

.game-board{
  display:grid;
  gap: 12px;
  padding: 10px;
  width: 100%;
}

/* 手机端：6x6 / 10x10 自动缩小卡牌间距与圆角，避免看起来“图标大小不变” */
@media (max-width: 520px){
  .game-board{gap: 8px; padding: 8px;}
  .card{border-radius: 10px;}
  .card-face{border-radius: 8px;}
  .game-board.grid-6{gap: 6px;}
  .game-board.grid-10{gap: 3px;}
}

/* 10x10 在手机端用更紧凑的布局 */
@media (max-width: 420px){
  .game-board.grid-10{gap: 2px;}
}
/* 默认布局：电脑端优先 */
.game-board.grid-4{grid-template-columns: repeat(4, 1fr) !important;}
.game-board.grid-6{grid-template-columns: repeat(6, 1fr) !important;}
.game-board.grid-10{grid-template-columns: repeat(10, 1fr) !important;}

/* 仅在触屏设备（手机/平板）强制 4 列；电脑端无论多窄都保持 6/10 列 */

.card{
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: #2a2a2a;
  border: 2px solid rgba(255, 159, 63, .2);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
  cursor:pointer;
  position:relative;
  overflow:visible; /* 允许 3D 翻转溢出 */
  user-select:none;
  perspective: 1000px; /* 3D 视角 */
}
.card-inner{
  position:absolute; inset:0;
  transition: transform 0.75s cubic-bezier(.34, 1.56, .64, 1);
  transform-style: preserve-3d;
  width: 100%;
  height: 100%;
}
.card.front .card-inner{
  transform: rotateY(180deg);
}
.card-face{
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-face.back{
  background: url('/assets/images/fp.jpg') no-repeat center center;
  background-size: 100% 100%;
}
.card-face.front{
  background: #fff;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: rotateY(180deg);
}
.card.matched .card-face.front{
  border: 2px solid #ff9f3f;
  box-shadow: 0 0 20px rgba(255, 159, 63, 0.3);
}

.info-card{
  background: rgba(0, 0, 0, .5);
  border: 1px solid rgba(255, 159, 63, .25);
  border-radius: 16px;
  padding: 14px 14px;
  margin-bottom: 14px;
  text-align:center;
}
.info-card label{display:block; color:var(--orange-main); font-weight: 800; margin-bottom: 6px}
.info-card .value{font-size: 36px; font-weight: 900; color:var(--orange-light)}

.instructions-card{
  background: rgba(0, 0, 0, .5);
  border: 1px solid rgba(255, 159, 63, .25);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
}
.instructions-card h3{margin:0 0 8px; color:var(--orange-main)}
.instructions-card ul{
  margin:0;
  padding-left: 0;
  color:var(--orange-main);
  font-weight: 900;
  list-style: none;
}
.instructions-card ul li{
  position: relative;
  padding: 8px 10px 8px 25px;
  margin: 8px 0;
  border-radius: 10px;
  background: rgba(0,0,0,.6);
  border: 1px solid rgba(255,159,63,0.2);
  color: var(--text-light);
}
.instructions-card ul li::before{
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange-main);
  box-shadow: 0 0 8px var(--orange-main);
}

.action-buttons{display:flex; flex-direction:column; gap: 12px}
.btn{
  border:none;
  border-radius: 999px;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 900;
  cursor:pointer;
  color:#000;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}
.btn-orange{background: linear-gradient(180deg, #ffba67, #ff9f3f)}
.btn-green{background: linear-gradient(180deg, #90d86b, #60be47)}
.btn-blue{background: linear-gradient(180deg, #86aefb, #5a87ff)}
.btn-purple{background: linear-gradient(180deg, #a58bff, #7c5bff)}
.btn:hover{filter: brightness(1.1); transform: translateY(-1px);}
.btn:active{transform: translateY(1px)}

.modal-overlay{
  position:fixed; inset:0;
  background: rgba(0,0,0,.8);
  display:none;
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 1000;
}
.modal-overlay.show{display:flex}
.modal-content{
  width: min(560px, 100%);
  background: #222;
  border-radius: 18px;
  border: 1px solid var(--orange-main);
  box-shadow: 0 0 40px rgba(255, 159, 63, 0.3);
  padding: 20px;
}
.modal-content h3{margin: 0 0 15px; color:var(--orange-main); font-size: 24px;}
.modal-body{
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 159, 63, 0.2);
  border-radius: 14px;
  padding: 15px;
  color: var(--text-light);
  font-weight: 800;
  line-height: 1.6;
}
.modal-footer{display:flex; justify-content:flex-end; margin-top: 15px}

@media (max-width: 1100px){
  .container{grid-template-columns: 1fr;}
  .game-sidebar{position: static;}
}

