@charset "utf-8";

.game-container {
    padding:20px;
    background:#f9f9f9;
    border:1px solid #ddd;
    border-radius:8px;
    width:100%;
    margin:10px auto;
}

/* 게임 정보 박스 */
.game-info {
    background:#f0f0f0;
    padding:15px;
    border-radius:8px;
    margin-bottom:15px;
    text-align:left;
    border-left:4px solid #007bff;
}

.info-line {
    padding:5px 0;
    font-size:0.95em;
    color:#333;
}

.info-line span {
    font-weight:bold;
    color:#007bff;
}

/* 초대 알림 창 */
.invite-notification {
    position:fixed;
    top:0;
    left:0;
    right:0;
    bottom:0;
    background:rgba(0, 0, 0, 0.7);
    display:flex;
    justify-content:center;
    align-items:center;
    z-index:9999;
}

.invite-content {
    background:#fff;
    padding:30px;
    border-radius:15px;
    box-shadow:0 10px 40px rgba(0, 0, 0, 0.3);
    max-width:400px;
    width:90%;
}

.invite-content h3 {
    margin:0 0 20px 0;
    color:#333;
    text-align:center;
}

.invite-link {
    display:flex;
    gap:10px;
    margin-bottom:20px;
}

.invite-link input {
    flex:1;
    padding:10px;
    border:1px solid #ddd;
    border-radius:5px;
    font-size:0.9em;
    background:#f9f9f9;
}

.invite-content button {
    padding:11px 16px;
    background:#007bff;
    color:#fff;
    border:none;
    border-radius:8px;
    cursor:pointer;
    font-weight:bold;
}

.invite-content button:hover {
    background:#0056b3;
}

.invite-actions {
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:14px;
}

.invite-actions button {
    width:100%;
    margin:0;
}

.invite-actions .invite-room-btn {
    background:#16a34a;
}

.invite-actions .invite-room-btn:hover {
    background:#15803d;
}

.invite-actions .invite-close-btn {
    background:#6b7280;
}

.invite-actions .invite-close-btn:hover {
    background:#4b5563;
}

/* 회전판 전체 */
#game-wheel-bg {
    max-width:400px;
    max-height:400px;
    position:relative;
    display:flex;
    justify-content:center;
    align-items:center;
    overflow:hidden;
    margin:0 auto;
}

/* 회전판 박스 */
#game-wheel {
    width:100%;
    max-width:500px;
    aspect-ratio:1;
    border-radius:50%;
    position:relative;
    overflow:hidden;
    display:flex;
    justify-content:center;
    align-items:center;
	z-index:3;
}

/* 회전 */
#wheel-segments {
    top:0;
    left:0;
    width:100%;
    height:100%;
    position:absolute;
    transition:transform 3s ease-out;
    transform-origin:center;
}

/* 회전 이미지 */
#wheel-segments img {
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

/* 회전 가운데 이미지 */
#spinner {
	top:50%;
    left:50%;
	width:56%;
	height:56%;
	position:absolute;
	transform:translate(-50%, -50%);
	background:#000;
	border-radius:50%;
	z-index:10;
}

#rps-gif {
	width:100%;
	height:100%;
}

/* 핀 이미지 */
.pin {
	top:13%;
	right:13%;
	width:30px;
	height:30px;
	position:absolute;
	z-index:9;
}

.pin img {
	width:100%;
	height:100%;
	display:block;
}

/* 결과 팝업 */
#result-popup {
    top:50%;
    left:50%;
	width:100%;
    max-width:200px;
	display:none;
    position:absolute;
    transform:translate(-50%, -50%);
    background:rgba(0, 0, 0, 0.8);
    padding:20px 20px 30px;
    border-radius:10px;
    box-shadow:0 4px 10px rgba(0, 0, 0, 0.2);
    text-align:center;
	font-size:0.9em;
	color:#fff;
	z-index:999;
}

#result-popup img {
	max-width:20px;
}

#result-popup span {
	font-weight:bold;
	font-size:1.5em;
}

#close-popup {
	margin-top:10px;
    padding:10px 20px;
    background:#007bff;
    color:#fff;
    border:none;
    cursor:pointer;
	border-radius:5px;
	z-index:1000;
}

#close-popup:hover {
    background:#0056b3;
}

.message_mt {
	width:100%;
	background:#777;
	font-weight:bold;
    color:#fff;
	margin-bottom:10px;
	padding:10px;
	border-radius:10px;
}

