:root{
    --border-color : #979797;
    --main-bg : #69AE6B;
    --pure-black : #000;
    --pure-red: #f00;
    --card-bg: #fff;
    
    --main-bg-dark : #121212;
    --mainfont-dark-color: rgba(255,255,255,0.87);
    --secondfont-dark-color: rgba(255,255,255,0.6);
    --03dp-bgcolor: rgba(255,255,255,0.08);
    
    --card-bg-dark: #eee;

    
}


@font-face {font-family: "GeoSlab703 Md BT";
    src: url("../fonts/GeoSlab703MdBT.woff2")  format("woff2"),
        url("../fonts/GeoSlab703MdBT.woff")  format("woff");
}

html,body{
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

p{
    margin: 0;
}

html{
    background-color: var(--main-bg);
/*    background:#69AE6B radial-gradient(circle at top center, rgba(255,255,255,0.2) 0%, rgba(232,232,232,0.2) 32%, rgba(0,0,0,0.2) 100%);*/

    /* background-image: url('/image/bg.jpg'); */
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    font-family: "GeoSlab703 Md BT";
}


body{

}

main{
    position: absolute;
    display: block;
    width: 100%;
    min-height: -webkit-fill-available;
    top: 0;
    left: 0;
    
    /* 空出遮挡区域 */
    padding: env(safe-area-inset-top, 20px) env(safe-area-inset-right, 20px) env(
        safe-area-inset-bottom,
        20px
    ) env(safe-area-inset-left, 20px);

    box-sizing: border-box;
    overflow: hidden;
}

#spiderWeb{
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    transform: translate(-30%,-30%);
    width: 80vw;
    height: auto;
}

css-doodle {
    width: 80vmin;
    height: 40vmin;
    border-radius: 10vmin;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
  }
  

.cardContainer{
    perspective: 1000px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}


.card{
    display: inline-block;
    margin: 0 2px;
    vertical-align: top;

    aspect-ratio: 7 / 10;
    width: calc(10vw - 4px);

    position: absolute;

    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);

    pointer-events: none;
    box-sizing: border-box;
    z-index: 1001;
}

.card.selected{
    transform: scale(1.1);
}

.card .front{
    box-sizing: border-box;
    backface-visibility: hidden;
    position: absolute;
    transform: perspective(400px) rotateY(0deg);
    width: 100%;
    height: 100%;
    transition: transform 0.5s;
    background-color: var(--card-bg);
    border: .5px solid var(--border-color);
    border-radius: 3px;
    transform-style: preserve-3d;
}

.card .back{
    content: "";
    position: absolute;
    display: block;
    width: 100%;
    height: 100%;

    left: 0;
    top: 0;
    background-image: url('../svg/back.svg');
    background-size: contain;

    backface-visibility: hidden;

    transform: perspective(400px) rotateY(179.9deg);

    transition: transform 0.5s;
    transform-style: preserve-3d;
}

div.card.face-down div.back{
    transform: perspective(400px) rotateY(0);
}

div.card.face-down div.front{
    transform: perspective(400px) rotateY(179.9deg);
}

.card .value{
    width: 27%;
    height: 29%;
    position: absolute;
    top: 3%;
    left: 3%;
}

.card img{
    display: inline-block;
    width: 100%;
    height: 100%;
    vertical-align: top;
}


.card .suit{
    width: 27%;
    height: 20%;
    position: absolute;
    top: 34%;
    left: 3%;
    transition: all 0.3s;
}

.card.covered .suit{
    top: 5%;
    left: 35%;
}


.card .content{
    width: 57%;
    height: 64%;
    position: absolute;
    right: 6%;
    bottom: 6%;
}

/* 默认不可选 */
.card.face-up:after{
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
}

.card.face-up.selectable::after,
.card.face-up.selected::after,
.card.face-up.movable-to::after{
    display: none;
}

.card.movable-to{
    box-shadow: 0 0 3px rgba(0, 0, 0, .3);
    transform: scale(1.05);
}

.card.recycling{
    transform: scale(0.96);
}

/* 默认不可选 */
.card.recycling:after{
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.6);
}

#touchControlContainer{
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

#touchControlContainer .touchControlColumn{
    position: absolute;
    width: calc(10vw - 4px);
    height: 100%;
    margin: -1px 2px;
}

#touchControlContainer .touchControlColumn.over{
    border: solid 1px rgba(255,255,255,0.5);
}

#touchControlContainer .touchControlColumn.selectable{
    background-image: linear-gradient(180deg, rgba(255,255,255,0.00) 0%, rgba(255,255,255,0.30) 99%);
}

#touchControlContainer .touchControlColumn.movable-to{
    background-color: rgba(238, 238, 22, 0.1);
}


#cursor {
    position: absolute;
    pointer-events: none;
    z-index: 2001;
}

#spider {
    width: 8vw;
    height: auto;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

#silk{
    pointer-events: none;
    z-index: 2001;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}


.controlContainer{
    position: absolute;
    bottom: 0;
    right: 0;
    text-align: right;
    padding: 10px;
}

.controlContainer div{
    display: inline-block;
    padding: 10px;
    z-index: 2000;
    user-select: none;
}


.controls{
    position: absolute;
    left: 30%;
    bottom: 80px;
    height: 150px;
    width: 150px;
    display: none!important;
}

.controls > div{
    position: absolute;
    width: 33%;
    height: 33%;
    border: 1px solid red;
}

.controls .up{
    left: 33%;
    top: 0;
}

.controls .down{
    left: 33%;
    bottom: 0;
}

.controls .left{
    left: 0;
    top: 33%;
}

.controls .right{
    right: 0;
    top: 33%;
}


.controls .confirm{
    right: 0;
    top: 0;
}

.controls .cancel{
    right: 0;
    bottom: 0;
}


#joystick {
    position: fixed;
    left: 50%;
    bottom: 20vh;
    width: 100px;
    height: 100px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: -50px;
}

#thumb {
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
}

.info{
    pointer-events: none;
}