/* 결과 배경 이미지 */
.tw1 {
	top:0;
	left:0;
	width:100%;
	height:100%;
	position:absolute;
	z-index:1;
}

.tw1 img {
	width:100%;
	height:100%;
	display:block;
}

/* 사용자 입력 폼 박스 */
.player_form {
	position:relative;
	width:100%;
    margin-top:25px;
    text-align:center;
    padding:0;
    background:#ffffff;
    border:1px solid #ccc;
    border-radius:8px;
    box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 포인트 선택 */
.rps-options2 {
    display:flex;
    justify-content:center;
    gap:10px;
	padding:30px 0 10px;
}

.rps-options2 label {
    cursor:pointer;
    display:inline-block;
}

.rps-options2 input[type="radio"] {
    display:none;
}

.rps-options2 div {
	border-radius:10px;
	background:#f1f1f1;
	color: #555;
	padding:0 10px;
	display:inline-block;
	height:20px;
	line-height:20px;
}

.rps-options2 div.selected-div {
	border-radius:10px;
	background:#333;
	color: #fff;
	padding:0 10px;
	display:inline-block;
	height:20px;
	line-height:20px;
}

/* 선택 아이콘 */
.rps-options-title {
    top:0%;
    left:50%;
    transform:translate(-50%, -50%);
	position:absolute;
	white-space:nowrap;
    margin:0 auto 15px;
    text-align:center;
    padding:0 20px;
    background:#333;
	color:#fff;
    border:1px solid #ccc;
	height:30px;
	line-height:28px;
    border-radius:15px;
}

.rps-options {
    display:flex;
    justify-content:center;
    gap:0 20px;
	padding:0 0 10px;
}

.rps-options label {
    cursor:pointer;
    display:inline-block;
}

.rps-options input[type="radio"] {
    display:none;
}

.rps-options img {
    width:90px;
    height:auto;
}

.rps-options img.selected-image {
    filter:brightness(1.2);
    transform:scale(1.1);
}

.guide {
	width:100%;
	background:#f9f9f9;
	margin-top:15px;
	padding:15px;
	border-top:1px solid #ccc;
    border-radius:0 0 8px 8px;
}

/* 게임시작 버튼 */
.player_form button {
    margin-top:5px;
    padding:10px 20px;
    background:#007bff;
	font-weight:bold;
    color:#fff;
    border:none;
    border-radius:4px;
    cursor:pointer;
    font-size:1em;
    transition:background-color 0.3s;
}

.player_form button:hover {
    background:#0056b3;
}

/* 게임 리스트 */
#rps-history {
	display:flex;
}

.rps-history-box {
	display:flex;
	flex-direction:column;
	padding:5px;
    background:#fff;
    border:1px solid #ddd;
    border-radius:8px;
    width:100%;
    margin:0 auto;
	font-size:0.9em;
}

.rps-history-box img {
    max-width:20px;
}

.list_box {
	display:flex;
	flex-wrap:wrap;
	justify-content:space-between;
	border-bottom:none;
}

.list_box_title {
	background:#ddd;
	font-weight:bold;
}

.list_box > div {
	flex:1 1 auto;
	text-align:center;
	padding:10px 5px;
	box-sizing:border-box;
	border-right:1px solid #ddd;
	border-bottom:1px solid #ddd;
}

.list_box > div:last-child {
	border-right:none;
}

/* 화면 너비가 768px 이하일 때 */
@media (max-width:768px) {
	#game-wheel-bg {
		max-width:250px;
		max-height:250px;
		position:relative;
		display:flex;
		justify-content:center;
		align-items:center;
		overflow:hidden;
		margin:0 auto;
	}

	.player img {
		width:100px;
		height:auto;
		margin-top:10px;
	}

	.rps-options img {
		width:60px;
		height:auto;
	}

	.list_box > div {
		flex:1 1 calc(100% / 3);
	}

	.rps-options2 {
		display:flex;
		justify-content:center;
		gap:5px;
		padding-bottom:10px;
	}

	/* 핀 이미지 */
	.pin {
		top:12%;
		right:12%;
		width:22px;
		height:22px;
		position:absolute;
		z-index:999;
	}

	.pin img {
		width:100%;
		height:100%;
		display:block;
	}

	.invite-content {
		padding:20px;
	}
}

.list_box:last-child {
	border-bottom:1px solid #ddd;
}