.welcomePanel{
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.endPanel{
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    pointer-events: none;

}

.endPanel .panel{
    transform: translate3d(0,200vh,0);
}

.endPanel.appear{
    pointer-events: all;
    background-color: rgba(255, 255, 255, 0.5);
}


.endPanel.appear .panel{
    transform: translate3d(0,0,0);
}


.panel{
    position: relative;
    width: 90vw;
    max-width: 500px;
    margin: auto;
    max-height: 85vh;
    overflow-y: auto;

    text-align: center;

    background-color:  #FFCA00;
    box-sizing: border-box;
    border-radius: 10px;
    padding: 20px;

    box-shadow: 0 6px 8px 0 rgba(0,0,0,0.50);
    transition: all 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.panel .inner{
    background: #fff;
    position: relative;
    width: 100%;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    box-shadow: inset 0 1px 5px 0 rgba(0,0,0,0.50);
    justify-content: flex-start;
    padding: 20px;
    box-sizing: border-box;
}

.panel p{
    font-size: 18px;
    color: #A2A2A2;
    letter-spacing: -0.58px;
    text-align: center;
    font-weight: lighter;
    font-weight: 100;
}

.panel h3{
    font-size: 32px;
}

.resumeGame{
    display: none;
}

.resumeGame.show{
    display: block;
}


.panel .title{
    text-align: center;
    display: inline-block;
    font-size: 32px;
    font-weight: bold;
    text-decoration: underline;
}

.panel .title em{
    font-size:10px;
    padding: 2px;
    border: 1px solid #666;
    color: #666;
}



.welcomePanel.disappear{
    pointer-events: none;
}


.welcomePanel.disappear .panel{
    transform: translate3d(0,-200vh,0);
}


.restart-game-btn{
    font-size: 24px;
    text-decoration: underline;
    margin-top: 20px;
}


.logo{
    position: absolute;
    pointer-events: none;

    opacity: 0.6;
    font-size: 48px;
    color: #FFFFFF;
    text-align: justify;
    bottom: 9vw;
    width: 100%;
    text-align: center;
    pointer-events: none;
}

.game-btns{
    display: none;

    width: 100%;
    height: 26vw;
    position: absolute;
    bottom: 0;

    background: var(--main-bg);
    box-shadow: 0 2px 10px 0 rgba(0,0,0,0.50);
}

.game-btns.show{
    display: block;
}

.deal-cards-btn{
    position: absolute;
    z-index: 1000;
    height: 16vw;
    width: 53vw;
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.3);
    top: 5.5vw;
    display: flex;
    color: rgba(255, 255, 255, 0.4);
    left: 1vw;

    align-items: center;
    justify-content: center;
    font-size: 28px;
}


.give-up-btn{
    position: absolute;
    z-index: 1000;
    height: 12vw;
    width: 28vw;
    right: 3vw;
    top: 8vw;
    
    /* Button styling */
    background: linear-gradient(135deg, #ffc107, #ffb300);
    color: #212529;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    
    /* Remove underline */
    text-decoration: none;
    
    /* Center text */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Transitions */
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.give-up-btn:hover {
    background: linear-gradient(135deg, #ffca28, #ffc107);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

.give-up-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.retry-btn{
    position: absolute;
    z-index: 1000;
    height: 16vw;
    right: 3vw;
    font-size: 18px;
    top: 15vw;
    text-decoration: underline;

}


.suitplaceholderContainer{
    position: absolute;
    top: 58vh;
    display: flex;
    justify-content: center;
    width: 100%;
    pointer-events: none;
    z-index: 100;
}

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

.suitplaceholderContainer .block{
    width: calc(10vw - 1px);
    aspect-ratio: 7 / 10;
    box-shadow: inset 0px 0px 3px 0 rgba(107, 107, 107, 0.5);
    border: .5px solid #4a4a4a;
    margin: 0 10px;
    border-radius: 2px;
}

.suitplaceholderContainer .icon{
   width: 15px;
   margin: 3px;
}

.suitplaceholderContainer .icon img{
    width: 100%;
    height: auto;
    filter: grayscale(100%) brightness(0%);
    opacity: 0.2;
    transition: 0.3s;
 }

 .suitplaceholderContainer .suitplaceholder.active .icon img{
    filter: unset;
    opacity: 1;
}



@keyframes shake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-1px, 1px) rotate(-1deg); }
    20% { transform: translate(1px, -1px) rotate(1deg); }
    30% { transform: translate(-1px, 1px) rotate(-1deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 1px) rotate(-1deg); }
    60% { transform: translate(1px, -1px) rotate(1deg); }
    70% { transform: translate(-1px, 1px) rotate(-1deg); }
    80% { transform: translate(1px, -1px) rotate(1deg); }
    90% { transform: translate(-1px, 1px) rotate(-1deg); }
}

/* 放大后缩小 */
@keyframes scaleup-and-down {
    0%, 100% { transform: scale(1); }   /* 初始状态和最终状态，不放大不缩小 */
    50% { transform: scale(5); } /* 中间状态，放大1.5倍 */
  }

/* 分享胜局表单样式 */
.share-form {
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.share-form h4 {
    margin: 0 0 15px 0;
    color: var(--mainfont-dark-color);
    text-align: center;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--mainfont-dark-color);
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    /* color: var(--mainfont-dark-color); */
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4CAF50;
    background: rgba(255, 255, 255, 0.3);
}

.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.share-btn,
.skip-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-btn {
    background: #4CAF50;
    color: white;
}

.share-btn:hover {
    background: #45a049;
}

.skip-btn {
    background: rgba(255, 255, 255, 0.2);
    color: var(--mainfont-dark-color);
}

.skip-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.share-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-size: 14px;
}

.share-status.success {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.share-status.error {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

/* 他人胜局界面样式 */
.othersGamePanel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--main-bg-dark);
    display: none;
    flex-direction: column;
    z-index: 10000;
}

.othersGamePanel.show {
    display: flex;
}

.othersGamePanel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.othersGamePanel h3 {
    margin: 0;
    color: var(--mainfont-dark-color);
    font-size: 24px;
    font-weight: 600;
}

.othersGamePanel .close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--mainfont-dark-color);
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.othersGamePanel .close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.othersGamePanel .games-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;
}
    color: var(--mainfont-dark-color);
}

.load-btn,
.close-btn,
.page-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.load-btn {
    background: #4CAF50;
    color: white;
}

.load-btn:hover {
    background: #45a049;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: var(--mainfont-dark-color);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.games-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

.loading {
    text-align: center;
    color: var(--secondfont-dark-color);
    padding: 20px;
}

.game-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.game-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.player-info {
    color: var(--mainfont-dark-color);
    font-weight: bold;
}

.step-count {
    color: #4CAF50;
    font-weight: bold;
}

.game-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--secondfont-dark-color);
}

.othersGamePanel .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.page-btn {
    background: rgba(255, 255, 255, 0.2);
    color: var(--mainfont-dark-color);
}

.page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pageInfo {
    color: var(--mainfont-dark-color);
    font-size: 14px;
}

/* playOthersGame 按钮样式 */
.playOthersGame .title {
    font-size: 1.2em;
    margin-bottom: 8px;
}

.playOthersGame p {
    font-size: 0.9em;
    color: var(--secondfont-dark-color);
    margin: 0;
}
  

/* 网页端优化 */
@media (hover: hover) and (pointer: fine) {
  /* 鼠标悬停效果 */
  .card.selectable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    cursor: pointer;
  }
  
  .game-btns > *:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
    cursor: pointer;
  }
  
  .playOthersGame:hover,
  .resumeGame:hover,
  #initializeApp:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
    transition: all 0.2s ease;
    cursor: pointer;
  }
  
  .game-item:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-2px) !important;
    cursor: pointer;
  }
  
  button:hover,
  .share-btn:hover,
  .skip-btn:hover,
  .load-btn:hover,
  .close-btn:hover,
  .page-btn:hover:not(:disabled) {
    cursor: pointer;
  }
}

/* 键盘导航支持 */
.card:focus {
  outline: 2px solid #4CAF50;
  outline-offset: 2px;
}

button:focus,
select:focus,
input:focus {
  outline: 2px solid #4CAF50;
  outline-offset: 2px;
}

/* 改善大屏幕体验 */
@media (min-width: 1024px) {
  .controlContainer {
    padding: 20px;
  }
  
  .welcomePanel .panel {
    max-width: 500px;
  }
  
  .endPanel .panel {
    max-width: 600px;
  }
  
  .othersGamePanel .panel {
    max-width: 700px;
  }
  
  /* 更好的卡牌间距 */
  #main {
    padding: 20px;
  }
}

/* 加载状态优化 */
.loading {
  animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}


/* 重构后的欢迎界面样式 */
.welcome-header {
  text-align: center;
  margin-bottom: 30px;
  position: relative;
}


.game-title {
  font-size: 2.5rem;
  font-weight: bold;
  color: #fff;
  margin: 0 0 10px 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.user-status-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

/* 登录用户样式 */
.logged-in-section {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-avatar {
  flex-shrink: 0;
}

.avatar-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
}

.user-info {
  flex: 1;
}

.user-info h3 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1.3rem;
}

.user-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  color: #4CAF50;
}

.stat-label {
  font-size: 0.9rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 游客用户样式 */
.guest-section {
  text-align: center;
}

.guest-content h3 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 1.4rem;
}

.guest-content p {
  margin: 0 0 20px 0;
  color: #666;
}