.list_btn {
	width:100%;
	text-align:center;
	margin:15px 0 10px;
}

.list_btn div {
	display:inline-block;
}
/* 스핀/회전판 제거 후 결과 표시 영역 */
#game-result-area {
    width:100%;
    max-width:520px;
    margin:0 auto 20px;
    padding:22px 15px;
    background:#fff;
    border:1px solid #ddd;
    border-radius:12px;
    text-align:center;
    box-shadow:0 2px 8px rgba(0,0,0,0.06);
}

.result-ready-title {
    font-size:1.25em;
    font-weight:bold;
    color:#222;
    margin-bottom:6px;
}

.result-ready-text {
    font-size:0.95em;
    color:#666;
}

#game-result-area #result-popup {
    position:static;
    transform:none;
    width:100%;
    max-width:420px;
    margin:15px auto 0;
    background:#222;
    z-index:auto;
}

/* 수정본: 룰렛/스핀판은 숨기고 가위바위보 중앙 표시만 유지 */
.rps-display-only {
    width:100%;
    max-width:400px;
    height:260px;
    max-height:none;
    background:linear-gradient(180deg, #1f2937 0%, #111827 100%);
    border-radius:18px;
    box-shadow:0 8px 25px rgba(0,0,0,0.25);
}
.rps-display-only #game-wheel {
    width:220px;
    height:220px;
    max-width:220px;
    overflow:visible;
    border-radius:50%;
    background:transparent;
}
.rps-display-only #spinner {
    width:180px;
    height:180px;
    background:#000;
    border:4px solid rgba(255,255,255,0.22);
    box-shadow:0 6px 18px rgba(0,0,0,0.35);
}
.rps-display-only .tw1 {
    opacity:0.22;
    pointer-events:none;
}
.rps-display-only #result-popup {
    max-width:260px;
}
.rps-display-only .pin,
.rps-display-only #wheel-segments {
    display:none !important;
}
.player_form button:disabled {
    opacity:0.55;
    cursor:not-allowed;
}

/* fixed4: 결과 후 게임방 유지 / 나가기 버튼 */
.result-actions,
.game-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.result-actions button,
.game-actions button {
    min-width: 110px;
}
.result-rps-view {
    justify-content: center;
    margin: 15px 0;
}
.result-rps-view img {
    max-width: 160px;
    width: 45%;
    height: auto;
}

/* fixed5: 선택 완료 옆 나가기/이력보기 버튼 */
.play-action-row {
    display:flex;
    justify-content:center;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
    margin:8px 0 0;
}
.play-action-row button {
    margin-top:5px;
    min-width:95px;
}
.player_form button.exit-btn,
.result-actions button:last-child,
.game-actions button:last-child {
    background:#555;
}
.player_form button.exit-btn:hover,
.result-actions button:last-child:hover,
.game-actions button:last-child:hover {
    background:#333;
}
.player_form button.history-btn,
.history-top-action button,
.result-actions button:nth-child(2),
.game-actions button:nth-child(2) {
    background:#16a34a;
}
.player_form button.history-btn:hover,
.history-top-action button:hover,
.result-actions button:nth-child(2):hover,
.game-actions button:nth-child(2):hover {
    background:#15803d;
}
.history-top-action {
    width:100%;
    text-align:center;
    margin:14px 0 8px;
}
.history-top-action button {
    padding:9px 18px;
    border:0;
    border-radius:6px;
    color:#fff;
    font-weight:bold;
    cursor:pointer;
}
.empty-history {
    padding:18px;
    text-align:center;
    color:#666;
}
.auto-next-text {
    margin-top:12px;
    padding-top:10px;
    border-top:1px solid rgba(255,255,255,0.25);
    font-size:0.85em;
    color:#eee;
    line-height:1.45;
}
.auto-next-error {
    margin-top:10px;
    color:#ffd6d6;
    font-weight:bold;
}
.rps-display-only #result-popup {
    max-width:300px;
}
@media (max-width:768px) {
    .play-action-row button {
        min-width:82px;
        padding:9px 12px;
        font-size:0.92em;
    }
    .rps-history-box {
        font-size:0.82em;
    }
}


/* 상대 선택 상단 표시 */
.top-choice-caption {
    position:absolute;
    left:50%;
    bottom:14px;
    transform:translateX(-50%);
    z-index:20;
    background:rgba(0,0,0,0.65);
    color:#fff;
    padding:7px 14px;
    border-radius:20px;
    font-size:0.95em;
    white-space:nowrap;
}

.top-choice-caption strong {
    color:#ffd54f;
}

.result-choice-summary {
    background:rgba(255,255,255,0.12);
    border-radius:8px;
    padding:10px;
    line-height:1.8;
    margin-bottom:10px;
}

.result-choice-summary strong {
    color:#ffd54f;
    font-size:1.15em;
}

.result-final-text {
    margin-top:8px;
}

/* fixed9: 결과 팝업을 가위바위보 표시 영역 밖의 독립 레이어로 이동 */
#game-wheel-bg {
    overflow: hidden;
}
.result-popup-outside,
#result-popup.result-popup-outside {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: calc(100% - 32px) !important;
    max-width: 380px !important;
    display: none;
    background: rgba(15, 23, 42, 0.96) !important;
    padding: 22px 18px 24px !important;
    border-radius: 16px !important;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42) !important;
    text-align: center;
    font-size: 1em;
    color: #fff;
    z-index: 99999 !important;
    box-sizing: border-box;
}
#result-popup.result-popup-outside::before {
    content: '';
    position: fixed;
    inset: -100vh -100vw;
    background: rgba(0, 0, 0, 0.45);
    z-index: -1;
}
.result-reveal-choices {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 92%;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 25;
}
.reveal-choice-card {
    width: 38%;
    min-width: 92px;
    max-width: 130px;
    padding: 8px 6px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 14px;
    text-align: center;
    color: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.22);
}
.reveal-choice-card img {
    width: 72px;
    max-width: 75%;
    height: auto;
    margin: 3px auto;
    display: block;
}
.reveal-choice-label {
    font-size: 0.8em;
    color: #e5e7eb;
}
.reveal-choice-text {
    font-size: 1.05em;
    font-weight: 800;
    color: #ffd54f;
}
.reveal-vs {
    font-weight: 900;
    color: #fff;
    font-size: 1.15em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.45);
}
.result-popup-outside .result-choice-summary {
    margin: 0 0 12px;
}
.result-popup-outside .result-final-text span {
    font-size: 1.8em;
}
@media (max-width: 768px) {
    .result-reveal-choices {
        gap: 6px;
    }
    .reveal-choice-card {
        min-width: 78px;
        padding: 6px 4px;
    }
    .reveal-choice-card img {
        width: 58px;
    }
    #result-popup.result-popup-outside {
        max-width: 330px !important;
        padding: 20px 14px 22px !important;
    }
}

/* fixed10: 게임 이력에 내 선택/상대 선택/승패 표시 */
.rps-history-row {
    display:grid;
    grid-template-columns: 0.7fr 1.35fr 1.55fr 0.8fr 0.8fr 0.9fr 0.8fr;
    align-items:center;
    gap:6px;
    padding:8px 6px;
    border-bottom:1px solid #eee;
}
.rps-history-row > div {
    word-break:keep-all;
    text-align:center;
}
.rps-history-row .choice-cell {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:5px;
    text-align:left;
}
.rps-history-row .choice-cell img {
    width:24px;
    height:24px;
    object-fit:contain;
    flex-shrink:0;
}
.rps-history-row .result-cell {
    font-weight:700;
}
.rps-history-row .result-cell.win {
    color:#e03131;
}
.rps-history-row .result-cell.lose {
    color:#1971c2;
}
.rps-history-row .result-cell.draw {
    color:#555;
}
@media (max-width: 640px) {
    .rps-history-row {
        grid-template-columns: 1fr 1fr;
        gap:7px;
        padding:10px 6px;
    }
    .rps-history-row.list_box_title {
        display:none;
    }
    .rps-history-row > div {
        text-align:left;
    }
    .rps-history-row .round-cell {
        grid-column:1 / -1;
        font-weight:700;
        text-align:center;
        background:#f5f5f5;
        border-radius:6px;
        padding:5px;
    }
    .rps-history-row .choice-cell {
        justify-content:flex-start;
    }
}


/* fixed11: 게임 이력 선택값은 텍스트 대신 게임 이미지로 표시 */
.rps-history-row .image-only-choice {
    flex-direction:column;
    gap:4px;
    text-align:center;
}
.rps-history-row .image-only-choice .choice-label {
    font-size:12px;
    font-weight:700;
    color:#444;
    line-height:1.2;
}
.rps-history-row .image-only-choice img {
    width:46px;
    height:46px;
    max-width:46px;
    object-fit:contain;
    display:block;
}
@media (max-width: 640px) {
    .rps-history-row .image-only-choice {
        justify-content:center;
        align-items:center;
    }
    .rps-history-row .image-only-choice img {
        width:52px;
        height:52px;
        max-width:52px;
    }
}