.auth-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.guest-stats {
  padding: 15px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.guest-note {
  margin: 0 0 10px 0;
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
}

.stats-inline {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 0.9rem;
  color: #666;
}

/* 按钮样式 */
.btn-primary,
.btn-secondary,
.auth-btn {
  padding: 14px 28px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px; /* 确保足够的点击区域 */
  box-sizing: border-box;
}

.btn-primary,
.auth-btn.primary {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-primary:hover,
.auth-btn.primary:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn-secondary,
.auth-btn.secondary {
  background: transparent;
  color: #666;
  border: 2px solid #ddd;
}

.btn-secondary:hover,
.auth-btn.secondary:hover {
  background: #f5f5f5;
  border-color: #bbb;
}

.btn-small {
  padding: 6px 16px;
  font-size: 0.9rem;
}

.btn-large {
  padding: 16px 32px;
  font-size: 1.1rem;
}

/* 游戏动作卡片 */
.game-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.action-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 20px;
  backdrop-filter: blur(10px);
}

.action-card:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.action-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.action-content h3 {
  margin: 0 0 5px 0;
  color: #333;
  font-size: 1.2rem;
}

.action-content p {
  margin: 0;
  color: #666;
  font-size: 0.95rem;
}

/* 胜利界面样式 */
.victory-content {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.victory-header {
  margin-bottom: 30px;
}

.victory-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.victory-header h2 {
  margin: 0 0 10px 0;
  color: #fff;
  font-size: 2.2rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.victory-message {
  margin: 0 0 30px 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
}

.victory-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 20px;
  min-width: 120px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.stat-card .stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: bold;
  color: #4CAF50;
  margin-bottom: 5px;
}

.stat-card .stat-label {
  font-size: 0.9rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 分享部分 */
.share-section {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
}

.share-header h3 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 1.3rem;
}

.share-header p {
  margin: 0 0 20px 0;
  color: #666;
}

.share-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.share-btn {
  background: linear-gradient(135deg, #FF9800, #F57C00);
  box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.share-btn:hover {
  background: linear-gradient(135deg, #F57C00, #E65100);
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

/* 游客胜利提示 */
.guest-victory-message {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
}

.guest-victory-message h3 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1.4rem;
}

.guest-victory-message p {
  margin: 0 0 20px 0;
  color: #666;
  line-height: 1.5;
}

.guest-victory-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

/* 胜利操作按钮 */
.victory-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

.victory-actions .btn-large {
  min-width: 200px;
}

.share-status {
  margin-top: 15px;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
}

.share-status.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.share-status.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* 认证模态框样式 */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.modal-content {
  background: white;
  border-radius: 10px;
  padding: 0;
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 0 20px;
  border-bottom: 1px solid #eee;
  margin-bottom: 20px;
}

.modal-header h3 {
  margin: 0;
  color: #333;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.close-btn:hover {
  color: #333;
}

.form-group {
  margin-bottom: 20px;
  padding: 0 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: #333;
  font-weight: bold;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #4CAF50;
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: #666;
  font-size: 12px;
}

.form-actions {
  padding: 20px 20px 24px 20px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.form-actions .auth-btn {
  flex: 1;
  min-width: 120px;
}

.error-message {
  margin: 0 20px 20px 20px;
  padding: 10px;
  background: #ffebee;
  color: #c62828;
  border-radius: 5px;
  font-size: 14px;
}

.victory-content {
  padding: 0 20px 20px 20px;
  text-align: center;
}

.victory-content p {
  margin: 0 0 15px 0;
  color: #333;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .game-title {
    font-size: 2rem;
  }
  
  .logged-in-section {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  
  .user-stats {
    justify-content: center;
  }
  
  .victory-stats {
    flex-direction: column;
    align-items: center;
  }
  
  .stat-card {
    min-width: 150px;
  }
  

}

@media (max-width: 480px) {
  .user-status-card {
    padding: 20px;
    margin-bottom: 20px;
  }
    
  .form-actions {
    flex-direction: column;
  }
/*   
  .auth-btn,
  .btn-primary,
  .btn-secondary {
    width: 100%;
  }
   */
  .share-actions,
  .guest-victory-actions,
  .victory-actions {
    flex-direction: column;
  }
  
  /* .victory-actions .btn-large {
    width: 100%;
  } */
  
  .stats-inline {
    flex-wrap: wrap;
  }
  
  .game-title {
    font-size: 1.8rem;
  }
  
  .victory-icon {
    font-size: 3rem;
  }
}

/* URL分享样式 */
.url-share-section {
  margin-top: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.url-share-header {
  margin-bottom: 15px;
  text-align: center;
}

.url-share-header h4 {
  margin: 0 0 8px 0;
  color: #333;
  font-size: 1.1em;
}

.url-share-header p {
  margin: 0;
  color: #666;
  font-size: 0.9em;
}

.url-input-container {
  display: flex;
  gap: 10px;
  align-items: center;
}

.share-url-input {
  flex: 1;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  color: #333;
  font-size: 14px;
  font-family: monospace;
}

.btn-copy {
  padding: 12px 16px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.btn-copy:hover {
  background: #45a049;
}

.btn-copy:active {
  background: #3d8b40;
}

/* 打印样式 */
@media print {
  .controlContainer,
  .game-btns,
  .welcomePanel,
  .endPanel,
  .othersGamePanel,
  .auth-modal {
    display: none !important;
  }
}

/*dark mode - moved to end for proper CSS specificity*/
@media (prefers-color-scheme: dark)  {
    html{
        background-color: var(--main-bg-dark);
        color: var(--mainfont-dark-color);
    }
    
    .game-btns{
        background-color: var(--main-bg-dark);
    }
    
    .panel,
    .panel .inner{
        background: #222;
    }
    
    .deal-cards-btn{
        color: var(--mainfont-dark-color);
    }
    
    .give-up-btn {
        background: linear-gradient(135deg, #ffb300, #ff8f00);
        color: #212529;
        box-shadow: 0 4px 12px rgba(255, 179, 0, 0.3);
    }
    
    .give-up-btn:hover {
        background: linear-gradient(135deg, #ffc107, #ffb300);
        box-shadow: 0 6px 20px rgba(255, 179, 0, 0.4);
    }
    
    .panel p{
        color: var(--secondfont-dark-color);
    }
    
    .suitplaceholderContainer .icon img{
        filter: brightness(0) invert(1);
    }
    
    .suitplaceholderContainer .suitplaceholder.active .icon img{
       filter: drop-shadow(0 0  2px  rgb(255, 255, 255));
    }
    
    .card .front{
        background-color: var(--card-bg-dark);
    }
    
    .card .back{
        filter: grayscale(100%) brightness(60%);
    }
    
    #touchControlContainer .touchControlColumn.selectable{
        background-image: linear-gradient(180deg, rgba(255,255,255,0.00) 0%, rgba(255,255,255,0.10) 99%);
    }
    
    .panel .title em{
        color: var(--secondfont-dark-color);
        border-color: var(--secondfont-dark-color);
    }
    
    .modal-content {
      background-color: #1e1e1e !important;
      color: var(--mainfont-dark-color);
      border: 1px solid rgba(255,255,255,0.12);
    }
    
    .modal-header {
      border-bottom-color: rgba(255,255,255,0.12);
    }
    
    .modal-header h3 {
      color: var(--mainfont-dark-color);
    }
    
    .close-btn {
      color: var(--secondfont-dark-color);
    }
    
    .close-btn:hover {
      color: var(--mainfont-dark-color);
    }
    
    .form-group label {
      color: var(--mainfont-dark-color);
    }
    
    .form-group input,
    .form-group select {
      background-color: rgba(255,255,255,0.05) !important;
      border-color: rgba(255,255,255,0.12) !important;
      color: var(--mainfont-dark-color) !important;
    }
    
    .form-group input:focus,
    .form-group select:focus {
      border-color: #4CAF50 !important;
      background-color: rgba(255,255,255,0.08) !important;
    }
    
    .form-group small {
      color: var(--secondfont-dark-color);
    }
    
    .error-message {
      background: rgba(244, 67, 54, 0.1);
      color: #ef5350;
      border: 1px solid rgba(244, 67, 54, 0.2);
    }
    
    .victory-content p {
      color: var(--mainfont-dark-color);
    }
    
    .share-url-input {
      background-color: rgba(255,255,255,0.05) !important;
      border-color: rgba(255,255,255,0.12) !important;
      color: var(--mainfont-dark-color) !important;
    }
    
    .url-share-header h4 {
      color: var(--mainfont-dark-color);
    }
    
    .url-share-header p {
      color: var(--secondfont-dark-color);
    }
    
    /* 欢迎界面暗黑模式 */
    .user-status-card {
      background: rgba(255, 255, 255, 0.08) !important;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }
    
    .user-info h3 {
      color: var(--mainfont-dark-color) !important;
    }
    
    .stat-label {
      color: var(--secondfont-dark-color) !important;
    }
    
    .guest-content h3 {
      color: var(--mainfont-dark-color) !important;
    }
    
    .guest-content p {
      color: var(--secondfont-dark-color) !important;
    }
    
    .game-title {
      color: var(--mainfont-dark-color) !important;
    }
    
    .game-subtitle {
      color: var(--secondfont-dark-color) !important;
    }
    
    /* 按钮暗黑模式 */
    .btn-secondary,
    .auth-btn.secondary {
      background: rgba(255, 255, 255, 0.08) !important;
      color: var(--mainfont-dark-color) !important;
      border-color: rgba(255, 255, 255, 0.12) !important;
    }
    
    .btn-secondary:hover,
    .auth-btn.secondary:hover {
      background: rgba(255, 255, 255, 0.15) !important;
      border-color: rgba(255, 255, 255, 0.2) !important;
    }
    
    .auth-buttons .btn-secondary {
      background: rgba(255, 255, 255, 0.08) !important;
      color: var(--mainfont-dark-color) !important;
      border-color: rgba(255, 255, 255, 0.12) !important;
    }
    
    /* 游客统计信息暗黑模式 */
    .guest-note {
      color: var(--secondfont-dark-color) !important;
    }
    
    .stats-inline {
      color: var(--secondfont-dark-color) !important;
    }
    
    .stats-inline span {
      color: var(--secondfont-dark-color) !important;
    }
    
    /* 游戏操作卡片暗黑模式 */
    .action-card {
      background: rgba(255, 255, 255, 0.08) !important;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }
    
    .action-card:hover {
      background: rgba(255, 255, 255, 0.15) !important;
      box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    }
    
    .action-content h3 {
      color: var(--mainfont-dark-color) !important;
    }
    
    .action-content p {
      color: var(--secondfont-dark-color) !important;
    }
    
    
}

/* 加载状态样式 */
.loading-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-left: 4px solid #fff;
  border-radius: 50%;
  animation: loading-spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes loading-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-section p {
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  font-size: 16px;
}

/* 游客保存说明样式 */
.guest-save-note {
  font-size: 14px;
  color: rgba(255, 193, 7, 0.9);
  background: rgba(255, 193, 7, 0.1);
  padding: 8px 12px;
  border-radius: 4px;
  border-left: 3px solid rgba(255, 193, 7, 0.5);
  margin: 10px 0;
  line-height: 1.4;
}

/* 响应式设计 - 横屏适配 */

/* 旋转提示覆盖层 */
.rotate-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--main-bg);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.rotate-content {
    text-align: center;
    padding: 40px;
    max-width: 400px;
}

.rotate-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: rotation 2s infinite linear;
}

@keyframes rotation {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotate-content h2 {
    font-size: 24px;
    margin-bottom: 16px;
    color: white;
}

.rotate-content p {
    font-size: 16px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

/* QR码提示覆盖层 */
.qr-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--main-bg);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.qr-content {
    text-align: center;
    padding: 40px;
    max-width: 500px;
}

.qr-header h2 {
    font-size: 2rem;
    margin: 0 0 20px 0;
    color: white;
}

.qr-header p {
    font-size: 1.2rem;
    margin: 0 0 30px 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.qr-code {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin: 30px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.qr-code #qrcode {
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-code img, 
.qr-code canvas {
    border-radius: 12px;
    max-width: 200px;
    max-height: 200px;
}

.qr-url {
    margin-top: 20px;
}

.qr-url p {
    font-size: 1rem;
    margin: 0 0 10px 0;
    color: rgba(255, 255, 255, 0.8);
}

.qr-url a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.3rem;
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.qr-url a:hover {
    color: #66BB6A;
    background: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

/* 移除大屏幕布局相关样式 */

/* 手机横屏检测 */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .rotate-screen-overlay {
        display: flex !important;
    }
    
    .game-container,
    .controls-guide {
        display: none !important;
    }
}

/* 保持原有的全屏布局，只添加手机横屏提示 */

/* 暗黑模式适配 */
@media (prefers-color-scheme: dark) {
    .rotate-screen-overlay {
        background: var(--main-bg-dark);
    }
    
    .qr-screen-overlay {
        background: var(--main-bg-dark);
    }
    
    .controls-guide {
        background: rgba(30, 30, 30, 0.9);
        border-left-color: rgba(255, 255, 255, 0.1);
    }
    
    .keys {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.3);
    }
}