/* fixed12: 결과 팝업 제거, 상단 패 이미지 아래에 결과 직접 표시 */
.rps-display-only {
    height: 390px;
    max-height: none;
    overflow: visible;
    position: relative;
}
#game-wheel-bg {
    overflow: visible;
}
.result-reveal-choices {
    top: 38%;
}
.inline-result-message {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    width: calc(100% - 28px);
    max-width: 360px;
    z-index: 35;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 14px;
    padding: 10px 12px 12px;
    color: #fff;
    text-align: center;
    box-shadow: 0 10px 28px rgba(0,0,0,0.35);
    box-sizing: border-box;
}
.inline-result-message .message_mt {
    font-size: 0.92em;
    color: #cbd5e1;
    margin-bottom: 4px;
}
.inline-result-message .result-choice-summary {
    display: none;
}
.inline-result-message .result-final-text span {
    display: inline-block;
    font-size: 1.8em;
    font-weight: 900;
    color: #ffd54f;
    line-height: 1.1;
}
.inline-result-message .result-point-text {
    margin-top: 5px;
    font-size: 1em;
}
.inline-result-message .result-point-text strong {
    color: #86efac;
    font-size: 1.15em;
}
.inline-result-message .result-settlement-text {
    margin-top: 4px;
    color: #dbeafe;
    font-size: 0.82em;
    line-height: 1.35;
}
.inline-auto-next {
    margin-top: 7px;
    padding-top: 7px;
    font-size: 0.78em;
}
@media (max-width:768px) {
    .rps-display-only {
        height: 370px;
    }
    .result-reveal-choices {
        top: 36%;
    }
    .inline-result-message {
        bottom: 10px;
        width: calc(100% - 18px);
        padding: 9px 9px 10px;
    }
    .inline-result-message .result-final-text span {
        font-size: 1.55em;
    }
}


/* fixed13: 결과 영역은 짧게, 긴 안내 문구는 하단 게임 설명으로 이동 */
.rps-display-only {
    height: 360px;
    max-height: none;
    overflow: visible;
}
.result-reveal-choices {
    top: 43%;
}
.inline-result-message {
    bottom: 12px;
    max-width: 300px;
    padding: 8px 10px 9px;
    border-radius: 12px;
}
.inline-result-message .message_mt,
.inline-result-message .result-choice-summary,
.inline-result-message .result-settlement-text,
.inline-result-message .inline-auto-next,
.inline-result-message .auto-next-text {
    display: none !important;
}
.inline-result-message .result-final-text span {
    font-size: 1.55em;
    line-height: 1;
}
.inline-result-message .result-point-text {
    margin-top: 4px;
    font-size: 0.95em;
    line-height: 1.2;
}
.inline-result-message .result-point-text strong {
    font-size: 1.08em;
}
.guide {
    line-height: 1.55;
}
@media (max-width:768px) {
    .rps-display-only {
        height: 350px;
    }
    .result-reveal-choices {
        top: 42%;
        gap: 5px;
    }
    .reveal-choice-card {
        min-width: 74px;
        padding: 5px 4px;
    }
    .reveal-choice-card img {
        width: 54px;
    }
    .reveal-choice-text {
        font-size: 0.92em;
    }
    .inline-result-message {
        bottom: 8px;
        max-width: 270px;
        padding: 7px 8px 8px;
    }
    .inline-result-message .result-final-text span {
        font-size: 1.35em;
    }
    .inline-result-message .result-point-text {
        font-size: 0.88em;
    }
}

.opponent-player-line {
    font-weight:700;
    color:#222;
}
#opponent-nick {
    color:#0b63ce;
    font-weight:800;
}

.rps-history-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #fff;
}
.rps-history-head span {
    font-size: 13px;
    opacity: 0.85;
}
.rps-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
}
.rps-pagination button {
    min-width: 38px;
    padding: 7px 10px;
    border: 0;
    border-radius: 8px;
    background: rgba(255,255,255,0.16);
    color: #fff;
    cursor: pointer;
}
.rps-pagination button.active {
    background: #ffcc00;
    color: #222;
    font-weight: bold;
}
.rps-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
